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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
18903219922 | from logging import getLogger
from os.path import join
from configparser import NoOptionError
from uchicagoldrtoolsuite import log_aware
from uchicagoldrtoolsuite.core.app.abc.cliapp import CLIApp
from ..lib.writers.filesystemstagewriter import FileSystemStageWriter
from ..lib.readers.filesystemstagereader impo... | uchicago-library/uchicagoldr-toolsuite | uchicagoldrtoolsuite/bit_level/app/technicalmetadatacreator.py | technicalmetadatacreator.py | py | 5,572 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "uchicagoldrtoolsuite.core.app.abc.cliapp.CLIApp",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "configparser.NoOptionError",
"line_number": 102,
"usage_type": "name"
... |
15138075498 | """
test cli module
"""
import subprocess
from typing import List, Tuple
def capture(command: List[str]) -> Tuple[bytes, bytes, int]:
proc = subprocess.Popen(
command,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
out, err = proc.communicate()
return out, err, proc.returnco... | entelecheia/super-duper-waddle | tests/sdwaddle/test_cli.py | test_cli.py | py | 469 | python | en | code | 19 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "subprocess.Popen",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "subprocess.PIPE",
... |
15860273253 | from __future__ import division
from builtins import str
import numpy as np
import pandas as pd
import seaborn as sns
from .helpers import *
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42
def plot(results, subjgroup=None, subjname='Subject Group', listgroup=None,
l... | ContextLab/quail | quail/plot.py | plot.py | py | 10,790 | python | en | code | 18 | github-code | 36 | [
{
"api_name": "matplotlib.rcParams",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "seaborn.barplot",
"line_number": 93,
"usage_type": "attribute"
},
{
"api_name": "seaborn.swarmplot",
"line_number": 95,
"usage_type": "attribute"
},
{
"api_name": "... |
14860521204 | #!/usr/bin/env python
'''
对测试集数据进行测试,统计所有数据平均的RRMSE,SNR和CC值
'''
import argparse
import os
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from utility.data import EEGData
from utility.conv_tasnet_v1 import TasNet
from utility.network import ResCNN, Novel_CNN2, Novel_CNN, fcNN
import m... | BaenRH/DSATCN | code/evaluate_perSNR.py | evaluate_perSNR.py | py | 8,151 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "scipy.signal.butter",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "scipy.signal.lf... |
27271629688 | import time, random
import pygame
screen_w = 800
screen_h = 600
# Create the window
screen = pygame.display.set_mode((screen_w,screen_h))
black = (0,0, 0)
red = (255,0,0)
green = (0, 200, 0)
class Game(object):
def __init__(self):
self.screen = pygame.display.set_mode((800,600))
self.score = 0
self.oldScore... | eliazz95/JumpingGame | firstGame.py | firstGame.py | py | 6,406 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.display.set_mode",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pyg... |
42600266577 | # Копирование найденных надежных и ненадежных аудиозаписей по Социуму за 2017-2018 на архивный диск
import openpyxl, traceback
import os, string, sys, shutil
from collections import Counter
from lib import l, fine_snils_, read_config
FIND_CATALOG = '/media/da3/asteriskBeagleAl/'
#CHANGE_ON_WINDOWS = 'Z:/'
#OUTPUT_CATA... | dekarh/asocium | asociumWrite.py | asociumWrite.py | py | 9,480 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "string.digits",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "string.digits",
"line_number": 56,
"usage_type": "attribute"
},
{
"api_name": "sys.exc_info",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "traceback.print_tb... |
31056572667 | from django.contrib.auth.models import AbstractBaseUser, UserManager, \
PermissionsMixin
from django.core import validators
from django.db import models
from django.utils import timezone
from accounts import constants
class User(AbstractBaseUser, PermissionsMixin):
#: The Permission level for this user
p... | sublime1809/pto_tracker | accounts/models.py | models.py | py | 2,840 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.contrib.auth.models.AbstractBaseUser",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.models.PermissionsMixin",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 12,
"... |
26316442971 | import pandas as pd
from sklearn.impute import KNNImputer
from imblearn.over_sampling import SMOTE
from matplotlib import pyplot as plt
pd.set_option('display.max_columns', None)
pd.set_option('display.width', 1000)
df = pd.read_csv('./alzheimer.csv', skiprows=1, names=(
'Group', 'M/F', 'Age', 'EDUC', 'SES', 'MMSE',... | dlepke/4948-a1 | data_exploration.py | data_exploration.py | py | 4,701 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.set_option",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.get_dummies",... |
10650897169 | import frappe
import re
import jwt
from frappe import _
from frappe.utils.data import cstr, cint, flt
from frappe.utils import getdate
from erpnext.regional.india.e_invoice.utils import (GSPConnector,raise_document_name_too_long_error,read_json,get_transaction_details,\
validate_mandatory_fields,get_doc_details,get_ov... | venku31/ceramic | ceramic/e_invoice_ceramic.py | e_invoice_ceramic.py | py | 6,890 | python | en | code | null | github-code | 36 | [
{
"api_name": "re.compile",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "erpnext.regional.india.e_invoice.utils.validate_eligibility",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "frappe.db.get_value",
"line_number": 25,
"usage_type": "call"
},... |
74788585384 | import operator
from itertools import tee, starmap, groupby
from typing import Literal
def pairwise(iterable):
"s -> (s0,s1), (s1,s2), (s2, s3), ..."
a, b = tee(iterable)
next(b, None)
return zip(a, b)
def has_six_digits(i: int):
return 100_000 <= i <= 999_999
def is_nondecreasing_sequence(i: ... | el-hult/adventofcode2019 | day04/day4_lib.py | day4_lib.py | py | 1,183 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "itertools.tee",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "itertools.starmap",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "operator.le",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "itertools.groupby",
... |
6654095261 | from flask import Flask, render_template, request, redirect, session
from datetime import datetime
import random
app = Flask(__name__)
app.secret_key = 'JSaafE54!@#$%$#%^&*()_+'
@app.route('/')
def index():
#crear una variable session
if 'num_azar' not in session:
session['num_a... | cpinot/CodingDojo | python/flask/fundamentals/numeros_juegos_genial/server.py | server.py | py | 2,060 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "flask.session",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "random.randint",
"line_num... |
5232344019 | from openpyxl import load_workbook
wb = load_workbook("sample.xlsx")
ws = wb.active
# 번호 영어 수학
# 번호 (국어) 영어 수학
ws.move_range("B1:C11", rows=0, cols=1) # 0줄 밑으로, 1줄 오른쪽으로 이동
ws["B1"].value = "국어" # B1 셀에 '국어' 입력
# ws.move_range("C1:C11", rows=5, cols=-1) # 데이터 옮기면서 덮어씀
wb.save("sample_korean.xlsx") | OctoHoon/PythonStudy_rpa | rpa_basic/1_excel/9_move.py | 9_move.py | py | 402 | python | ko | code | 0 | github-code | 36 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 2,
"usage_type": "call"
}
] |
28128335578 | import os
import v2_draw_dynamic as main_app
import logging
import sys
def cmd(cmdstr):
print(cmdstr)
os.system(cmdstr)
def main():
'''
if len(sys.argv) < 2:
logging.error("please input msg log file")
return
'''
while True:
try:
main_app.draw... | HZRelaper2020/show_log | v2_draw_dynamic_script.py | v2_draw_dynamic_script.py | py | 497 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.system",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "v2_draw_dynamic.draw_dynamic",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.error",
"line_number": 21,
"usage_type": "call"
}
] |
11071680416 | #!/usr/bin/env python
# coding: utf-8
# -- GongChen'xi
#
# 20220112
# In[1]:
import baostock as bs
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import os, sys
# In[2]:
def fetch_info(stock_num, info, start_date, end_date):
bs.login()
rs = bs.query_history_k_data_plus(stock_n... | Chenxi-Gong/TradingPatternSimulation | simulation.py | simulation.py | py | 4,698 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "baostock.login",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "baostock.query_history_k_data_plus",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "baostock.logout",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pan... |
34338800542 | # https://leetcode.com/problems/n-ary-tree-level-order-traversal/
from typing import List
# Definition for a Node.
class Node:
def __init__(self, val=None, children=None):
self.val = val
self.children = children
class Solution:
def levelOrder(self, root: 'Node') -> List[List[int]]:
rs... | 0x0400/LeetCode | p429.py | p429.py | py | 714 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 12,
"usage_type": "name"
}
] |
15948222705 | import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import OneHotEncoder
def get_data_splits(X, Y, train_size=0.8):
"""This function splits the whole dataset into train, test and validation sets.
Args:
X (pd.DataFrame): DataFrame containing feature valu... | rahbararman/AnoShiftIDS | IDSAnoShift/data.py | data.py | py | 5,408 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.to_numeric",
"line_number": 36,
"usage_type": "c... |
42026376598 | # -*- coding: utf-8 -*-
from django.conf.urls import url
from .views import HomeView, ArchivesView, AboutView, PhotoView, MusicView, ArticleDetailView, CategoryView, TagListView, TagsView, CategoryListView, search
urlpatterns = [
url(r'^$', HomeView.as_view(), name='home'),
url(r'^archives/(?P<year>[0-... | JustBreaking/myblog | apps/myblog/urls.py | urls.py | py | 1,101 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.HomeView.as_view",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.HomeView",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.conf.u... |
27515854785 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 23 17:32:15 2020
geometry based sieving
"""
import os
import pickle
from skimage import measure
import pandas as pd
import numpy as np
import nibabel as nib
from skimage import measure
from sklearn import neighbors
# PROPERTIES = ['area', 'exten... | rsjones94/neurosegment | neurosegment/gbs.py | gbs.py | py | 5,678 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "nibabel.load",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "skimage.measure.label",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "skimage.measure",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "numpy.isclose",
... |
35000621242 | import os
import torch
import pandas as pd
import torchaudio
import cv2
import torchaudio.transforms as T
from torch.utils.data import Dataset
import numpy as np
from .utils_dataset import get_transform
class BatvisionV2Dataset(Dataset):
def __init__(self, cfg, annotation_file, location_blacklist=None):
... | AmandineBtto/Batvision-Dataset | UNetSoundOnly/dataloader/BatvisionV2_Dataset.py | BatvisionV2_Dataset.py | py | 3,853 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "os.listdir",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_... |
28780254481 | """
Python Crash Course, Third Edition https://ehmatthes.github.io/pcc_3e/
My notes: https://github.com/egalli64/pythonesque/pcc3
Chapter 15 - Generating Data - Plotting a Simple Line Graph - Plotting a Series of Points with scatter()
"""
import matplotlib.pyplot as plt
plt.style.use('seaborn')
fig, ax = plt.subplots... | egalli64/pythonesque | pcc3/ch15/e1f_scatter_points.py | e1f_scatter_points.py | py | 587 | python | en | code | 17 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 9,
"usage_type": "name"
},
{
"api_name"... |
38033757546 | import dataclasses
import pickle
import re
from collections.abc import Hashable
from datetime import datetime
from pathlib import Path
from typing import Callable, ClassVar, Dict, FrozenSet, List, Optional, Set, Union
import pytest
from typing_extensions import Literal
import pydantic
from pydantic import BaseModel, ... | merlinepedra25/PYDANTIC | tests/test_dataclasses.py | test_dataclasses.py | py | 34,040 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pydantic.dataclasses",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pydantic.dataclasses",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "pydantic.dataclasses",
"line_number": 42,
"usage_type": "attribute"
},
{
"api... |
31508455076 | import asyncio
import json
from aiogram import Bot, Dispatcher, executor, types
from aiogram.utils.markdown import hbold, hunderline, hcode, hlink
from aiogram.dispatcher.filters import Text
from config import token
from test import morph
from main import check_news_update
bot = Bot(token=token, parse_mode=types.Par... | KondratevProgi/news | tg_bot.py | tg_bot.py | py | 2,254 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "aiogram.Bot",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "config.token",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "aiogram.types.ParseMode",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "aiogram.types",... |
45556966628 | """Calcula el precio de la energía diario a partir de los precio horarios"""
import pathlib
from utils import read_format_hourly_prices, resample_hourly_prices
base_path = pathlib.Path.cwd()
cleansed_path = base_path.joinpath("data_lake/cleansed")
business_path = base_path.joinpath("data_lake/business")
def compute... | productos-de-datos/proyecto-albetancurqu42 | src/data/compute_daily_prices.py | compute_daily_prices.py | py | 1,216 | python | es | code | 0 | github-code | 36 | [
{
"api_name": "pathlib.Path.cwd",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "utils.read_format_hourly_prices",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "util... |
24788364259 | import collections
import heapq
class Solution:
def networkDelayTime(self, times: list[list[int]], n: int, k: int) -> int:
graph = collections.defaultdict(list)
for u, v, w in times:
graph[u].append((w, v))
hq = [(0, k)]
dist = collections.defaultdict(int)
while h... | inhyeokJeon/AALGGO | Python/LeetCode/shortest_path/743_network_delay_time.py | 743_network_delay_time.py | py | 772 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.defaultdict",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "heapq.heappop",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "heapq.hea... |
71119081063 | def minigame():
import pygame
import sys
import pictures
import random
status = 'alive'
zombie_size = [50,100,150,200,250,300]
obstacle_list = []
bg_pos = 0
move= 0
side = 0
score = 0
game_screen = pygame.display.set_mode((608,342)) #creates a screen 1024 pixels wide and 576 pixels long
clock = pygame... | jadeyujinlee/Smithpocalypse-v.1 | minigame.py | minigame.py | py | 3,488 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.display.set_mode",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pygame.time.Clock",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.... |
9108378468 | from setuptools import setup, find_packages
from os import path
from io import open
here = path.abspath(path.dirname(__file__))
reqs = []
with open(path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
with open(path.join(here, "requirements.txt"), encoding="utf-8") as f:
read_lin... | kirankotari/decimaljs | setup.py | setup.py | py | 1,323 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "io.open",
"line_number": 8,
... |
74267310505 | # -*- coding: utf-8 -*-
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | line/line-bot-sdk-python | linebot/models/actions.py | actions.py | py | 9,405 | python | en | code | 1,739 | github-code | 36 | [
{
"api_name": "base.Base.get_or_new_from_json_dict_with_types",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "base.Base",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "future.utils.with_metaclass",
"line_number": 54,
"usage_type": "call"
},
{
... |
13038148522 | import fresh_tomatoes
import media
import requests
import json
import config
youtube_suffix = config.youtube_key
youtube_prefix = 'https://www.youtube.com/watch?v='
# Movie list -- Here you can add and subtract movies as your tastes change
movie_list = ["There Will Be Blood", "The Life Aquatic", "Unforgiven",
... | aaronbjohnson/movie-trailer-website | entertainment_center.py | entertainment_center.py | py | 1,862 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "config.youtube_key",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "requests.get",
"li... |
23420997070 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ventas', '0075_auto_20161016_1522'),
]
operations = [
migrations.RenameField(
model_name='comanda',
... | pmmrpy/SIGB | ventas/migrations/0076_auto_20161016_1554.py | 0076_auto_20161016_1554.py | py | 1,288 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.RenameField",
"line_number": 14,
"usage_type": "call"
},
... |
37677063476 | #!/usr/bin/env python3
import os
import sys
import urllib.request
from flask import (
Flask,
flash,
jsonify,
make_response,
redirect,
render_template,
request,
)
from werkzeug.utils import secure_filename
from scripts import predict_model
from scripts import mongodb
from scripts import tr... | projectasteria/PlaceholderAPI | app.py | app.py | py | 6,137 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "scripts.mongodb.get_list_users",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "scripts.mong... |
71578942183 | import vtk
def main():
colors = vtk.vtkNamedColors()
# Set the background color.
colors.SetColor("bkg", [0.2, 0.3, 0.4, 1.0])
# Create a sphere to deform
sphere = vtk.vtkSphereSource()
sphere.SetThetaResolution(51)
sphere.SetPhiResolution(17)
sphere.Update()
bounds = sphere.G... | lorensen/VTKExamples | src/Python/Meshes/DeformPointSet.py | DeformPointSet.py | py | 3,526 | python | en | code | 319 | github-code | 36 | [
{
"api_name": "vtk.vtkNamedColors",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "vtk.vtkSphereSource",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "vtk.vtkElevationFilter",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "vtk.vtkP... |
71578941543 | #!/usr/bin/env python
import os.path
import vtk
def get_program_parameters():
import argparse
description = 'Decimate polydata.'
epilogue = '''
This is an example using vtkDecimatePro to decimate input polydata, if provided, or a sphere otherwise.
'''
parser = argparse.ArgumentParser(descrip... | lorensen/VTKExamples | src/Python/Meshes/Decimation.py | Decimation.py | py | 5,683 | python | en | code | 319 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "vtk.vtkNamedColors",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.path.isfile",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.pat... |
70943557223 | from pyspark.sql import SparkSession
spark = SparkSession.builder.appName('test_rdd').getOrCreate()
sc = spark.sparkContext
class TestRDD():
# Creations
def test_create_from_dataframe(self):
df = spark.range(10).toDF('id')
rdd = df.rdd
rows = rdd.collect()
assert len(rows) == ... | bablookr/big-data-experiments | pyspark-experiments/test/test_rdd.py | test_rdd.py | py | 4,725 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 3,
"usage_type": "... |
3082899682 | import json
from hsfs import util
import humps
class TrainingDatasetSplit:
TIME_SERIES_SPLIT = "TIME_SERIES_SPLIT"
RANDOM_SPLIT = "RANDOM_SPLIT"
TRAIN = "train"
VALIDATION = "validation"
TEST = "test"
def __init__(
self,
name,
split_type,
percentage=None,
... | logicalclocks/feature-store-api | python/hsfs/training_dataset_split.py | training_dataset_split.py | py | 2,210 | python | en | code | 50 | github-code | 36 | [
{
"api_name": "json.dumps",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "hsfs.util.FeatureStoreEncoder",
"line_number": 69,
"usage_type": "attribute"
},
{
"api_name": "hsfs.util",
"line_number": 69,
"usage_type": "name"
},
{
"api_name": "humps.decamel... |
72489930665 | import numpy as np
import itertools
import argparse
cards = ['A', 'K', 'Q', 'J', '10', '9', '8', '7', '6', '5', '4', '3', '2']
suits = ['S', 'H', 'C', 'D']
class Card:
def __init__(self, val, suit):
self.val = val
self.suit = suit
def __str__(self):
return f'{self.val} {self.suit}'
c... | arpit-1110/Poker | poker_odds.py | poker_odds.py | py | 7,581 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.asarray",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 94,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 95,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
... |
6798346511 | import celery
import logging
import requests
from django.conf import settings
from ..models import Job
from ..helper import data_job_for_applicant
JOB_URL_CREATE = 'api/admin/'
JOB_URL_DETAIL = 'api/admin/{}/'
logger = logging.getLogger('celery-task')
class ApplicantJobMixin:
host = settings.EXOLEVER_HOST + ... | tomasgarzon/exo-services | service-exo-opportunities/jobs/tasks/applicant.py | applicant.py | py | 2,899 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.EXOLEVER_HOST",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 18,
"usage_type": "name"
},
{
"ap... |
16645056447 | import re
import pandas as pd
pd.set_option('display.max_rows', None)
from pathlib import Path
file_path = Path('texts/wf_anthology.txt')
# Read in the text file as a string
with open(file_path, 'r') as f:
text = f.read()
# define the regular expression pattern to match the section title, author's name, and intr... | kspicer80/weird_fiction_experiments | author_story_similarity.py | author_story_similarity.py | py | 1,727 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.set_option",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "re.finditer",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.MULTILINE",
"line_num... |
20360966046 | from tkinter import *
from tkinter import ttk
from tkinter.filedialog import askdirectory
from tkinter.filedialog import askopenfilename
from PIL import Image
# =================================================================================
def convertion():
u_path = str(t1.get())
d_path = str(t2.... | sagnik403/Image-Converter-Tkinter | main.py | main.py | py | 2,752 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "PIL.Image.open",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "tkinter.filedialog.askdirectory",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tkinter.file... |
30714122215 | import math
from re import L
import cv2
import mediapipe as mp
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from moviepy.editor import VideoFileClip
mp_drawing = mp.solutions.drawing_utils
mp_drawing_styles = mp.solutions.drawing_styles
mp_pose = mp.solutions.pose
subjectpath = '/Volumes/Transcend... | wenxxi/LESS-video-slicing | s_ankle_slicing.py | s_ankle_slicing.py | py | 6,489 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "mediapipe.solutions",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_nam... |
17883497405 | import time
t_start_script = time.time()
print(__name__)
import matplotlib.pyplot as plt
import numpy as np
a = np.random.randn(1000 * 100* 100)
print('start_time and prepare data:', time.time() - t_start_script)
print(a.shape)
print(sys.argv)
# >>>
#print('11123',a)
if __name__ == '__main__':
t0 = time.time()... | pyminer/pyminer | pyminer/packages/applications_toolbar/apps/cftool/test1.py | test1.py | py | 542 | python | en | code | 77 | github-code | 36 | [
{
"api_name": "time.time",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "numpy.random.randn",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_num... |
15442911590 | import argparse
from . import completion_helpers
class ArgumentParser(argparse.ArgumentParser):
def enable_print_header(self):
self.add_argument(
'-q', action='store_true',
help="Suppresses printing of headers when multiple tasks are " +
"being examined"
... | mesosphere-backup/mesos-cli | mesos/cli/parser.py | parser.py | py | 1,067 | python | en | code | 116 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "attribute"
}
] |
17585289452 | import requests
from starwhale import Link, Image, Point, dataset, Polygon, MIMEType # noqa: F401
from starwhale.utils.retry import http_retry
PATH_ROOT = "https://starwhale-examples.oss-cn-beijing.aliyuncs.com/dataset/cityscapes"
ANNO_PATH = "disparity/train"
DATA_PATH_LEFT = "leftImg8bit/train"
DATA_PATH_RIGHT = "... | star-whale/starwhale | example/datasets/cityscapes/disparity/dataset.py | dataset.py | py | 2,278 | python | en | code | 171 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "starwhale.utils.retry.http_retry",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "starwhale.Image",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "starwha... |
41551247368 | from importlib.resources import path
from kubernetes import client as kclient
from kubernetes import config
config.load_incluster_config()
v1 = kclient.CoreV1Api()
# Trainer Pod deletes itself
try:
api_response = v1.delete_namespaced_pod(
name='trainer', namespace='mlbuffet')
except Exception as e:
p... | zylklab/mlbuffet | modules/trainer/apoptosis.py | apoptosis.py | py | 408 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "kubernetes.config.load_incluster_config",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "kubernetes.config",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "kubernetes.client.CoreV1Api",
"line_number": 6,
"usage_type": "call"
},
{
... |
22163777058 | #!/usr/bin/env python
import csv
import gzip
import os
import re
import sys
from pyproj import Transformer
csv.field_size_limit(sys.maxsize)
AMOUNT_REGEX = re.compile('Both Installment[\s\S]+?\$([\d,\.]+)')
# California Zone 3
# https://epsg.io/2227
transformer = Transformer.from_crs(2227, 4326)
def get_val(row, ... | typpo/ca-property-tax | scrapers/santa_cruz/parse.py | parse.py | py | 2,041 | python | en | code | 89 | github-code | 36 | [
{
"api_name": "csv.field_size_limit",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.maxsize",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pyproj.Transformer.f... |
73744186345 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lexicon', '0112_auto_20160929_1340'),
]
operations = [
migrations.AlterModelOptions(
name='meaning',
... | lingdb/CoBL-public | ielex/lexicon/migrations/0113_auto_20161004_1315.py | 0113_auto_20161004_1315.py | py | 682 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterModelOptions",
"line_number": 14,
"usage_type": "call"
... |
36947928289 | from __future__ import print_function
__revision__ = "src/engine/SCons/Tool/rpmutils.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan"
import platform
import subprocess
import SCons.Util
# Start of rpmrc dictionaries (Marker, don't change or remove!)
os_canon = {
'AIX' : ['AIX','5'],
'Am... | mongodb/mongo | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/rpmutils.py | rpmutils.py | py | 15,575 | python | en | code | 24,670 | github-code | 36 | [
{
"api_name": "subprocess.check_output",
"line_number": 412,
"usage_type": "call"
},
{
"api_name": "SCons.Util.Util.to_str",
"line_number": 413,
"usage_type": "call"
},
{
"api_name": "SCons.Util.Util",
"line_number": 413,
"usage_type": "attribute"
},
{
"api_name":... |
72170366505 | import pandas as pd
import numpy as np
import joblib
import pickle
import warnings
import os
from data.make_dataset import preprocess_train_df
warnings.filterwarnings("ignore")
def make_categorical_dataset(processed_dfs, proteins_df):
"""
Turns the train_updrs.csv into a categorical dataset
based on the ... | dagartga/Boosted-Models-for-Parkinsons-Prediction | src/pred_pipeline.py | pred_pipeline.py | py | 9,293 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"lin... |
22783063408 | #
# @lc app=leetcode id=347 lang=python3
#
# [347] Top K Frequent Elements
#
# https://leetcode.com/problems/top-k-frequent-elements/description/
#
# algorithms
# Medium (62.25%)
# Likes: 4564
# Dislikes: 260
# Total Accepted: 550.4K
# Total Submissions: 881.4K
# Testcase Example: '[1,1,1,2,2,3]\n2'
#
# Given a ... | Zhenye-Na/leetcode | python/347.top-k-frequent-elements.py | 347.top-k-frequent-elements.py | py | 2,170 | python | en | code | 17 | github-code | 36 | [
{
"api_name": "collections.Counter",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "heapq.heappushpop",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "heapq.heappop",
... |
43911017589 | import datetime
import zadanie2lista6
import zadanie22lista6
plik = 'plik_do_szyfrowania.txt.txt'
openplik = open(plik,"r").read()
a = int(input("Podaj liczbe od 1-10: "))
date_today = datetime.date.today()
month = date_today.month
year = date_today.year
day = date_today.day
g = ['plik_zaszyfrowany','_',a,year,'-'... | AWyszynska/JSP2022 | lista8/zadanie1i2.py | zadanie1i2.py | py | 898 | python | pl | code | 0 | github-code | 36 | [
{
"api_name": "datetime.date.today",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "zadanie2lista6.Szyfr_Cezara",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "zada... |
74105621545 | from django.shortcuts import render
# se importan los modelos
from .models import Author, Genre, Book, BookInstance
# se crea la funcion index
def index (request) :
# se optiene el numero de libros
num_books = Book.objects.all().count()
# se optiene el numero de instancias
num_inctances = Book... | MallicTesla/Mis_primeros_pasos | Programacion/002 ejemplos/002 - 13 django catalogo/catalog/views.py | views.py | py | 1,201 | python | es | code | 1 | github-code | 36 | [
{
"api_name": "models.Book.objects.all",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.Book.objects",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "models.Book",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "models.B... |
3642645644 | #!/usr/bin/python
import json
import sys
out_file = sys.argv[1]
document_entities_file = sys.argv[2]
query_file = sys.argv[3]
query_docs = {}
docs = set()
with open(out_file) as f:
for line in f:
query, _, document, rank, _, _ = line.split()
rank = int(rank)
if rank > 10:
continue
if query not in query_... | gtsherman/entities-experiments | src/query_entities.py | query_entities.py | py | 992 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number":... |
36968708533 | from collections import namedtuple
import os
# from unittest.mock import patch
import datetime
import random
import pytest
import hug
from bson.objectid import ObjectId
from pymongo import MongoClient
from pymongo.uri_parser import parse_uri
from helpers import clean_url, clean_email, hash_password
from db import DB
... | ellisonleao/ef-url-shortener | test_api.py | test_api.py | py | 11,725 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.environ.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pymongo.uri_parser... |
22430840352 | # Import SQLite3
import sqlite3
#create a database connection called "cars"
conn = sqlite3.connect("cars.db")
#Create the cursor to execute commands
cursor = conn.cursor()
#create a table/query called inventory that includes "make, model and quantity"
#use the cursor to execute this!
cursor.execute("""CREATE TABLE i... | JackM15/sql | car_sql.py | car_sql.py | py | 438 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlite3.connect",
"line_number": 5,
"usage_type": "call"
}
] |
8711592711 | import cx_Oracle
class modulo():
codigoSeccion=0
ramo1=""
ramo2=""
ramo3=""
ramo4=""
def __init__(self,codSec) :
self.codigoSeccion=codSec
def crearModulo():
try:
conexion=cx_Oracle.connect(
user='escuela',
passwo... | nmolina2733/Universidad | modulo.py | modulo.py | py | 3,357 | python | es | code | 0 | github-code | 36 | [
{
"api_name": "cx_Oracle.connect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cx_Oracle.connect",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "cx_Oracle.connect",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "cx_Oracle.conne... |
72426420905 | from rest_framework.test import APITestCase
from restapi.models import Companies, Countries
class FilterTest(APITestCase):
@classmethod
def setUpTestData(cls):
companies = 10
Countries.objects.create(name="c", continent="c", population=1, capital="c", surface=1)
country = Countries.ob... | UBB-SDI-23/lab-5x-andrei-crisan27 | backend-project/tests/test_filter.py | test_filter.py | py | 939 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "rest_framework.test.APITestCase",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "restapi.models.Countries.objects.create",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "restapi.models.Countries.objects",
"line_number": 10,
"usage_type"... |
74430232105 | from django.urls import path
from . import views
urlpatterns = [
path(
'',
views.all_products,
name='products'),
path(
'ranked/',
views.products_ranking,
name='products_ranking'),
path(
'<int:product_id>/',
views.product_detail,
name='... | neil314159/portfolio-project-5 | products/urls.py | urls.py | py | 1,650 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
15009189438 | import pathlib
from typing import Optional
import essentia.standard as es
import numpy as np
import pyrubberband as pyrb
from madmom.features.downbeats import DBNDownBeatTrackingProcessor, RNNDownBeatProcessor
from mixer.logger import logger
SAMPLE_RATE = 44100 # Sample rate fixed for essentia
class TrackProcesso... | joekitsmith/mixer | mixer/processors/track.py | track.py | py | 5,050 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.Optional",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_numb... |
72498628583 | import os
import sys
import zipfile
import urllib.request
import filecmp
import shutil
import errno
import typing
import orjson
VERSIONS_JSON = "https://launchermeta.mojang.com/mc/game/version_manifest.json"
RELEASE_TYPES = typing.Literal["release", "snapshot"]
def fetch_json(url: str):
response = urllib.request... | AstreaTSS/mc-texture-changes | compare.py | compare.py | py | 3,236 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "typing.Literal",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "urllib.request.request.urlopen",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 16,
"usage_type": "attribute"
},
{
"ap... |
70376331945 | import XInput
from pynput import keyboard
from pygame import mixer
mixer.init()
import time
class XinputHandler(XInput.EventHandler):
def __init__(self, keyMan):
super().__init__(0, 1, 2, 3)
self.keyMan = keyMan
def process_button_event(self, event):
if event.type == XInput.EVENT_BUTTO... | tsoushi/SimpleRealtimeTJAEditor | taiko_nothread.py | taiko_nothread.py | py | 2,738 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.mixer.init",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "XInput.EventHandler",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "XInput.EVENT_BUT... |
13422218557 | import colors
##################################################################
#This is the module used for testing correctness. It performs #
#safety, liveliness and fairness test on the list of values sent #
#from the monitor. #
##################################################################
def test... | NishanthMuruganandam/AsynchronousSystems | Correctness_Verif_Performance_Measure_DistAlgos/correctnessTester.py | correctnessTester.py | py | 3,322 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "colors.bcolors",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "colors.bcolors",
"line_number": 120,
"usage_type": "call"
}
] |
19340358372 | import json
import logging
import math
from django.db import IntegrityError
from django.db.models import F
from datetime import datetime, timedelta
from django.template.loader import render_to_string
from anodyne import settings
from api.models import Reading, Station, StationInfo, StationParameter, \
Exceedance,... | anodyneweb/aw_backend | anodyne/anodyne/connectors/to_database.py | to_database.py | py | 6,957 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "api.models.StationParameter.objects.get",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "api.models.StationParameter.objects",
"line_number": 29,
"usage_type": "attribu... |
38043839602 | import xlrd #读取excel
import xlwt #写入excel
from datetime import date,datetime
def read_excel(name):
#打开文件
workbook = xlrd.open_workbook('../data/' + name + '.xlsx')
#获取所有sheet
# print(workbook.sheet_names()) #只有一张表
sheet_name = workbook.sheet_names()[0]
#根据sheet索引或者名称获取sheet内容
sheet =... | MrLeedom/TSC_RL | CSP/preprocess/third.py | third.py | py | 1,744 | python | en | code | 7 | github-code | 36 | [
{
"api_name": "xlrd.open_workbook",
"line_number": 7,
"usage_type": "call"
}
] |
74131826985 | import pytest
from framework.base_case import BaseCase
from framework.my_requests import MyRequests
from tests.assertions import Assertions
from tests.data_list_for_test import DataForCommon
id_req = '123-abc-321'
name = 'Jack'
surname = 'Lee'
age = 50
method = 'select'
filter_phone = '1234567890'
class TestCommon(B... | Bozmanok/qa-test | tests/test_common.py | test_common.py | py | 1,229 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "framework.base_case.BaseCase",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "framework.my_requests.MyRequests.any_method",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "framework.my_requests.MyRequests",
"line_number": 17,
"usage_typ... |
20603617401 | from selenium import webdriver
page_type = -1 # set default
driver = webdriver.Firefox(executable_path="./geckodriver")
driver.fullscreen_window()
driver.implicitly_wait(30)
# for signal
import signal
'''
driver.window_handles[0] : Happy face (default)
driver.window_handles[1] : Map
driver.window_handles[2] : Sad ... | INYEONGKIM/tony-and-naeyo | ref/display-switching/selenium-ver/firefoxOpener.py | firefoxOpener.py | py | 2,350 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "signal.signal",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "signal.SIGU... |
21527384857 | # -*- coding: utf-8 -*-
"""Document directory_store here."""
import codecs
import logging
import os
import platform
from six import string_types
from six.moves.urllib import parse as urllib
from oaiharvest.record import Record
class DirectoryRecordStore(object):
def __init__(self, directory, createSubDirs=False... | bloomonkey/oai-harvest | oaiharvest/stores/directory_store.py | directory_store.py | py | 2,189 | python | en | code | 62 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "oaiharvest.record.Record",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "codecs.open",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "oaiharvest.rec... |
17170052915 | import logging
from flask import Flask, request
from picstitch import load_review_stars, load_amazon_prime, load_fonts, \
PicStitch
from gcloud import storage
import boto
import io
import time
import os
# # ---- Logging prefs -----
log_format = "[%(asctime)s] [%(process)d] [%(levelname)-1s] %(message)s"
d... | Interface-Foundry/IF-root | src/image_processing/server.py | server.py | py | 3,767 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "boto.s3.connect_to_... |
40403373260 | from dash import Dash, html, dcc
import plotly.express as px
import pandas as pd
import numpy as np
import statsmodels as sm
from scipy.stats import ttest_1samp
from statsmodels.stats.power import TTestPower
import plotly.express as px
import plotly.offline as pyo
import plotly.io as pio
from jupyter_dash import Jupyte... | ashton77/statistical-simulations | simulation_app.py | simulation_app.py | py | 3,106 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "dash.Dash",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "dash.html.Div",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "dash.html",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "dash.html.H1",
"line_number": 1... |
42242738770 | #!/usr/bin/env python
import numpy
import scipy.integrate
from pylab import *
datafile="../../../Mathematica/calculated_vals.tsv"
tag,x,e,f = numpy.loadtxt("data.txt",unpack=True)
tags=numpy.unique(tag)
flimit = numpy.zeros(len(tags))
for i in range(0,len(tags)):
itag=tags[i]
inds = numpy.where(tag == itag)... | charlesblakemore/opt_lev_analysis | casimir/scuffCode/Comparison/byXi/plot_integrand.py | plot_integrand.py | py | 773 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "numpy.loadtxt",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number"... |
7405277670 | import numpy as np
import math
import re
import feedparser as fp
def loadDataSet():
postingList = [['my', 'dog', 'has', 'flea', 'problems', 'help', 'please'],
['maybe', 'not', 'take', 'him', 'to', 'dog', 'park', 'stupid'],
['my', 'dalmation', 'is', 'so', 'cute', 'I', 'love', 'h... | GuoBayern/MachineLearning | bayes.py | bayes.py | py | 5,884 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.ones",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_number": 45,
... |
71326379303 | import numpy as np
import sympy as sp
import math
from matplotlib import pyplot as plt
#BEGIN EXERCISE 1
def left_endpoint_sum(f,a,b,n):
d = (b-a) / n
sum = 0
for i in range(0,n):
sum += f(a + i*d)
return d*sum
def right_endpoint_sum(f,a,b,n):
d = (b-a) / n
sum = 0
for i in range(1,n+1):
sum +=... | Drew-Morris/Real-Analysis-PY | Integration/Integration-Vim.py | Integration-Vim.py | py | 6,124 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sympy.symbols",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "math.e",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "numpy.linspace",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_n... |
21577690614 | import yaml
import torch
import torch.nn as nn
from . import layers
class Model(nn.Module):
def __init__(self, yaml_file):
super(Model, self).__init__()
with open(yaml_file, 'r') as file:
try:
model_cfg = yaml.load(file.read(), Loader=yaml.FullLoader)
excep... | IMath123/imath | Model/__init__.py | __init__.py | py | 2,826 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "yaml.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "yaml.FullLoader",
"line_num... |
30239035937 | """
This module provides functions for justifying Unicode text in a monospaced
display such as a terminal.
We used to have our own implementation here, but now we mostly rely on
the 'wcwidth' library.
"""
from unicodedata import normalize
from wcwidth import wcswidth, wcwidth
from ftfy.fixes import remove_terminal_es... | rspeer/python-ftfy | ftfy/formatting.py | formatting.py | py | 5,798 | python | en | code | 3,623 | github-code | 36 | [
{
"api_name": "wcwidth.wcwidth",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "wcwidth.wcswidth",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "ftfy.fixes.remove_terminal_escapes",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "u... |
22889044030 | import sys
from PyQt5 import QtCore, QtWidgets, uic
import mysql.connector as mc
from PyQt5.QtWidgets import QTableWidgetItem
from PyQt5.QtWidgets import QMessageBox
from FrmMatakuliah import WindowMatakuliah
qtcreator_file = "dashboard_admin.ui" # Enter file here.
Ui_MainWindow, QtBaseClass = uic.loadUiType(... | freddywicaksono/python_login_multiuser | DashboardAdmin.py | DashboardAdmin.py | py | 1,432 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "PyQt5.uic.loadUiType",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PyQt5.uic",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.Q... |
42263303655 | from django import template
from all_products.queryutil import ShirtQuery
register = template.Library()
@register.filter
def shirt_price(shirt):
shirt_query = ShirtQuery(shirt)
for size in shirt_query.sizes:
stock = shirt_query.get_stock(size)
if stock > 0:
return shirt_query.get_price(size) | drivelous/ecmrc | shirts/templatetags/shirt_price.py | shirt_price.py | py | 319 | python | en | code | 12 | github-code | 36 | [
{
"api_name": "django.template.Library",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "all_products.queryutil.ShirtQuery",
"line_number": 9,
"usage_type": "call"
}
] |
32520478741 | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 24 13:13:32 2018
@author: Administrator
"""
import wget, time
import os
# 网络地址
DATA_URL = 'http://164.52.0.183:8000/file/findTrace/2018-12-24.txt'
# DATA_URL = '/home/xxx/book/data.tar.gz'
out_fname = '2018-12-24.txt'
def download(DATA_URL):
out_fname = '2018-12-... | Y1ran/Pensieve-A3C-Streaming-Adaptive-Bitrate-Model | final/download_data.py | download_data.py | py | 2,603 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "time.ctime",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "wget.download",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
29432294183 | from pymongo import MongoClient
client = MongoClient('localhost', 27017)
database = client.mflix
pipline = [
{'$unwind':'$cast'},
{'$group':
{
'_id':'$cast',
'count':{'$sum':1}
}},
{
'$sort':{'count':-1}
}]
actors = database.movies.aggregate(pipline)
for... | RezaeiShervin/MaktabSharif89 | Shervin_Rezaei_HW18_MaktabSharif89/Shervin_Rezaei_HW18_MaktabSharif89(7).py | Shervin_Rezaei_HW18_MaktabSharif89(7).py | py | 355 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 3,
"usage_type": "call"
}
] |
39350644450 | import copy
import numpy as np
import cv2
import time
import random
import argparse
def draw_obstacles(canvas,clr=5,unknown=False, map_flag=1):
"""
@brief: This function goes through each node in the canvas image and checks for the
obstacle space using the half plane equations.
If the node is in obsta... | okritvik/MOD-RRT-Star-Implementation-Point-Robot | mod_rrt_star.py | mod_rrt_star.py | py | 22,275 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "numpy.sqrt",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "numpy.power",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 110,
"usage_type": "call"
},
{
"api_name": "numpy.power",
"line_number":... |
24324519488 | from pathlib import Path
from typing import IO
def sentencepiece_load(file):
"""Load a SentencePiece model"""
from sentencepiece import SentencePieceProcessor
spm = SentencePieceProcessor()
spm.Load(str(file))
return spm
# source: https://github.com/allenai/allennlp/blob/master/allennlp/common/f... | bheinzerling/bpemb | bpemb/util.py | util.py | py | 3,501 | python | en | code | 1,146 | github-code | 36 | [
{
"api_name": "sentencepiece.SentencePieceProcessor",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "typing.IO",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "warnings.catch_warnings",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": ... |
15514519322 | import json
import os
import shutil
import sys
import tempfile
import unittest
from compare_perf_tests import LogParser
from compare_perf_tests import PerformanceTestResult
from compare_perf_tests import ReportFormatter
from compare_perf_tests import ResultComparison
from compare_perf_tests import TestComparator
from ... | apple/swift | benchmark/scripts/test_compare_perf_tests.py | test_compare_perf_tests.py | py | 38,114 | python | en | code | 64,554 | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "compare_perf_tests.PerformanceTestResult.fromOldFormat",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "compare_perf_tests.PerformanceTestResult",
"line_number": 23,
... |
40243466051 | import streamlit as st
import cv2
import time
import os
import tempfile
import matplotlib.pyplot as plt
from src.utils.streamlit import factors
from src.utils.onnx_process import load_model, load_label_map, video_predict
from src.utils.video_process import video_stitch
from src.utils.streamlit import save_uploaded_file... | teyang-lau/you-only-edit-once | streamlit_app_onnx.py | streamlit_app_onnx.py | py | 5,602 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "streamlit.spinner",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "src.utils.onnx_process.load_model",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "streamlit.write",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "s... |
33899004274 | import json
from copy import deepcopy
import numpy as np
import pandas as pd
from CWiPy import settings
from CWiPy.MembershipFunction import MembershipFunction
from CWiPy.Modifier import dict_modifiers
def get_synonyms(word):
"""
Args:
word:
Returns:
list of objects containing term and... | akali/fuzzy | CWiPy/Syntax.py | Syntax.py | py | 7,092 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "CWiPy.settings.BASE_DIR",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "CWiPy.settings",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "CWiPy.settings.STATIC_DIR",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_na... |
932987117 | from django.db.models.signals import post_save
from django.dispatch import receiver
from .models import Piece
@receiver(post_save, sender=Piece)
def save_base64_thumbnail(**kwargs):
update_fields = kwargs["update_fields"]
# Without this, the signal will be called in an infinite loop.
if update_fields is ... | ChrisCrossCrash/chriskumm.com_django | art/signals.py | signals.py | py | 569 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.dispatch.receiver",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.db.models.signals.post_save",
"line_number": 6,
"usage_type": "argument"
},
{
"api_name": "models.Piece",
"line_number": 6,
"usage_type": "name"
}
] |
28031460700 | import pickle
import numpy as np
import sklearn.base
from matplotlib.figure import figaspect
from sklearn.linear_model import LogisticRegression
from dataclasses import dataclass
from sklearn.preprocessing import StandardScaler
from . import network
from tqdm import tqdm
from sklearn.decomposition import PCA
import m... | pni-lab/connattractor | connattractor/analysis.py | analysis.py | py | 16,176 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "numpy.sqrt",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.arctan2",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 25,... |
2180953342 | from flask import Flask, jsonify, request
import datetime
import fetchNavigationData
app = Flask(__name__)
app.config['JSON_AS_ASCII'] = False
@app.route('/api', methods=['GET'])
def index():
first = request.args.get('first', '')
second = request.args.get('second', '')
json1 = fetchNavigationData.fetch_st... | 5ym/smaen | back/module/app.py | app.py | py | 1,208 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "flask.reque... |
4292641099 | from django.contrib.auth.models import User
from django.test import TestCase
from note.forms import NoteAddForm, NoteEditForm
from note.models import Note
class NoteFormsTestCase(TestCase):
def setUp(self):
# Arrange
self.user = User.objects.create_user(username='test_user', password='test_pass')... | mehdirahman88/django_notes | note/tests/test_forms.py | test_forms.py | py | 2,820 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.test.TestCase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.models.User.objects.create_user",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects",
"line_number": 11,
"usa... |
71001076263 | #!/usr/bin/env python
#
# This script downloads a game from OGS and produces a .game file
# that can be used by our test estimator.
#
import requests
import sys
def fetch_game(game_id):
res = requests.get('https://online-go.com/termination-api/game/%d/state' % game_id)
if res.status_code != 200:
sys.s... | online-go/score-estimator | tools/fetch_ogs_game.py | fetch_ogs_game.py | py | 1,827 | python | en | code | 51 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.stderr.write",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_nu... |
25759812026 | #!/usr/bin/env python
import os
import json
from twitter import Api
# Custom import
from datetime import datetime
from datetime import date
import time
import re
import sys
def loadConfig(config_secret):
# Go to http://apps.twitter.com and create an app.
# The consumer key and secret will be generated for yo... | gunarto90/twitter-stream | stream.py | stream.py | py | 11,136 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "json.loads",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 80,
"us... |
1137077324 | import json
# things we need for NLP
import nltk
from nltk.stem.lancaster import LancasterStemmer
nltk.download('punkt')
stemmer = LancasterStemmer()
# things we need for Tensorflow
import numpy as np
import tflearn
import tensorflow as tf
import random
import pickle
class ModelBuilder(object):
def __init__(self):... | nlokare/chatbot | chat_model.py | chat_model.py | py | 4,023 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "nltk.download",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "nltk.stem.lancaster.LancasterStemmer",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "nltk.word_... |
33989498564 | from django.contrib.auth.models import User
from django.shortcuts import render
from profile_app.models import UserProfileInfo
from video_app.models import Video
from comment_app.models import Comment
from django.http import JsonResponse
from django.contrib.auth.decorators import login_required
# Create your views her... | NathanA15/music-video | music_project/comment_app/views.py | views.py | py | 1,008 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "profile_app.models.UserProfileInfo.objects.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "profile_app.models.UserProfileInfo.objects",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "profile_app.models.UserProfileInfo",
"line_num... |
14416840611 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# 从数据库里面导出一定时间前的还持有份额的人员和产品数据,每个产品是一个Excel
import pymysql
from openpyxl import *
import os
#检索每一行的第一个产品代码字段,如果是同一个代码,要保存在一个Excel里,不同产品的数据,用不同的Excel保存
#fields是列名,data是数据集,path是保存的路径,如果空,则保存在当前目录下
def SaveData2Excel(fields, data, path = ''):
if path == '':
path = os.getcw... | matthew59gs/Projects | python/market/export_fund_share2.py | export_fund_share2.py | py | 2,544 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.getcwd",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.sep",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.sep",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "pymysql.connect",
"line_number"... |
10513613017 | from django.test import SimpleTestCase
from website.forms import CreateUserForm, SignUpForm, FeedbackForm, PatientForm, DocumentationP, EventForm, MessageForm, RequestForm
from website.models import Patient, SignUp, Feedback, Documentation, Event, Messages, Requests
class TestForms(SimpleTestCase):
def test_creat... | liorco15/HealthTourism | test_forms.py | test_forms.py | py | 1,646 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.test.SimpleTestCase",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "website.forms.CreateUserForm",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "website.forms.SignUpForm",
"line_number": 14,
"usage_type": "call"
},
{
"ap... |
74470473064 | """
Project Tasks that can be invoked using using the program "invoke" or "inv"
"""
import os
from invoke import task
# disable the check for unused-arguments to ignore unused ctx parameter in tasks
# pylint: disable=unused-argument
IS_WINDOWS = os.name == "nt"
if IS_WINDOWS:
# setting 'shell' is a work around f... | arecarn/dploy | tasks.py | tasks.py | py | 2,421 | python | en | code | 68 | github-code | 36 | [
{
"api_name": "os.name",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "invoke.task",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "invoke.task",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "invoke.task",
"line_number":... |
18760528871 | import numpy as np
import itertools
import cv2
def draw_epipolar_lines(img_left, img_right):
height = np.shape(img_left)[0]
divisions = 40.0
colors = [(255,0,0), (0,0,255), (0,255,0), (255,255,0), (255,255,255), (0,255,255)]
color_generator = itertools.cycle(colors)
step = int(np.floor(height/divis... | olaals/multivision-depr | multivision/oa_stereo_utils.py | oa_stereo_utils.py | py | 2,439 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.shape",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "itertools.cycle",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.floor",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.hstack",
"line_number... |
17134241020 | from pyspark.sql import SparkSession
spark = SparkSession.builder.getOrCreate()
spark.conf.set('spark.sql.parquet.compression.codec', 'snappy')
spark.conf.set('hive.exec.dynamic.partition.mode', 'nonstrict')
spark.conf.set('spark.streaming.stopGracefullyOnShutdown', 'true')
spark.conf.set('hive.exec.max.dynamic.partiti... | ConMota/app_renta_indirecta_GS | Class_02_feat.py | Class_02_feat.py | py | 3,937 | python | es | code | 0 | github-code | 36 | [
{
"api_name": "pyspark.sql.SparkSession.builder.getOrCreate",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 2,
"usage_type... |
36570276493 | import datetime
import urllib
import urllib.parse
from mpcomp import http_core
try:
import simplejson
from simplejson.decoder import JSONDecodeError
except ImportError:
JSONDecodeError = None
try:
# Try to import from django, should work on App Engine
from django.utils import simplejson... | MicroPyramid/opensource-job-portal | mpcomp/gauth.py | gauth.py | py | 10,945 | python | en | code | 336 | github-code | 36 | [
{
"api_name": "simplejson.decoder.JSONDecodeError",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "mpcomp.http_core.get_headers",
"line_number": 120,
"usage_type": "call"
},
{
"api_name": "mpcomp.http_core",
"line_number": 120,
"usage_type": "name"
},
{
... |
33040671101 | import io
from typing import List, Set, Tuple
from clvm import KEYWORD_FROM_ATOM, KEYWORD_TO_ATOM, SExp
from clvm import run_program as default_run_program
from clvm.casts import int_from_bytes
from clvm.EvalError import EvalError
from clvm.operators import OP_REWRITE, OPERATOR_LOOKUP
from clvm.serialize import sexp_f... | snight1983/chia-rosechain | chia/types/blockchain_format/program.py | program.py | py | 7,273 | python | en | code | 369 | github-code | 36 | [
{
"api_name": "clvm.operators.OPERATOR_LOOKUP",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "clvm.run_program",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "clvm.SExp",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "clvm.serial... |
32281752161 | import identity_server.logic.session.login_session.logged_in_state as lst
import identity_server.logic.session.login_session.waiting_for_permission as wfp
from mongodb.Application import Application
from mongodb.ApplicationAccount import ApplicationAccount
from django.http.response import HttpResponse
import identity_... | aI-lab-glider/oauth2-server-implementation | identity_server/logic/session/login_session/initial_login_state.py | initial_login_state.py | py | 2,766 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "identity_server.logic.session.session.SessionState",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "identity_server.logic.session.session",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.http.request.HttpRequest",
"line_number"... |
38971244001 | from django.db import models
from datetime import datetime
from multiselectfield import MultiSelectField
from realtors.models import Realtor
from areaprops.models import Area
# Create your models here
# Choices for amenities
amenities_choices = (
('security','security'),
('gymnasium','gymnasium'),
('waste... | Saxena611/bp_real_estate | listings/models.py | models.py | py | 2,835 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.db.models.Model",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "django.db.models.ForeignKey",
"line_number": 44,
"usage_type": "call"
},
{
"api_name... |
8721596981 | from scipy.misc import comb
def exp(p, n):
total = 0.0
for k in range(n+1):
total += comb(n, k, exact=False) * p**k * (1-p) ** (n-k)
return total
def main():
for p in [0.3, 0.75, 0.8, 1.0, 0.0, 0.5]:
for n in range(1, 20):
print('Checking n=%d, p=%f' % (n, p))
... | JelteF/statistics | 2/lab2_2_d.py | lab2_2_d.py | py | 395 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "scipy.misc.comb",
"line_number": 7,
"usage_type": "call"
}
] |
10905562253 | from pydantic import BaseModel
class SourceURL(BaseModel):
'''Source URL schema'''
source_url: str
class Config:
orm_mode = True
class URLInfo(SourceURL):
'''URL Information schema'''
short_url_key: str
short_url: str
| ScottyZA/backendend-challenge | url_shortener/schemas.py | schemas.py | py | 255 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 4,
"usage_type": "name"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.