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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11191543330 | from __future__ import annotations
import logging
import click
import numpy as np
import vpype as vp
from .cli import cli
from .decorators import global_processor
try:
# noinspection PyUnresolvedReferences
import vpype_viewer
_vpype_viewer_ok = True
except ImportError: # pragma: no cover
_vpype_v... | abey79/vpype | vpype_cli/show.py | show.py | py | 8,379 | python | en | code | 618 | github-code | 1 | [
{
"api_name": "vpype.Document",
"line_number": 64,
"usage_type": "attribute"
},
{
"api_name": "logging.warning",
"line_number": 90,
"usage_type": "call"
},
{
"api_name": "logging.warning",
"line_number": 99,
"usage_type": "call"
},
{
"api_name": "logging.warning",... |
24580224778 | #Machine Vision and Robotics Course Project
#Fire detection using Image Processing
#import modules
import cv2#Computer vision module for video capture and image processing
import numpy as np#Python numbers module for matrix manipulation
import time#time module to measure time for pauses
import winsound# windows sound m... | shrutivasave/Fire-Detection-With-Image-Processing | main.py | main.py | py | 2,106 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.FONT_HERSHEY_SIMP... |
35705053518 | from src.models.product import Product
from typing import Union
from src.models.user import User
from http import HTTPStatus
from .. import jwt
from flask import request
class UserService:
allowed_coins = [100, 50, 20, 10, 5]
@staticmethod
def get_users():
try:
return User.get_all()
... | Rumir125/vending-maachine-amir | src/services/user_service.py | user_service.py | py | 5,567 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "src.models.user.User.get_all",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "src.models.user.User",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "http.HTTPStatus.FORBIDDEN",
"line_number": 17,
"usage_type": "attribute"
},
{
"... |
18700705323 | import numpy as np
import pandas as pd
from fit import transform_distribution
from sklearn.experimental import enable_iterative_imputer
from sklearn.impute import IterativeImputer
from sklearn.preprocessing import OneHotEncoder, LabelEncoder
from sklearn import feature_selection
from sklearn import model_selection
fro... | landon/MachineLearning | kaggle/preprocess.py | preprocess.py | py | 5,703 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.concat",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "fit.transform_distribution",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
25090609331 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from datetime import datetime
file_in = "RngStream.cpp funclass.cpp RngStreamSupp.cpp driverLTM_mpi_mod.cpp"
file_out = "mpi_ltm"
file_time = "ResultTime"
max_np = 6
max_ntest = 10
date = datetime.now().strftime('%d-%m-%Y')
hour = datetime.now().strftime('%H-%M... | ChristopherBric/CPD-Proyecto | P_CPD_MPI.py | P_CPD_MPI.py | py | 1,720 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetim... |
8691258449 | from typing import List
class Solution:
def letterCombinations(self, digits: str) -> List[str]:
map = {
"2": ["a", "b", "c"],
"3": ["d", "e", "f"],
"4": ["g", "h", "i"],
"5": ["j", "k", "l"],
"6": ["m", "n", "o"],
"7": ["p", "q", "r",... | songkuixi/LeetCode | Python/Letter Combinations of a Phone Number.py | Letter Combinations of a Phone Number.py | py | 754 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
31817702158 | from flask import Flask
import requests
import json
import requests
from bs4 import BeautifulSoup
from flask_restful import Api, Resource
from flask_cors import CORS
#Api inicializacion
app = Flask(__name__)
CORS(app)
api = Api(app)
#headers
headers = {
'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) Ap... | MercinQ/SimillarNewsSearcher | SNS.WEBSCRAPER/main.py | main.py | py | 10,462 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask_restful.Resource"... |
45238512961 | """
Created on Mar, 2021
@author: Morteza Moghaddassian
@Project: ECE1508 - NetSoft Course
"""
# paho is a client library to communicate with Mosquitto broker that implements MQTT V3.1.1
import paho.mqtt.client as paho
import time
from datetime import datetime
from multiprocessing import Process, Manager
import os
impo... | janenxiao/ECE1508-labs-code | lab7/subscriber.py | subscriber.py | py | 10,466 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 71,
"usage_type": "name"
},
{
"api_name": "paho.mqtt.client.Client",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "paho.... |
35582790150 | import requests
from lxml import etree
def get_mhname():
try:
url = 'https://18comic.live/'
header = {
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36",
}
res = requests.get(url, headers=header... | yulate/AKA | api/cartoons/comic.py | comic.py | py | 3,229 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "lxml.etree.HTML",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_numb... |
22746282406 | import cv2
import numpy as np
import torch
class Compose(object):
"""Composes several video_transforms together.
Args:
transforms (List[Transform]): list of transforms to compose.
Example:
>>> video_transforms.Compose([
>>> video_transforms.CenterCrop(10),
>>> vi... | Jo-won/CSQ_pytorch | lib/datasets/transform.py | transform.py | py | 10,704 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.random.RandomState",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "torch.Tensor",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "torch.cat",
... |
26672751741 | from collections import OrderedDict
from collections import namedtuple
from itertools import product
from numpy.random import gamma
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import gym
import time
from tensorboardX import SummaryWriter
# Hyper Parameters
params = OrderedDict... | IDayday/DQN-pytorch | DQN-CartPole.py | DQN-CartPole.py | py | 7,066 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.OrderedDict",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "gym.make",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "itertools.pro... |
17845242283 | from zope.interface import implements
from twisted.internet import defer
from axiom.store import Store
from axiom.item import Item
from axiom import attributes
from axiom.dependency import installOn
from nevow.testutil import renderLivePage, FragmentWrapper, AccumulatingFakeRequest
from nevow import loaders
from nev... | rcarmo/divmod.org | Mantissa/xmantissa/test/test_search.py | test_search.py | py | 5,267 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "twisted.trial.unittest.TestCase",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "twisted.trial.unittest",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "xmantissa.search.parseSearchTerm",
"line_number": 26,
"usage_type": "call"
... |
34166943718 | #!/usr/bin/python3
import os
import time
import numpy as np
import matplotlib.pyplot as plt
import system
import compute
import heat_capacity
import styles
import glob
from mytimer import Timer
T = np.linspace(0.001, 0.01, 175)
max_interesting_E = -1.442360888736597957e-01
E = np.linspace(-system.h_small, max_intere... | droundy/sad-monte-carlo | two-wells/convergence-for-proposal.py | convergence-for-proposal.py | py | 9,203 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "numpy.linspace",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "system.h_small",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"... |
7371261819 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
import networkx as nx
import torch
from torch.utils.data import Dataset
from dataloader import DataLoaderSubstructContext
from loader import graph_data_obj_to_nx, nx_to_graph_data_obj
class NewBioDataset(Dataset):
def __init__(self, l1, center):
... | melobio/Graphene | pretrain/new_dataloader/generate.py | generate.py | py | 3,385 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "loader.graph_data_obj_to_nx",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "random.sample",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "ne... |
18962706021 |
import os
import hashlib
import re
import traceback
from loguru import logger
def printe(e):
print(e)
logger.error(e)
traceback.print_exc()
def is_decimal_or_comma(s):
pattern = r'^\d*\.?\d*$|^\d*[,]?\d*$'
return bool(re.match(pattern, s))
# ================对文件算MD5================
def md5(path... | Projmix/MomoTranslator | src/utils.py | utils.py | py | 1,115 | python | en | code | null | github-code | 1 | [
{
"api_name": "loguru.logger.error",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "traceback.print_exc",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "re.match",
... |
25161316064 | import cv2
from time import sleep
# Load the cascade
face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')
# To use a single image as input
img = cv2.imread("testAI.jpg")
# Convert to grayscale
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# Detect the faces
faces = fa... | cKaliban/DSP-Architecture-Lab | Python-WSL/lib/vidFace-stillimg.py | vidFace-stillimg.py | py | 573 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.data",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_... |
36655416891 | import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.cluster import KMeans
from skopt import gp_minimize
class ProcessMissingValues(BaseEstimator, TransformerMixin):
def __init__(self,
columns,
cat_columns,
type_columns='categor... | jonysalgado/Competition_Porto_Seguro | pipeline/pipeline_functions.py | pipeline_functions.py | py | 7,539 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.base.BaseEstimator",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "sklearn.base.TransformerMixin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "numpy.nan",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": ... |
35835074666 | import os
import subprocess
from IPython.core.magic import register_cell_magic
from IPython.display import SVG
__title__ = "iplantuml"
__description__ = "Package which adds a PlantUML cell magic to IPython."
__uri__ = "https://github.com/jbn/iplantuml"
__doc__ = __description__ + " <" + __uri__ + ">"
__license__ = "M... | Ledenel/IPlantUML | iplantuml/__init__.py | __init__.py | py | 2,099 | python | en | code | null | github-code | 1 | [
{
"api_name": "subprocess.check_call",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "subprocess.STDOUT",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "os.path.splitext",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "os.path... |
37637132484 | # A Python program to show different ways to create
# Counter
from collections import Counter
# With sequence of items
print(type(Counter([('k') * 2, 'B', 'A', 'B', 'C', 'A', 'B', 'B', 'A', 'C'])))
# with dictionary
print (Counter({'A':3, 'B':5, 'C':2}))
# with keyword arguments
print (Counter(A=3, B=5, C=2))
# Pyt... | mathekania/sum | venmachine/unpacking dict.py | unpacking dict.py | py | 877 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.Counter",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "collections... |
35010637914 | from rest_framework import status
from rest_framework import exceptions
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
from drf_yasg.utils import swagger_auto_schema
from apps.posts.models import Post, PostLike
class PostL... | Billionaire-Project/four_hours_service | apps/posts/views/post_like_id.py | post_like_id.py | py | 1,365 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "rest_framework.permissions.IsAuthenticated",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "apps.posts.models.Post.objects.get",
"line_number": 17,
"usage_ty... |
36823429088 | #!/usr/bin/env python
# coding: utf-8
# In[64]:
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error
from sklearn.metrics import mean_absolute_error as mae
# In[65]:
data = pd.read_csv('/home/leon... | juvitus-soh/Data-Science | Concrete wall prediction/ML Catchup CA.py | ML Catchup CA.py | py | 1,417 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LinearRegression",
"line_number": 44,
"usage_type": "call"
... |
19035107378 | import streamlit as st
import numpy as np
import pandas as pd
from googletrans import Translator
from transformers import T5Tokenizer, MT5ForConditionalGeneration
import torch
from torch import optim
import pandas as pd
import numpy as np
"# Generating Natural Language Text from RDF"
def get_model(language,model_... | goku80903/IRE-Major-Project | demo.py | demo.py | py | 2,910 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "transformers.T5Tokenizer.from_pretrained",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "transformers.T5Tokenizer",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "transformers.MT5ForConditionalGeneration.from_pretrained",
"line_number": 2... |
36447598427 | from tkinter import *
from tkinter import ttk as ttk
from tkinter import messagebox as mb
import datetime
import sqlite3
from tkcalendar import DateEntry
# list all the expenses
def listAllExpenses():
# global ... | cenjatwit/BudgetBudgetBudget | main.py | main.py | py | 16,173 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tkinter.messagebox.showerror",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "tkinter.messagebox",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "datetime.date",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "datetim... |
72227770275 | # USAGE
# python scripts/crop-to-object.py -i images/output/uss-freedom-original.jpg
# import necessary packages
import argparse
import cv2
# construct the argument parser
ap = argparse.ArgumentParser()
ap.add_argument("-i","--image", type=str,
help="path to input image")
args = vars(ap.parse_args())
... | dmarcus-wire/image-data-pipeline | scripts/crop-to-object.py | crop-to-object.py | py | 659 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_... |
2716085105 | ################################################### END ########################################################
################################################### SET PATH ########################################################
# Filter results of WGS
import glob
import os
from Bio import SeqIO
from Bio.Seq import S... | caozhichongchong/snp_finder | snp_finder/scripts/vcf_process_Jay.py | vcf_process_Jay.py | py | 4,504 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "argparse.RawDescriptionHelpFormatter",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 43,
"usage_type": "call"
},
{
"ap... |
8971672116 | import io
import json
from dataclasses import dataclass
import avro
from avro.io import DatumWriter, DatumReader, BinaryDecoder
from kpong import PingPongMessage
from kpong.schema import PING_PONG_SCHEMA
def ping_pong_deserializer(message):
return deserializer(message, PING_PONG_SCHEMA, PingPongMessage.from_dic... | apmaros/kpong | src/kpong/serde.py | serde.py | py | 926 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "kpong.schema.PING_PONG_SCHEMA",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "kpong.PingPongMessage.from_dict",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "kpong.PingPongMessage",
"line_number": 13,
"usage_type": "name"
... |
1372330657 | import pandas as pd
import requests
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
def get... | helderrezende/agendamento_portugal | crawler.py | crawler.py | py | 4,429 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "selenium.web... |
11731956357 | import pickle
import argparse
import numpy as np
from keras.layers import Conv2D, Dense, Flatten, MaxPool2D, Dropout
from keras.layers import BatchNormalization, Activation, LeakyReLU
from keras.models import Model, Input, load_model
from keras.utils import to_categorical
from keras.callbacks import EarlyStopping, Mode... | hungchingliu/ML2018SPRING | final/src/method2/train_cnn.py | train_cnn.py | py | 4,592 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "keras.models.Input",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "keras.layers.Conv2D",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "keras.layers.BatchNormalization",
"line_number": 18,
"usage_type": "call"
},
{
"api_name":... |
13005741374 | from glob import glob
import time
import os.path
import os
import numpy as np
from .utils import return_diff_structures, create_output_file
def check_structure(user: str,
session: str,
movement: str,
warping_paths: np.ndarray,
output_path... | xistva02/Classification-of-interpretation-differences | structure_checker/structure_checker.py | structure_checker.py | py | 4,734 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.ndarray",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_... |
23901241876 | from datetime import datetime
from pyelasticsearch import ElasticSearch
from dbconnect import *
import argparse
import json
import os
es = ElasticSearch()
ap = argparse.ArgumentParser()
ap.add_argument("-d", "--date", required = True, help = "date to index")
args = vars(ap.parse_args())
ad_mapping = {
'ad': {
... | cervere/scrapemall | es-exodus/indexer.py | indexer.py | py | 1,855 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pyelasticsearch.ElasticSearch",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "json.... |
15098881405 | from flask import Blueprint, render_template, request, jsonify, session
import random, json
views = Blueprint(__name__, "views")
the_score = 0
board_data = []
hand_data = []
vowels = ['a', 'e', 'i', 'o', 'u']
# Define the letters with their corresponding values
letter_values = {
'a': 1, 'b': 3, 'c': 3, 'd': 2... | gsapoz/scrabble-py | views.py | views.py | py | 3,537 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Blueprint",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "random.choices",
"lin... |
71734197474 | from requests import get
from bs4 import BeautifulSoup
def main():
res = get(
"https://medium.com/towards-data-science/the-5-basic-statistics-concepts-data-scientists-need-to-know-2c96740377ae"
)
soup = BeautifulSoup(res.content, "html.parser")
h1s = soup.find_all(name="h1", recursi... | tebohoxthapeli/20-python-projects | 18_web_scraper.py | 18_web_scraper.py | py | 438 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 10,
"usage_type": "call"
}
] |
17210184396 | import pandas as pd
from packaging import version
from typing import Union, List
is_deprecated_lexsorted_pandas = version.parse(pd.__version__) > version.parse("1.3.0")
def get_level_index(df: pd.DataFrame, level=Union[str, int]) -> int:
if isinstance(level, str):
try:
return df.index.names.... | SJTU-Quant/interpreters | src/dataset/utils.py | utils.py | py | 2,075 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "packaging.version.parse",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "packaging.version",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "pandas.__version__",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pandas... |
36883997039 | import argparse
import yaml
import os
import os.path as osp
from sklearn.model_selection import ParameterGrid
import shutil
class MyDumper(yaml.Dumper):
def increase_indent(self, flow=False, indentless=False):
return super(MyDumper, self).increase_indent(flow, False)
def parse_args():
"""Parses the ... | Guangxuan-Xiao/Case-Search | src/grid.py | grid.py | py | 2,188 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "yaml.Dumper",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "shutil.rmtree",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
... |
41330435237 | """migration_1
Revision ID: ccba048477df
Revises:
Create Date: 2022-11-05 09:54:52.229725
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = 'ccba048477df'
down_revision = None
branch_labels = None
depends_on = None
def... | zxc322/fast_api_app | alembic/versions/ccba048477df_migration_1.py | ccba048477df_migration_1.py | py | 879 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "alembic.op.add_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Float",... |
7998906160 | #---------------------------------IMPORT MODULES----------------------------------
#user modules
import modules.common as common
#built-in modules
import random
#Assigning variables
mode=''
word=''
hidden_word=''
hint=''
rand=0
hintGiven=''
#Creating lists
Index=[]
hidden_word_list=[]
guessed=[]
... | Nazeefa-Anees/SimpleHangmanGame | Hangman/modules/game.py | game.py | py | 9,254 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "modules.common.clearConsole",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "modules.common",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "modules.common.Exit",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "module... |
35807394488 | import json
import os
import re
def read_json_file(file):
if os.path.isfile(file):
print(f'file {file}')
else:
exit()
log = json.load(open(file, 'r'))
return log
def flat_json_to_kv(an_object, key, kv_result, layer) -> object:
'''
:param key:
:param layer:
:param a... | stonelzhang/log_analytics | flat_json.py | flat_json.py | py | 1,165 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.isfile",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
}
] |
38432786064 | import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
import arc as arc
import numpy as np
import scipy.constants as consts
from scipy.stats import maxwell
import os, sys
from functools import partialmethod
###########################################################################################... | seba2390/Python-projects | LaserCooling/my_classes.py | my_classes.py | py | 18,809 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.stdout",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.devnull",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout.close",
... |
31319847797 | from __future__ import print_function, division
import time
import torch
import numpy as np
import torch.nn.functional as F
from torch.autograd import Variable
from torchnet.meter import ConfusionMeter
use_cuda = torch.cuda.is_available()
# Compute log sum exp in a numerically stable way for the forward algorithm
def... | jtang10/crf | utils.py | utils.py | py | 6,049 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.max",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.exp",
"line... |
34477681751 | import rpyc
from rpyc.utils.server import OneShotServer
import unittest
class MyService(rpyc.Service):
def exposed_foo(self):
return "bar"
class Test_OneShotServer(unittest.TestCase):
def setUp(self):
self.server = OneShotServer(MyService, port=18878, auto_register=False)
self.serv... | tomerfiliba-org/rpyc | tests/test_oneshot_server.py | test_oneshot_server.py | py | 886 | python | en | code | 1,454 | github-code | 1 | [
{
"api_name": "rpyc.Service",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "unittest.TestCase",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "rpyc.utils.server.OneShotServer",
"line_number": 15,
"usage_type": "call"
},
{
"api_name"... |
38266638212 | import numpy as np
from itertools import combinations
from math import *
import pdb
file = open('tsp.txt', 'r+')
i = -1
for line in file:
if i == -1:
n = int(line.rstrip('\t'))
coor = np.empty((n, 2))
i += 1
else:
[x, y] = line.rstrip('\t').split(' ')
coor[i][:] = np.arr... | Qiaochu-Song/Algorithms | Section_4_NP/Algorithm_4.2.py | Algorithm_4.2.py | py | 3,258 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.empty",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": ... |
42385272913 | from AutomationToolsLib import Logging, AutomationPreferences, SlackNotification
from datetime import date
from xml.etree import ElementTree
from sys import exit
try:
import requests
except:
print(
"The requests module is not installed. To install the request module, use the pip3 command: pip3 install ... | danengh/Python | Patch_Automation/jamfPatchPolicyUpdater.py | jamfPatchPolicyUpdater.py | py | 10,975 | python | en | code | 8 | github-code | 1 | [
{
"api_name": "sys.exit",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "AutomationToolsLib.AutomationPreferences",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.date.today",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": ... |
72484824354 | from django.db import models
from geoposition.fields import GeopositionField
from django import forms
class Clinic(models.Model):
"""
A clinic providing health services.
"""
name = models.CharField(
'Name of the clinic',
max_length = 255,
unique = True,
)
location = Geoposit... | RHoKSoton/jipange | clinics/models.py | models.py | py | 3,855 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.db.models.Model",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": ... |
28490365912 | import config
import pygame
import math
class static_shape_object:
def __init__(self, position, vertices) -> None:
''' vertices are relative to given position'''
self.vertices = vertices
self.position = position
self.colliding = False
self.color = config.DEFAULT_SHAPE_COLOR
... | XT60/Problem-with-collision-resolving-using-diagonals-method | shape.py | shape.py | py | 6,633 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "config.DEFAULT_SHAPE_COLOR",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.draw.polygon",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "... |
2738928489 | from collections import defaultdict, deque
def solve(path):
#只能解决小数据集
border = 10 ** 9
w = h = 0
dictionary = defaultdict(int)
d = {'N': 0, "S": 1, "E": 2, "W": 3}
stack = deque()
N = len(path)
tmp = ''
for i in range(N):
if tmp=='':
tmp+=path[i]
elif path[i... | huangketsudou/algorithms | kickstart/B2020RobotPathDecoding.py | B2020RobotPathDecoding.py | py | 1,916 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.defaultdict",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 10,
"usage_type": "call"
}
] |
19503487404 | from openerp import fields, models, api
from datetime import datetime
from openerp.osv import osv
from openerp.addons.report_xlsx.report.report_xlsx import ReportXlsx
from dateutil.relativedelta import relativedelta
from dateutil import tz
from pytz import timezone
class AccountsReportWizard(models.TransientModel):
... | hosterp/BUREAU_GREEN_20_06_23 | hiworth_construction/wizard/accounts_report_wizard.py | accounts_report_wizard.py | py | 5,150 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "openerp.models.TransientModel",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "openerp.models",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "openerp.fields.Date",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": ... |
17790562559 | from plyer import notification
from rich.table import Table
from rich import print
from datetime import time
from config.config import *
from requests import get
import json
import os
import rich
import psutil
import platform
import pyaudio
import pyttsx3
import datetime
import requests
import random
import requests
... | wendellast/Sara-IA-QT | config/config_dados.py | config_dados.py | py | 9,261 | python | pt | code | 4 | github-code | 1 | [
{
"api_name": "pyfirmata.Arduino",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "platform.system",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pyttsx3.init",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pyttsx3.init",
"li... |
18024310114 | import os
import logging
import begin
from tqdm import tqdm
import numpy as np
from skimage.transform import resize as sk_resize
@begin.start(auto_convert=True)
@begin.logging
def main(in_file: 'Input npz file containing the dataset'='.', out_folder: 'Output folder for the npz file'='.',
imagenet_size: 'IF ... | roboticslab-uc3m/textiles-hanging | textiles_hanging/rescale_dataset.py | rescale_dataset.py | py | 1,463 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.info",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number"... |
14089843475 | import imp
import time
import json
import uvicorn
from threading import Thread
from datetime import datetime
from kafka import KafkaProducer
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.config.settings import config
from app.config.docs import documentation_config
from app.c... | OrwellMonitoring/orwell-middleware | middleware/app/main.py | main.py | py | 5,265 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "app.config.settings",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "fastapi.FastAPI",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "app.config.docs.documentation_config",
"line_number": 28,
"usage_type": "name"
},
{
"api_name... |
17329286738 | # update_data.py
# Author : Irfan TOOR <email@irfantoor.com>
#
# imports
import os
import numpy as np
import pandas as pd
# -----------------------------------------------------------------------------------------
# data paths -- adjust these paths and PCA parameters
globo_source = "../data/source/news-portal-user-i... | irfantoor/azure-scripts | update_data.py | update_data.py | py | 8,097 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_nu... |
20650371673 | from flask import render_template, redirect, url_for,flash, abort
from . import main
from .forms import SubscriberForm, BlogPostForm, CommentForm
from ..models import User, Subscribers, BlogPost, Comment
from ..email import mail_message
from .. import db
from flask_login import login_required, current_user
@main.route... | MichelAtieno/Personal-Blog | app/main/views.py | views.py | py | 3,347 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "forms.SubscriberForm",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "models.Subscribers",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask.flash",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "email.mail_messag... |
21064502552 | import torch
INFERENCE_SIZE = (244, 244)
import sys
def get_model_graph(model):
OLD_RECURSION_LIMIT = sys.getrecursionlimit()
sys.setrecursionlimit(1500)
dummy_input = torch.randn(1, 3, INFERENCE_SIZE[0], INFERENCE_SIZE[1])
dummy_output = model(dummy_input)
params = model.state_dict()
param_ma... | aljo242/nn_benching | modelstats.py | modelstats.py | py | 3,110 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "sys.getrecursionlimit",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.setrecursionlimit",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.randn",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.is_tensor"... |
70705474593 | import torch
class Single_net(torch.nn.Module):
def __init__(self, n_feature, n_hidden, n_output):
super(Single_net, self).__init__()
self.hidden = torch.nn.Linear(n_feature, n_hidden) # hidden layer
self.predict = torch.nn.Linear(n_hidden, n_output) # output layer
def forward(sel... | GaneshVShinde/Recombinat_DeepQ | network.py | network.py | py | 2,588 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.nn",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Linear",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Linear",
"line_... |
4358448468 | #!/Library/Frameworks/Python.framework/Versions/3.6/bin/python3
import praw
import re
from imgurpython import ImgurClient
import requests
import time
import os
import urllib.request
import config
#TODO fix for reddit images redd.it/###.jpg
# max number of submissions to check
LIMIT = 200
# subreddit being checked
#... | Maxed/Scraper | pictures.py | pictures.py | py | 4,757 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "config.subreddit",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "praw.Reddit",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "config.reddit_id",
"l... |
11940791720 | from celery import shared_task
from django.conf import settings
from django.db import transaction
from .models import Project, Reference, VAF
from .serializers import MetadataSerializer
import maptide
import time
import math
def entropy(probabilities, normalised=False):
ent = sum([-(x * math.log2(x)) if x != 0 el... | CLIMB-COVID/vafdb | vafdb/data/tasks.py | tasks.py | py | 7,957 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "math.log2",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "math.log2",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "maptide.parse_region",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number... |
35630298336 | import os
import torch
import torch.nn as nn
from torch.nn import functional as F
# Initialize some hyperparameters
# Hyperparameters control various aspects of training, such as the batch size,
# learning rate, dropout ratio, etc.
batch_size = 132 # Number of sequences to process in parallel.
block_size = 16 # Maxim... | ManzilS/Bigram_Language_Model_ABC_Notation | Create_model.py | Create_model.py | py | 9,203 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.manual_seed",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.tenso... |
45084585781 | import logging
import pickle
import sys
from pathlib import Path
from timeit import timeit
import pandas as pd
import yaml
from nyx_space.cosmic import Cosm, Orbit, Spacecraft, SrpConfig
from nyx_space.mission_design import (
Event,
SpacecraftDynamics,
StateParameter,
TrajectoryLoader,
propagate,
... | gwbres/nyx | tests/python/test_mission_design.py | test_mission_design.py | py | 11,201 | python | en | code | null | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path"... |
31821099628 | import pandas as pd
import json
import datetime
from bdd import get_database
from fetch_air_quality_datas import fetch_air_quality_datas
# Fonction permettant de convertir les données au format csv en format json qui sera plus adapté pour structurer notre
# MongoDB.
def convert_air_quality_datas_to_json() :
#Récup... | mercierju/DSIA_4301B-DataEngineerToolsProject_MERCIER_LEFEVRE | Back/insert_datas_db.py | insert_datas_db.py | py | 2,953 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "fetch_air_quality_datas.fetch_air_quality_datas",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 18,
"usage_type": "call"... |
31994340913 | import json
import jsonschema
from datetime import datetime
from models.models import Order, Customer, Driver
from django.db import connection
from django.core import serializers
from django.http import JsonResponse, HttpRequest
from django.views.decorators.http import require_http_methods
@require_http_methods(["GET"... | omni2k23/OrderAPI | views/orders.py | orders.py | py | 2,934 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.http.HttpRequest",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "models.models.Customer.objects.filter",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "models.models.Customer.objects",
"line_number": 18,
"usage_type": "attribut... |
36507577180 | from utilities import Course
import requests
from lxml import html
import json
headers = {
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"Accept-Language": "en-US,en;q=0.5",
"Connection": "keep-alive",
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gec... | Jsbbvk/BoilermakeIX | data_parsing/multidis.py | multidis.py | py | 1,225 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "lxml.html.fromstring",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "lxml.html",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "utilities.Course",
"l... |
365947772 | import abc
import binascii
import os
import sys
import warnings
from hashlib import sha384
from typing import Dict, Iterable
from hypothesis.configuration import mkdir_p, storage_directory
from hypothesis.errors import HypothesisException, HypothesisWarning
from hypothesis.utils.conventions import not_set
__all__ = [... | webanck/GigaVoxels | lib/python3.8/site-packages/hypothesis/database.py | database.py | py | 11,325 | python | en | code | 23 | github-code | 1 | [
{
"api_name": "os.path.exists",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numbe... |
11558833419 | from matplotlib import pyplot as plt
from matplotlib import font_manager
# 选用一个图表通用字体存为my_font,为显示中文
my_font = font_manager.FontProperties(fname="字体文件所在目录")
# 数据
x = range(11)
y = [1, 5, 6, 2, 11, 8, 9, 23, 5, 6, 8]
# 绘制折线图
plt.plot(x, y, label="图例名", color="折线颜色")
# 设置图形大小
plt.figure(figsize=(20,8),dpi=80)
# 设置坐标
... | xiang59915/Fresh | matplotlib绘图基础.py | matplotlib绘图基础.py | py | 592 | python | zh | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.font_manager.FontProperties",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.font_manager",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 12,
"usage_type": "call"
},
{
... |
24330660208 | import time
from reportlab.lib.enums import TA_JUSTIFY
from reportlab.lib.enums import TA_LEFT
from reportlab.lib.enums import *
from reportlab.lib.pagesizes import *
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from repo... | mmejia/systra | accidentes/GenerateFrontalPdf.py | GenerateFrontalPdf.py | py | 7,610 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "reportlab.rl_config.defaultPageSize",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "reportlab.rl_config.defaultPageSize",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "reportlab.platypus.SimpleDocTemplate",
"line_number": 22,
"usage_... |
8095555076 | """
URL configuration for gestorDocumental project.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, n... | Gabugueado/gestor-documento-backend | gestorDocumental/urls.py | urls.py | py | 1,394 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "django.urls.include",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "django.urls.inc... |
27054053864 | import logging
from typing import Any, Dict, List, Optional
from datasets import Array2D, Array3D, ClassLabel, Features, Sequence, Value
from transformers import LayoutLMv2Processor, LayoutLMv3Processor, LayoutXLMProcessor
logger = logging.getLogger(__name__)
class BaseEncoder:
"""BaseEncoder is the base class ... | deeptools-ai/document-tools | document_tools/encoders/encoders.py | encoders.py | py | 5,617 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_n... |
69808023073 | from matplotlib import pyplot as plt
import random
#注意,matplotlib默认不支持中文,需要使用rc来设置一下
import matplotlib
#方法一
font = {'family': 'SimHei',
'weight': 'bold',
'size': 14}
matplotlib.rc('font',**font) #这里**的作用是把字典的每一个key:value变为key=value的形式依次传递进来
#方法二
# plt.rcParams["font.sans-serif"]=["... | kennycaiguo/kenny-learn-python-dataAnalysis | matplotlib-study/matplotlibdemo4.py | matplotlibdemo4.py | py | 1,878 | python | zh | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.rc",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "random.seed",... |
22633275583 | from http.client import HTTPException
from urllib import response
from fastapi import FastAPI
from typing import List, Optional
from pydantic import BaseModel
import threading
from time import sleep
import numpy as np
from fastapi_mqtt import FastMQTT, MQQTConfig
import json
f = open('./data.json', "r")
data = json.lo... | palulconst1/MonkeyBusiness | proiect-mds/app.py | app.py | py | 7,464 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseModel",
"li... |
32017679353 | """Library Base Table"""
from peewee import ForeignKeyField
from database.scraper.tvshow.cast import ScraperTVShowCast
from database.scraper.tvshow.episode import ScraperTVShowEpisode
class ScraperTVShowGuestStars(ScraperTVShowCast):
"""Library Base TV Show Cast"""
episode = ForeignKeyField(ScraperTVShowEpi... | GaryTheBrown/Tackem | database/scraper/tvshow/guest_stars.py | guest_stars.py | py | 1,148 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "database.scraper.tvshow.cast.ScraperTVShowCast",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "peewee.ForeignKeyField",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "database.scraper.tvshow.episode.ScraperTVShowEpisode",
"line_number": 11... |
17635080654 | import struct
from io import BytesIO
from typing import List
from hash import double_sha256
from serialize import read_var_int
class BlockHeader:
FORMAT = '< i 32s 32s I I I'
FORMAT_MESSAGE = FORMAT + 'x'
def __init__(self,
version: int,
prev_block: bytes,
... | EyeOfPython/pyspv | headers_message.py | headers_message.py | py | 2,456 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "struct.unpack",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "hash.double_sha256",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "struct.pack",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_... |
4340562652 | import logging
import math
import re
import pandas
from datetime import datetime, timezone
from jal.constants import DividendSubtype
from jal.widgets.helpers import g_tr
from jal.db.update import JalDB
# -----------------------------------------------------------------------------------------------------------------... | iliakan/jal | jal/data_import/statement_quik.py | statement_quik.py | py | 4,544 | python | en | code | null | github-code | 1 | [
{
"api_name": "pandas.read_html",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "logging.error",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "jal.widgets.helpers.g_tr",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "re.match",
... |
35563750428 | import pandas as pd
from sklearn.ensemble import RandomForestClassifier
import pickle
data = pd.read_csv('churn_data.csv')
X = data[['item_status','on_time','feedback']]
y = data['churn']
model = RandomForestClassifier(n_estimators=100, random_state=42)
model.fit(X, y)
with open('churn.pkl', 'wb') as model_file:
... | udithanayanajith/predeepMlAPI | churnTrain.py | churnTrain.py | py | 353 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sklearn.ensemble.RandomForestClassifier",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 14,
"usage_type": "call"
}
] |
21340445362 | '''
130. Surrounded Regions
Medium
1297
576
Add to List
Share
Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded by 'X'.
A region is captured by flipping all 'O's into 'X's in that surrounded region.
Example:
X X X X
X O O X
X X O X
X O X X
After running your function, the boa... | kannanParamasivam/datastructures_and_algorithm | graph/problems/130_surrounded_regions.py | 130_surrounded_regions.py | py | 2,854 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "collections.deque",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 85,
"usage_type": "name"
},
{
"api_name": "collections.deque",
"li... |
11554341119 | #!/usr/bin/env python3
'''
Author: Xingw Xiong
Data: 2018/11/16
Description: KNN-Scipy
'''
import numpy as np
import pandas as pd
from sklearn.neighbors import NearestNeighbors
import time, logging
logging.basicConfig(level = logging.INFO,format = '%(asctime)s - %(name)s - %(levelname)... | XingwXiong/NewsRS | src/knn/knn-doc2vec.py | knn-doc2vec.py | py | 2,836 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv... |
71222862435 | # coding=utf-8
import os
import json
import decimal
from os import urandom
import multiprocessing
import pymysql
import MySQLdb
import MySQLdb.cursors
import codecs
from enum import Enum, unique
DEFAULT_MAX_SIZE_OF_CSV = 2 * 1024 * 1024
RANDOM_STR = "RANDOM_STR_SUFFIX"
MAX_EXECUTION_TIME = 9999000
def... | FYPYTHON/PathOfStudy | component/openGauss/pg_chameleon/just_file/mysql_read.py | mysql_read.py | py | 27,217 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.Fi... |
42426806603 | import sys
from collections import deque
input = sys.stdin.readline
n = int(input())
board = [[0 for _ in range(n+2)] for _ in range(n+2)]
for x in range(n+2):
for y in range(n+2):
if x == 0 or x == n+1 or y == 0 or y == n+1 or (x == 1 and y == 1):
board[x][y] = -1
for _ in range(int(input()))... | jhchoy00/baekjoon | 3190.py | 3190.py | py | 1,248 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sys.maxsize",
"... |
3049317006 | #!/usr/bin/env python
import sys
import argparse
from pascal.program import Program
from printer import OutputBuffer
arg_parser = argparse.ArgumentParser(prog='Pascal Compiler')
arg_parser.add_argument('-p', '--pascal', required=True,
dest='filename',
help='location ... | TheLampshady/pascompiler | compiler.py | compiler.py | py | 716 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pascal.program.Program",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "printer.OutputBuffer.print_output",
"line_number": 26,
"usage_type": "call"
},
{
"... |
38018413084 | import ccxt
from django.db import models
from django.conf import settings
from django.core.validators import MaxValueValidator, MinValueValidator
from django.utils import timezone
from django.db.models import Q, Avg, Sum
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from capital.methods... | Capital-Digital/Trading | trading/models.py | models.py | py | 47,937 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "warnings.simplefilter",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pandas.errors",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "structlog.get_logger",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "django.... |
30603250626 | import datetime
import random
import pandas as pd
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
dataframe = pd.read_csv("domande.csv")
topics = list(dataframe["topic"].unique())
app = FastAPI()
origins = [
# "http://localhost:3000",
# "localhost:3000"
'*'
]
app.add_mid... | FedeAi/app-domande-backend | main.py | main.py | py | 1,587 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "fastapi.FastAPI",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "fastapi.middleware.cors.CORSMiddleware",
"line_number": 21,
"usage_type": "argument"
},
{
"api_nam... |
11631105468 | from imap_tools import (
AND,
NOT,
MailBox,
MailboxTaggedResponseError
)
import datetime
import logging
import requests
class MailBoxHandler:
def __init__(self, host, user, passwd, folder, filter):
self.host = host
self.user = user
self.passwd = passwd
self.folder =... | titulebolide/email-to-discord-bot | email_to_discord/bot.py | bot.py | py | 3,019 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.warning",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "logging.... |
38788788733 | import requests
from time import sleep
def get_river(river_num, year_start, year_end, discharge=False):
# Download a river
# Build the url
print('Building the url for request.')
url = (
"http://realtimedata.water.nsw.gov.au/cgi/webhyd.pl?co={river}"
"&t=rscf_org&v=100.00_100.00_CP{dis... | andrew-houghton/river_predict | new_dataset_acquisition/15_min_dl.py | 15_min_dl.py | py | 3,042 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "requests.exceptions",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "requests.get",
"... |
17755684015 | from .utils import Split
from . import config as config_lib
from . import dataset_spec as dataset_spec_lib
from . import pipeline
from .utils import worker_init_fn_
def get_metadataset(args, datasets=["ilsvrc_2012"], split=Split["TRAIN"]):
# Recovering configurations
data_config = config_lib.DataConfig(args)
... | hushell/pmf_cvpr22 | datasets/meta_dataset/__init__.py | __init__.py | py | 2,060 | python | en | code | 137 | github-code | 1 | [
{
"api_name": "utils.Split",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "utils.Split",
"line_number": 13,
"usage_type": "name"
}
] |
35715802575 | from openpyxl import load_workbook
from extractor import read_agenda
# setting up testing files
wb1 = load_workbook('test_example_1.xlsx', data_only=True)
worksheet_1 = wb1.worksheets[0]
wb2 = load_workbook('test_example_2.xlsx', data_only=True)
worksheet_2 = wb2.worksheets[0]
wb3 = load_workbook('test_example_3.x... | luaroncrew/university_agenda_to_apple_calendar | test_extractor.py | test_extractor.py | py | 733 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "e... |
41636256032 | from zeep import Client
import xml
def loadFile(file_name):
return open(file_name,"r").read()
client = Client('https://svn.apache.org/repos/asf/airavata/sandbox/xbaya-web/test/Calculator.wsdl')
prt = client.wsdl.services.get('Calculator').ports
print(prt)
print(dir(prt))
#print(prt.Add(1,2))
file = ... | qxZap/College | L3/ILN/ceeasta.py | ceeasta.py | py | 746 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "zeep.Client",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "zeep.Client",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "zeep.Client",
"line_number": 24,
"usage_type": "call"
}
] |
14060468681 | import unittest
__LICENSE__ = """
Copyright 2019 Google LLC
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 ag... | FunkySayu/discord-event-manager | api/mod_wow/realm_test.py | realm_test.py | py | 2,735 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
5274000630 | from vector import Vector
def setcolor(colorrange):
#darkblues
db1 = color(40, 70, 140)
db2 = color(52, 86, 163)
db3 = color(70, 130, 180)
db4 = color(65, 105, 225)
db = [db1, db2, db3, db4]
#lightblues
lb1 = color(94, 184, 219)
lb2 = color(93, 153, 187)
lb3 = color(72, 92, 151... | rosieswj/StarryNight | vfield.py | vfield.py | py | 2,137 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "vector.Vector",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "vector.Vector",
"line_number": 66,
"usage_type": "call"
}
] |
18163028124 | from itertools import combinations
from math import prod
def factors(x, limit=-1):
if limit == -1:
limit = x
return [i for i in range(1, limit + 1) if not x % i]
def calc_hatoslotto(digits_sum, digits_product):
digits = factors(digits_product, limit=45)
for combination in combinations(range(len(digits)), 6):
... | navima/szkript | 10h/feladat3.py | feladat3.py | py | 1,124 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "itertools.combinations",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "math.prod",
"line_number": 15,
"usage_type": "call"
}
] |
1531425243 | import copy
import geopandas as gpd
import numpy as np
from nuscenes import NuScenes
from nuscenes.can_bus.can_bus_api import NuScenesCanBus
from nuscenes.eval.common.utils import quaternion_yaw
from nuscenes.map_expansion.arcline_path_utils import discretize_lane
from nuscenes.map_expansion.map_api import NuScenesMap... | metadriverse/metadrive | metadrive/utils/nuscenes/utils.py | utils.py | py | 16,889 | python | en | code | 471 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "metadrive.utils.nuscenes.detection_type.ALL_TYPE",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "metadrive.type.MetaDriveType.TRAFFIC_BARRIER",
"line_number": 29,
"usa... |
35923836420 | import sip
sip.setapi('QString', 2)
from PyQt4 import QtCore , QtGui
_toUtf8 = lambda s: s.decode('utf8')
_fromUtf8 = lambda s : s.encode('utf8')
fromUtf8 = _fromUtf8
toUtf8 = _toUtf8
stdIcon = QtGui.QIcon.fromTheme
| xiaomailong/szarp | pyipk/qtipk/utils.py | utils.py | py | 221 | python | en | code | null | github-code | 1 | [
{
"api_name": "sip.setapi",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "PyQt4.QtGui.QIcon",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "PyQt4.QtGui",
"line_number": 12,
"usage_type": "name"
}
] |
19234977069 | import os
import pandas as pd
import torch
from kgformula.utils import simulation_object_rule_new
import pickle
import random
import numpy as np
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--idx', type=int, default=0, help='cdim')
parser.add_argument('--ngpu', type=int, default=4, help='cdim... | MrHuff/kgformula | run_covid.py | run_covid.py | py | 4,167 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "random.sample",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.cat",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "torch.cat",
"line_... |
39600864672 | import re
import glob
import pandas as pd
import nltk
from nltk.tokenize import WordPunctTokenizer
from nltk.stem import WordNetLemmatizer
all_files = glob.glob(r"other_textos\*")
i= 0
subject_ = []
owner_ = []
winner_ = []
price_ = []
compititors_ = []
price_comp = []
for file in all_files:
i += 1... | AnasAar/big_data_analysis | data_extraction.py | data_extraction.py | py | 3,722 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "glob.glob",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "nltk.stem.WordNetLemmatizer",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize.WordPunctTokenizer",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": ... |
70765340513 | from __future__ import print_function
import cx_Oracle
import decimal
import db_config
con = cx_Oracle.connect(db_config.user, db_config.pw, db_config.dsn)
cur = con.cursor()
BOOK_TYPE_NAME = "UDT_BOOK"
QUEUE_NAME = "BOOKS"
QUEUE_TABLE_NAME = "BOOK_QUEUE_TABLE"
# Dequeue the messages
options = con.deqoptions()
opti... | georgegrace1987/Hue_Practice | desktop/core/ext-py/cx_Oracle-6.4.1/samples/tutorial/solutions/aq-dequeue.py | aq-dequeue.py | py | 620 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "cx_Oracle.connect",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "db_config.user",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "db_config.pw",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "db_config.dsn",
... |
8761897844 | from Device import Device
from datetime import datetime
import Adafruit_DHT #library for the the DHT sensor.
class DHT(Device):
dhtsensors = { '11': Adafruit_DHT.DHT11,
'22': Adafruit_DHT.DHT22,
'2302': Adafruit_DHT.AM2302 }
dhtsensortype = None
temperature = None
... | flipsee/rpicenter | sandbox/internal_recipe/DHT.py | DHT.py | py | 1,137 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "Device.Device",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "Adafruit_DHT.DHT11",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "Adafruit_DHT.DHT22",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "Adafruit_D... |
70431605795 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('seaborn-whitegrid')
def L2norm(X1, X2): #Function to calculate L2 Norm
distance = 0
for i in range(len(X1)):
distance += (X1[i] - X2[i])**2
distance = distance**0.5
return distance
def centroid(X): #Function to calculate... | divyanshugit/representation_learning | models/classificaton/kNN.py | kNN.py | py | 2,733 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 4,
"usage_type": "name"
},
{
"api_name"... |
19978807 | # -*- coding: utf-8 -*-
"""
test_skeeter_notifier.py
This is a Python script to test the skeeter program.
It will call pg_notify in the database so the subscriber can report
"""
import logging
import random
import signal
import sys
from threading import Event
import psycopg2
from test.config import load_config
_lo... | SpiderOak/skeeter | test/test_skeeter_notifyer.py | test_skeeter_notifyer.py | py | 2,347 | python | en | code | 33 | github-code | 1 | [
{
"api_name": "logging.StreamHandler",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "logging.root.addHandler",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "loggi... |
7163854747 | #!/usr/bin/env python3
"""PLINK to preform PCA: plink --vcf BYxRM_segs_saccer3.bam.simplified.vcf
--pca 2 --allow-extra-chr --allow-no-sex --mind
used plink.eigenvec file for this plot"""
import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
eigenvec= open(sys.argv[1]) #plink.eigenvec fi... | hhaller1/qbb2019-answers | week4/week4-1.py | week4-1.py | py | 667 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "matplotlib... |
7505401532 | from django.shortcuts import render, get_object_or_404, redirect, Http404
from django.http import HttpResponse
from django.views.generic import TemplateView, View
from django.contrib.auth.decorators import login_required
from django.contrib.auth.views import LoginView, LogoutView
from django.contrib.auth import login, ... | kutipense/restaurant_automation_system | onlinerestaurant/views.py | views.py | py | 8,676 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.views.generic.TemplateView",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "models.Rezervasyon.objects.filter",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "models.Rezervasyon.objects",
"line_number": 25,
"usage_type": "attrib... |
30842214004 | #__iter__() and iter()
"""
Iterator objet is a special object that represents a stream of data that we can operate on. To acomplish this,
it uses a built in function called iter()
"""
#iterable
dog_foods = {
"Great Dane Foods": 4,
"Min Pin Pup Foods": 10,
"Pawsome Pups Foods": 8
}
#iteration
for food_brand... | yshim1/pythonprac | intermediate/iterables_iterators.py | iterables_iterators.py | py | 8,844 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "itertools.count",
"line_number": 174,
"usage_type": "call"
},
{
"api_name": "itertools.count",
"line_number": 184,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"line_number": 207,
"usage_type": "call"
},
{
"api_name": "itertools.combinat... |
13390723416 | from __future__ import with_statement
import sys
import argparse
from subprocess import Popen, PIPE
def parse_arguments():
parser = argparse.ArgumentParser(description="Create a Spark Cluster on "
"Docker Host.", epilog="Example Usage: "
... | ezhaar/spark-docker-deploy | spark_deploy.py | spark_deploy.py | py | 4,833 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 35,
"usage_type": "name"
}
] |
70647012833 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# script runCosmo.py
'''
**runCosmo** run Data Aquisition with Picoscpe
(modified version of runDAQ from picoDAQ project)
Relies on python drivers by Colin O'Flynn and Mark Harfouche,
see https://github.com/colinoflynn/pico-python
and on package *picodaqa*,
se... | GuenterQuast/picoCosmo_dev | runCosmo.py | runCosmo.py | py | 6,287 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "time.sleep",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 74,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 78,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": ... |
26048176784 | # -*- coding: utf-8 -*-
from imtools import *
import numpy as np
import numpy.fft as fft
import matplotlib as mpl
import matplotlib.pyplot as plt
from math import *
from cmath import *
##Exercice 1: visualisation de fonctions de Sobolev
##1.a Sobolev 1d
##On suppose une décroissance des coefficients de Fourier en (1... | pjbenard/EDP_TP_2 | sobolev.py | sobolev.py | py | 4,233 | python | fr | code | 0 | github-code | 1 | [
{
"api_name": "numpy.append",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "numpy.append",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "numpy.append",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "numpy.append",
"line_numbe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.