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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7921292233 | import pytest
from scripts.create_type_file import get_properties, create_connection_by_url, get_metadata_param
test_data = [
["wss://rpc.polkadot.io", "Polkadot"],
["wss://kusama-rpc.polkadot.io", "Kusama"],
["wss://westend-rpc.polkadot.io", "Westend"],
["wss://statemine.api.onfinality.io/public-ws", ... | zktony/nova-utils | tests/test_type_creation.py | test_type_creation.py | py | 1,386 | python | en | code | null | github-code | 36 | [
{
"api_name": "scripts.create_type_file.get_properties",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "scripts.create_type_file.create_connection_by_url",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 22,
"u... |
29698007156 | import pandas as pd
import ppscore as pps
import streamlit as st
import plotly.express as px
from utils.helpers import (plot_binary_feature,
plot_feature_distribution,
define_lr_pipeline,
get_cross_val_score)
from utils.constants import ... | diegoglozano/interpretable-ml | modules/introduction.py | introduction.py | py | 3,220 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.DataFrame",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "streamlit.write",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "streamlit.dataframe",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "streamlit.w... |
34202592392 | #!/usr/bin/env python
import click
from intercom.models import Location
from intercom.repositories import CustomerRepository
from intercom.services import get_customers_close_to_office
@click.command()
@click.option('--dataset', default='dataset/customers.txt', help='Path to the dataset.')
@click.option('--max-dist... | Wicker25/intercom-test | cli.py | cli.py | py | 941 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "intercom.models.Location",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "intercom.repositories.CustomerRepository",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "intercom.services.get_customers_close_to_office",
"line_number": 18,
"u... |
3321900706 | import numpy as np
import matplotlib.pyplot as plt
def f(x):
return x**2 + (np.sin(9*x))**2
n=8
xi = [i/n for i in range(n+1)]
yi = [f(xi[i]) for i in range(n+1)]
#tabela das diferenças divididas:
T = [yi]
for j in range(n+1):
T += [[(T[j][i+1]-T[j][i])/(xi[i+1+j]-xi[i]) for i in range(n-j)]]
... | MotaBruno/Analise-Numerica-projetos | ex2-pol.py | ex2-pol.py | py | 1,317 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.sin",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
30582925697 | # -*- coding: utf-8 -*-
"""
Group 8 Final Project - Automatic Image Colorization
Ahmed Nasrallah, Touseef Ali, Hitesh Kumar
"""
#%%
import keras
from keras.preprocessing import image
from keras.engine import Layer
from keras.layers import Conv2D, Conv3D, UpSampling2D, InputLayer, Conv2DTranspose, Input... | hitsasu/image-colorization | code/color.py | color.py | py | 4,440 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "keras.applications.vgg16.VGG16",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "keras.applications",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "keras.models.Sequential",
"line_number": 33,
"usage_type": "call"
},
{
"ap... |
38802468088 | import numpy as np
import cv2
import os
import time
import crop
import sys
from PIL import Image
def mean(x):
return sum(x) / len(x)
def showimage(name, image):
cv2.imshow(name, image)
cv2.waitKey(0)
cv2.destroyAllWindows()
def grouping(img):
print('the grouping part')
image = cv2.imread... | kaustubhdeokar/FinalTrendzlinkImage | gradient.py | gradient.py | py | 5,348 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.imshow",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cv2.destroyAllWindows",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_n... |
32413118307 | from flask import Flask, render_template, redirect, url_for
from flask_bootstrap import Bootstrap
from flask_ckeditor import CKEditor
from datetime import date
from flask_sqlalchemy import SQLAlchemy
import os
app = Flask(__name__)
ckeditor = CKEditor(app)
Bootstrap(app)
app.config['SQLALCHEMY_DATABASE_URI'] = os.env... | matic56789/TriBap | main.py | main.py | py | 1,194 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_ckeditor.CKEditor",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask_bootstrap.Bootstrap",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.enviro... |
4065634528 | """
Module to detect new parkrun events and coordinate the notification system.
Notifications are sent out via gmail, with credentials stored in a credentials.toml
file.
"""
import mimetypes
import smtplib
from datetime import datetime
from email.message import EmailMessage
from pathlib import Path
from typing import O... | jmoro0408/parkrun | email_new_events.py | email_new_events.py | py | 7,229 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.today",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "typing.Union",... |
20445071495 | import logging as l
import sys
import os
import json
logger = l.getLogger("Transformer")
logger.setLevel(l.DEBUG)
formatter = l.Formatter('%(asctime)s | %(levelname)s | %(message)s')
stdout_handler = l.StreamHandler(sys.stdout)
stdout_handler.setLevel(l.INFO)
stdout_handler.setFormatter(formatter)
fh = l.FileHandle... | BastienEstia/SCDashBoard | pipline/Transformer.py | Transformer.py | py | 7,956 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "logging.Formatter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.StreamHan... |
18794196909 | """
Backend implementation for parsing the LCLS Questionnaire.
"""
import functools
import logging
import re
from typing import Optional
from psdm_qs_cli import QuestionnaireClient
from ..errors import DatabaseError
from .json_db import JSONBackend
logger = logging.getLogger(__name__)
class RequiredKeyError(KeyErr... | pcdshub/happi | happi/backends/qs_db.py | qs_db.py | py | 15,490 | python | en | code | 10 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "psdm_qs_cli.QuestionnaireClient",
"line_number": 113,
"usage_type": "name"
},
{
"api_name": "errors.DatabaseError",
"line_number": 178,
"usage_type": "call"
},
{
"api_name... |
44008099598 | import pygame
from pygame.locals import *
from random import randint as rand
pygame.init()
screen = pygame.Surface((500, 100))
window = pygame.display.set_mode((screen.get_width() * 2, screen.get_height() * 2))
def constrain(val, lo, hi):
# Because these things are useful :)
if val <= lo:
return lo
... | ninjafrostpn/PythonProjects | Bending/Bending(old interface).py | Bending(old interface).py | py | 14,805 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.Surface",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.display",
... |
39725412461 | from app import db
import jinja2
from datetime import date
from flask import current_app, url_for
from flask_login import UserMixin, current_user, login_manager
class Admin(db.Model, UserMixin):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(60))
password = db.Co... | run-nerver/student_info_system | app/models/pro.py | pro.py | py | 11,598 | python | en | code | 82 | github-code | 36 | [
{
"api_name": "app.db.Model",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "app.db",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "flask_login.UserMixin",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "app.db.Column",
"l... |
22354713255 | import base64
import os
import typing
import unittest
import deepdiff
import fastapi.testclient
import kubernetes
import pytest
import sqlalchemy.orm
import mlrun.common.schemas
import mlrun.errors
import mlrun.runtimes.pod
import server.api.utils.singletons.k8s
import tests.api.runtimes.base
from mlrun.datastore imp... | mlrun/mlrun | tests/api/runtimes/test_spark.py | test_spark.py | py | 29,207 | python | en | code | 1,129 | github-code | 36 | [
{
"api_name": "tests.api.runtimes.base.api",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "tests.api.runtimes.base",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "mlrun.common.schemas.runtimes.Spark3Runtime",
"line_number": 32,
"usage_type": "... |
4798482149 | import requests
from datetime import datetime
import smtplib
from dotenv import load_dotenv
import os
import time
load_dotenv(override=True)
EMAIL = os.environ.get("SENDER")
PWD = os.environ.get("PWD")
# From https://www.latlong.net/
MY_LAT = 6.320439
MY_LONG = -75.567467
# Your position is within +5 or -5 degree... | andresmesad09/iss_overhead | main.py | main.py | py | 1,721 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
... |
39155415013 | import nltk
from nltk.stem.lancaster import LancasterStemmer
stemmer = LancasterStemmer()
import numpy
import tflearn
import tensorflow
import random
import json
import pickle
with open('intents.json') as file:
data = json.load(file)
# If preprocessed data present no need to do again
try:
with open("data.pic... | docmhvr/AI_chatbot | main.py | main.py | py | 3,802 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "nltk.stem.lancaster.LancasterStemmer",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "nltk.word_t... |
38006333091 | # scp ./move_jetbot_17_11.py jetson@192.168.0.240:/home/jetson/Documents/jetbot-master/notebooks/collision_avoidance
# scp -r jetson@192.168.0.240:/home/jetson/Documents/jetbot-master/notebooks/collision_avoidance/images ./images
# scp -r ./images/dataset jetson@192.168.0.240:/home/jetson/Documents/jetbot-master/notebo... | panjacob/brainbot_movement | move_jetbot_na_samych_obrazach.py | move_jetbot_na_samych_obrazach.py | py | 4,770 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras.models.Sequential",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "tensorfl... |
26402106184 | import os
import sys
import random
import pygame
import sqlite3
from PyQt5.QtWidgets import QWidget, QApplication, QPushButton
from PyQt5.QtWidgets import QInputDialog
pygame.init()
db = sqlite3.connect('clicker.db')
cur = db.cursor()
clock = pygame.time.Clock()
display_width = 1920
display_height = 108... | babysheesh/clicker | кликер2.0/main.py | main.py | py | 49,547 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.init",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.time.Clock",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pygame.time",
"line_... |
14298819617 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/1/1 0:31
# @Author : lingxiangxiang
# @File : demonlogging.py
import logging
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s',datefmt=' %Y/%m/%d %H:%M:%S', filename='myapp.log', fil... | ajing2/python3 | Basics/module/demonlogging.py | demonlogging.py | py | 568 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
}
] |
16044333714 | from config import *
import numpy as np
from os import listdir
from os.path import join, isdir
from tqdm import tqdm
import cv2
from tensorflow.keras.utils import to_categorical
import random
def create_dataset(dataset_path: str, data_aug: bool):
"""
Parameters
----------
dataset_path
path to ... | serginogues/cnn_lstm_activity_recognition | utils.py | utils.py | py | 5,139 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.listdir",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": ... |
74520952744 | """
Usage: import the module, or run from
the command line as such:
python3 process_util.py --input=/path/to/input/file --output=/path/to/output/file --chunksize=chunksize
"""
import os
import sys
import itertools
import numpy as np
import pandas as pd
from sqlalchemy import create_engine
DEFAULT_... | emaksOne/preprocess_data | process_util.py | process_util.py | py | 14,141 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_numbe... |
37069849941 | #!/usr/bin/python3
"""
Gather data from an API
"""
import json
import requests
import sys
def get_employee_name(employee_id):
"""
Function to get employee name
"""
base_url = "https://jsonplaceholder.typicode.com"
user_url = f"{base_url}/users/{employee_id}"
response = requests.get(user_url)
... | wughangar/alx-system_engineering-devops | 0x15-api/2-export_to_JSON.py | 2-export_to_JSON.py | py | 1,733 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 37,
... |
75034720424 | """
URL configuration for config 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, name='home'... | ualex90/PWLService | config/urls.py | urls.py | py | 1,870 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "drf_yasg.views.get_schema_view",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "drf_yasg.openapi.Info",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "drf_yasg.openapi",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": ... |
40517757437 | import os
import glob
import time
from datetime import datetime
from argparse import ArgumentParser
import pandas as pd
import matplotlib.pyplot as plt
import torch
import numpy as np
from agents.PPO import PPO
from environment.drl_environment import DRLEnvironment
def train():
env_name = "DRL"
has_cont... | AgileCodeCO/airsim-drl-reinforcement-learning | main.py | main.py | py | 13,673 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "environment.drl_environment.DRLEnvironment",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name":... |
7504826492 | from datetime import datetime
import time
import json
from master import Master
import os
LOCAL_PATH = os.path.join(os.getcwd(), "filesys", "colonyData.json")
# ANSI color codes
RED = '\033[0;31m'
GREEN = '\033[0;32m'
YELLOW = '\033[0;33m'
NC = '\033[0m' # No color, to reset
class UI:
def __init__(self):
... | Olliyard/DWARVES | Master/Archived/ui - Copy.py | ui - Copy.py | py | 17,234 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "master.Master",
"line_number": 1... |
40657145010 | import tensorflow as tf
import tensorlayer as tl
import numpy as np
import scipy
import time
import math
import argparse
import random
import sys
import os
import matplotlib.pyplot as plt
from model import *
from tensorlayer.prepro import *
from tensorlayer.layers import *
from termcolor import colore... | betairylia/Pokemon-Showdown-Win-Rate-Prediction | PokemonVector.py | PokemonVector.py | py | 5,926 | python | en | code | 7 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
... |
29785722520 | from django.shortcuts import render,redirect
from django.views import View
from account.models import Contact,Staff
from home.models import Students
from .forms import Studentform
from django.contrib import messages
# Create your views here.
class Home(View):
def get(self,request):
return rende... | Afnas4/project1 | students/home/views.py | views.py | py | 3,323 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.views.View",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.views.View",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "account.m... |
3965122741 | # GBM'in hız ve tahmin performansını arttırmak üzere optimize edilmiş; ölçeklenebilir ve farklı platformlara entegre edilebilir halidir.
# R, Python, Hadoop, Scala, Julia ile kullanılabilir.
# Ölçeklenebilirdir.
# Hızlıdır.
# Tahmin başarısı yüksektir ve bir çok Kaggle yarışmasında başarısını kanıtlamıştır.
# Özet... | gorkenvm/DataScienceBootcamp-Prepration | ML/Dogrusal Olmayan Regresyon Modelleri/9_XGBoost.py | 9_XGBoost.py | py | 2,575 | python | tr | code | 2 | github-code | 36 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.get_dummies",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.con... |
25938234352 | from sanic.request import File
from pydantic.class_validators import root_validator
from typing import Optional, Union, IO
import io
import openpyxl
from pydantic import Field
from infrastructure.configs.translation_task import FILE_TRANSLATION_TASKS, PLAIN_TEXT_TRANSLATION_TASKS, AllowedFileTranslationExtensionEnum
f... | KCDichDaNgu/KC4.0_DichDaNgu_BackEnd | src/modules/translation_request/domain/entities/translation_request.py | translation_request.py | py | 2,827 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "modules.task.domain.entities.task.TaskProps",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "infrastructure.configs.task.TranslationTaskStepEnum",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "pydantic.Field",
"line_number": 26,
"usag... |
15318192424 | from django.shortcuts import get_object_or_404
from rest_framework import viewsets, mixins, permissions, status
from rest_framework.decorators import action
from django.db.models import Q
from rest_framework.response import Response
from users.models import User, Profile, FriendRequest
from users.serializers import Us... | Mrklata/Twitter-Fb-alternative | users/api.py | api.py | py | 4,554 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "rest_framework.mixins.CreateModelMixin",
"line_number": 12,
"usage_type... |
26744629167 | import torch
from torch import nn
import torch.nn.functional as F
"""
Components
"""
class ASPP_module(nn.Module):
def __init__(self, inplanes, planes, rate): # inplanes: input channel; planes: output channel
super(ASPP_module, self).__init__()
if rate == 1:
kernel_size = 1
... | yuanlinping/deep_colormap_extraction | netArchitecture/ASPP.py | ASPP.py | py | 2,239 | python | en | code | 7 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
13050899024 | from sqlalchemy import (
testing, null, exists, text, union, literal, literal_column, func, between,
Unicode, desc, and_, bindparam, select, distinct, or_, collate, insert,
Integer, String, Boolean, exc as sa_exc, util, cast)
from sqlalchemy.sql import operators, expression
from sqlalchemy import column, ta... | lameiro/cx_oracle_on_ctypes | test/integration/3rdparty/SQLAlchemy-1.0.8/test/orm/test_query.py | test_query.py | py | 132,871 | python | en | code | 20 | github-code | 36 | [
{
"api_name": "test.orm._fixtures.FixtureTest",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "test.orm._fixtures",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 41,
"usage_type": "call"
},
{
"api... |
20240300556 | # Definition for singly-linked list.
from typing import Optional
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
# @see https://qiita.com/KueharX/items/7112e8bd9dbf69f5c083
class Solution:
def mergeTwoLists(
self, list1: Optional[ListNode], list2... | sugitata/leetCode | linkedList/merge_two_sorted_list.py | merge_two_sorted_list.py | py | 1,286 | python | ja | code | 0 | github-code | 36 | [
{
"api_name": "typing.Optional",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 15,
"usage_type": "name"
}
] |
28616363443 | from enum import Enum
from InsertOrder import InsertOrder, LifeSpan, Side
import sys
import exchange_pb2 as proto
import State
from time import sleep
from typing import Callable
from threading import Thread
from websocket import WebSocketApp
class ExchangeClient:
'''
A client class responsible for sending Ins... | UOA-CS732-SE750-Students-2022/project-group-magenta-mice | apps/data-generator/libs/ExchangeClient.py | ExchangeClient.py | py | 3,811 | python | en | code | 20 | github-code | 36 | [
{
"api_name": "websocket.WebSocketApp",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "State.NotLoggedInS... |
42912024062 | import cv2
from PIL import Image
import pytesseract
import re
import numpy as np
from url_camera import url
# En esta función podría quitar la parte en la que me guarda la imagen.
def capture_food():
cap = cv2.VideoCapture(url)
while True:
ret, frame = cap.read()
if frame is not None:
... | marinapm90/E-vitalos | Proyecto/scanning_ingredients.py | scanning_ingredients.py | py | 1,342 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "url_camera.url",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "cv2.GaussianBlur",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
... |
19260761331 | # -*- coding: utf-8 -*-
"""
Created on Thu Oct 29 13:45:16 2020
"""
from pytube import YouTube
import tkinter as tk
window=tk.Tk()
#########by teacher############
window.title("Youtube下載器")
window.geometry("500x150")
window.resizable(False,False)
#######################
progress=0
def showProgr... | JeffreyChen-coding/student-homework | mike1024.py | mike1024.py | py | 1,513 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tkinter.Tk",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pytube.YouTube",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "tkinter.Label",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "tkinter.StringVar",
"line... |
18230811445 | import nfc
from nfc.clf import RemoteTarget
from pybleno import *
def startup(targets):
print("waiting for new NFC tags...")
return targets
def connected(tag):
print("old message:")
if tag.TYPE == 'Type4Tag' and tag.ndef is not None:
if tag.ndef.records[0].uri == 'http://www.kddi.com/hr-nfc/... | shugonta/monitor_nfc | pynfc.py | pynfc.py | py | 660 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "nfc.ContactlessFrontend",
"line_number": 24,
"usage_type": "call"
}
] |
10492846310 | import cv2
import time
import os
# 비디오 파일 열기
cap = cv2.VideoCapture('./frames/test2.mp4')
# 비디오 파일이 성공적으로 열렸는지 확인
if not cap.isOpened():
print("Cannot open video file")
exit()
# 프레임 레이트 가져오기
fps = cap.get(cv2.CAP_PROP_FPS)
fps = 3
# 각 프레임에서 이미지를 추출하고 저장할 폴더 경로 설정
output_folder = 'frames/images'
if not os.pat... | chansoopark98/3D-Scanning | video_extract.py | video_extract.py | py | 1,759 | python | ko | code | 0 | github-code | 36 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FPS",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"l... |
12438520461 | from genericpath import isfile
import os
from cryptography.fernet import Fernet
file_list = []
for file in os.listdir():
if file == "ransom.py" or file == "dosyalari-sifrele.py" or file == "generatedkey.key" or file == "dosyalari-coz.py":
continue
if os.path.isfile(file):
file_list.append(fil... | karakayaahmet/Ransomware | dosyalari-coz.py | dosyalari-coz.py | py | 657 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "os.listdir",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "cryptography.fernet.Fernet",
... |
71352577065 | """
trainer of cycle architecture
works well on adt2gex, atac2gex, gex2atac subtasks
used the cycle consistancy loss the enhance the reconstruction effect
"""
import os
import logging
import numpy as np
import anndata as ad
from scipy.sparse import csc_matrix
from tensorboardX import SummaryWriter
import t... | itscassie/scJoint-neurips2021-modality-prediction | model/trainer/trainer_cycle.py | trainer_cycle.py | py | 13,131 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tensorboardX.SummaryWriter",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "utils.dataloader.S... |
14300366370 | # -*- coding: utf-8 -*-
"""
Created on Sat Jun 26 20:12:34 2021
@author: RISHBANS
"""
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 26 19:35:00 2021
@author: RISHBANS
"""
from keras.models import Sequential
from keras.layers import Convolution2D, MaxPooling2D, Flatten, Dense
#Initialize CNN
model = Sequential()
... | edyoda/ML-with-Rishi | cnn_3.py | cnn_3.py | py | 1,545 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "keras.models.Sequential",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "keras.layers.Convolution2D",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "keras.layers.MaxPooling2D",
"line_number": 25,
"usage_type": "call"
},
{
"api_... |
6803651192 | import cx_Freeze
executables = [cx_Freeze.Executable("sk invader.py")]
cx_Freeze.setup(
name="Space Invader",
options={"build_exe": {"packages":["pygame"],
"include_files":["background.png","background2.jpg","fighter.png"]}},
executables = executables
) | subashal/SK-SPACE-INVADER | setup.py | setup.py | py | 298 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cx_Freeze.Executable",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "cx_Freeze.setup",
"line_number": 5,
"usage_type": "call"
}
] |
72573554664 | """
This file will contain the metrics of the framework
"""
import matplotlib.pyplot as plt
import numpy as np
import sklearn.metrics as mt
import wandb
class IOUMetric:
"""
Class to calculate mean-iou using fast_hist method
"""
def __init__(self, num_classes):
self.num_classes = num_classes
... | ArthurZucker/PAMAI | utils/metrics.py | metrics.py | py | 4,262 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "numpy.zeros",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.bincount",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.diag",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.diag",
"line_number":... |
73130978024 | from django.conf import settings
from django.conf.urls.static import static
from django.urls import path, include
from drf_spectacular.views import (
SpectacularAPIView,
SpectacularRedocView,
SpectacularSwaggerView,
)
from api.urls import urlpatterns as api_urls
# Common urls
# ===========================... | by-Exist/django-skeleton | backend/config/urls.py | urls.py | py | 1,252 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.API_VERSION",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 15,
"usage_type": "name"
},
{
"api_n... |
17796731524 | from __future__ import absolute_import, division, print_function, unicode_literals
import os
import unittest
import xml.etree.ElementTree as ET
from builtins import object
from textwrap import dedent
from pants.base.build_environment import get_buildroot
from pants.util.contextutil import open_zip, temporary_dir
from... | fakeNetflix/twitter-repo-pants | tests/python/pants_test/backend/jvm/tasks/jvm_compile/zinc/zinc_compile_integration_base.py | zinc_compile_integration_base.py | py | 13,451 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "builtins.object",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "pants.util.dirutil.safe_open",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pants.util.contextutil.open_zip",
"line_number": 33,
"usage_type": "call"
},
{
"api_... |
42520787765 | from fastapi import FastAPI,Request
from fastapi import APIRouter
import aiomysql
from configuration.configuration import configuracion
from pydantic import BaseModel
from fastapi.param_functions import Body
from models.estudianteClass import estudianteClass
paralelo_router = APIRouter()
async def getConexion():
... | juanjoo0410/CS_Proyecto_API | controllers/paraleloController.py | paraleloController.py | py | 1,310 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "aiomysql.connect",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "configuration.configuration.configuracion",
"line_number": 13,
"usage_type": "name"
},
{
"api_n... |
3289924772 | import sys
import pprint as _pprint_
from pyomo.core.kernel.numvalue import \
NumericValue
from pyomo.core.kernel.component_interface import \
(ICategorizedObject,
_ActiveComponentContainerMixin)
import six
def pprint(obj, indent=0, stream=sys.stdout):
"""pprint a kernel modeling object"""
# ugl... | igorsowa9/vpp | venv/lib/python3.6/site-packages/pyomo/core/kernel/util.py | util.py | py | 4,337 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "sys.stdout",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pyomo.core.kernel.component_interface.ICategorizedObject",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": "pyomo.core.kernel.numvalue.NumericValue",
"line_number": 17,
... |
30758316388 | import pathlib
def create_directory(path: str) -> None:
directory = pathlib.Path(path)
if directory.exists():
raise FileExistsError(f"{path} is exist")
directory.mkdir()
def create_file(path: str, content: str = None) -> None:
file = pathlib.Path(path)
if file.exists():
raise Fi... | jonarsli/flask-restapi | flask_restapi/tool/core.py | core.py | py | 456 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 13,
"usage_type": "call"
}
] |
73118842984 | from datetime import datetime, timedelta
def work_day(start, end):
work = 0
curr_date = start
while curr_date <= end:
if curr_date.weekday() < 5:
work += 1
curr_date += timedelta(days=1)
return work
start_date, end_date = datetime(2023, 1, 1), datetime(2023, 12, 31)
print... | IlyaOrlov/PythonCourse2.0_September23 | Practice/achernov/module_10/task_2.py | task_2.py | py | 468 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "datetime.timedelta",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "call"
}
] |
4871120057 | import urllib.request
from time import sleep
import json
from pprint import pprint
from bs4 import BeautifulSoup
from beautifulscraper import BeautifulScraper
scraper = BeautifulScraper()
years =[x for x in range(2009,2018)]
weeks = [x for x in range(1,18)]
stype = "REG"
gameids =[]
f = open("nfldata.json", "w")... | Jamada623/4883-SWTools-Joseph | Assignments/A03/scrape_game_ids_data_joseph.py | scrape_game_ids_data_joseph.py | py | 1,925 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "beautifulscraper.BeautifulScraper",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "urllib.request... |
17156637951 | import torch
from mapping.model_training.transformer_training_nsp import train_nsp
from mapping.model_training.training_data_utils import get_next_sentence_df
from mapping.mapping_models.data_fit_models.masking_lm.bert_masking_trained_mtl import BertMaskingTrainedMtlMapper
from utils.bert_utils import get_lm_embeddi... | Peter-Devine/Feedback-Mapping | mapping/mapping_models/data_fit_models/nsp_lm/bert_nsp_trained_mtl.py | bert_nsp_trained_mtl.py | py | 2,123 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "mapping.mapping_models.data_fit_models.masking_lm.bert_masking_trained_mtl.BertMaskingTrainedMtlMapper",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "utils.bert_utils.get_lm_embeddings",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "mapping... |
41234096273 | from django.utils import timezone
import os
from rest_framework_simplejwt.tokens import RefreshToken
# url for user's image.
def upload_img_url(instance, filename):
date = timezone.now()
path = os.path.join("user-pic", instance.username, str(date.year), str(date.month), str(date.day), filename)
return path... | shaikhAhmed232/Socialogram-Backend | accounts/utils.py | utils.py | py | 682 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.utils.timezone.now",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.utils.timezone",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
25918861038 | import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt
# Capacitor
capacitance = 3400 # [=] farads
esr = 0.00013 # [=] ohms
initial_voltage = 2.85 # [=] volts
# Railgun, projectile, leads, construction
w = 0.00635 * 2 # width of the rails [=] meters
h = 0.00635 * 2 # height of rail... | WhiteRabbit2006/Railgun | Calculator.py | Calculator.py | py | 5,512 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.pi",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "numpy.cos",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "numpy.radians",
"line_numbe... |
9996315350 | import re
from datetime import datetime
from async_lru import alru_cache
from discord import Permissions, Embed
from discord.utils import escape_markdown
import utils.discord
import utils.misc
import utils.tableBuilder
import wrappers.api.minecraft
import wrappers.api.wynncraft.v3.player
from handlers.commands import... | Freeder1k/NiaBot | handlers/commands/prefixed/playerCommand.py | playerCommand.py | py | 6,131 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "re.compile",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "niatypes.dataTypes.MinecraftPlayer",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "wrappers.api... |
21626078429 | import configparser
import os
# read the source under [browser] item
def get_browser(name):
global base_path, cf_path
base_path = os.path.dirname(os.getcwd())
cf_path = os.path.join(base_path, "config", "config.ini")
cf = configparser.ConfigParser()
cf.read(cf_path)
return cf.get('browser', na... | litongtongx/test | common/readconfig.py | readconfig.py | py | 435 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number":... |
34543856455 | from pathlib import Path
from torch.utils.data import IterableDataset
class SceneDataset(IterableDataset):
"""
A dataset representing an infinite stream of noise images of specified dimensions.
"""
def __init__(self, path: Path):
"""
:param num_classes: Number of classes (labels)
... | manorzvi/VoteNet | data/dataset.py | dataset.py | py | 746 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.utils.data.IterableDataset",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 10,
"usage_type": "name"
}
] |
5915682093 | import argparse
import pickle as pk
import re
import signal
import time
import atexit
import traceback
import warnings
import sys
import os
import json
from collections import defaultdict
from threading import Thread
import pandas as pd
import psycopg2 as pg
from psycopg2.extras import RealDictCursor
from selenium.web... | BatyaGG/kaspibot | kaspibotV3.py | kaspibotV3.py | py | 41,975 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path.a... |
31076470598 | # This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but ... | drewwalters96/subber | subber/reddit.py | reddit.py | py | 7,738 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "praw.Reddit",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "prawcore.exceptions",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "subber.util.ut... |
26455397608 | #! /usr/bin/python3
# findspark import후 초기화
# 빨리 찾기위한 module 있으나 없으나 별 차이가 없다.
import findspark
findspark.init()
from pyspark.sql import SparkSession
#SparkSession 객체 생성 방법. (앱이름을 pyspark-hdfs1라는것으로 임의로 주고 .getOrCreate() 해준>
sparkSession = SparkSession.builder.appName("pyspark-hdfs2").getOrCreate()
# read.load()는 다양한 ... | jshooon/BigData_Hadoop | chap06/local_file_load2.py | local_file_load2.py | py | 812 | python | ko | code | 0 | github-code | 36 | [
{
"api_name": "findspark.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 8,
"usage_type": "attribute"
},... |
74784258662 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def ludwig_lang_plot(cation_data_fn, anion_data_fn, cations, anions):
cat_reader = pd.read_csv(cation_data_fn)
an_reader = pd.read_csv(anion_data_fn)
cat_data = []
for column in cat_reader:
cat_data.append(cat_reader[column].values)
samp_... | yashvardhan747/Statistical-and-Aqual-chemical-plots | AquaChemPlots/ludwig_lang_plot.py | ludwig_lang_plot.py | py | 1,452 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "matplotlib.py... |
36339474495 | import scipy.misc
import matplotlib.pyplot as plt
# This script demonstrates fancy indexing by setting values
# on the diagonals to 0.
# Load the ascent array
ascent = scipy.misc.ascent()
xmax = ascent.shape[0]
ymax = ascent.shape[1]
# Fancy indexing
# Set values on diagonal to 0
# x 0-xmax
# y 0-ymax
ascent[range(x... | denotepython/pythonbook | python数据分析/3358OS_Code/3358OS_02_Code/3358OS_02_Code/code2/fancy.py | fancy.py | py | 521 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "scipy.misc.misc.ascent",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "scipy.misc.misc",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "scipy.misc",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot... |
18326177260 | from blackjack_simulator import BlackJack as Environment
from evaluate_policy import mc_first_visit, mc_every_visit, k_step_td
from control_policy import k_step_sarsa, q_learning, td_lambda
import sys
from tqdm.auto import tqdm
def eval_dealer_policy(eval_algo=0, num_expt=1, num_episodes=1000, k_step=1):
env = Env... | djin31/tabularRL | tabular_rl.py | tabular_rl.py | py | 2,069 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "blackjack_simulator.BlackJack",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tqdm.auto.tqdm",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "evaluate_policy.mc_first_visit",
"line_number": 13,
"usage_type": "call"
},
{
"api_na... |
9796518132 | import time
from urllib import quote, unquote
from webob import Request
from swift.common.utils import (get_logger, get_remote_client,
get_valid_utf8_str, TRUE_VALUES)
class InputProxy(object):
"""
File-like object that counts bytes read.
To be swapped in for wsgi.input f... | DmitryMezhensky/Hadoop-and-Swift-integration | swift/swift/common/middleware/proxy_logging.py | proxy_logging.py | py | 8,172 | python | en | code | 20 | github-code | 36 | [
{
"api_name": "swift.common.utils.TRUE_VALUES",
"line_number": 57,
"usage_type": "name"
},
{
"api_name": "swift.common.utils.get_logger",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "webob.Request",
"line_number": 91,
"usage_type": "call"
},
{
"api_na... |
38033130776 | from typing import List, Optional
from pydantic import BaseModel
class Address(BaseModel):
city: str
country: str
class User(BaseModel):
name: str
address: Address
friends: Optional[List['User']] = None
class Config:
json_encoders = {
Address: lambda a: f'{a.city} ({a.c... | merlinepedra25/PYDANTIC | docs/examples/exporting_models_json_forward_ref.py | exporting_models_json_forward_ref.py | py | 816 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.List",
... |
34400920616 | #!/usr/bin/python3
"""This module defines a class to manage file storage for airbnb clone"""
import json
class FileStorage:
"""Class manages storage of all instances for airbnb clone"""
__file_path = "file.json"
__objects = {}
def all(self):
"""Returns dictionary of all objects"""
ret... | Sami64/AirBnB_clone | models/engine/file_storage.py | file_storage.py | py | 1,685 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.dump",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "models.base_model.BaseModel",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "models.user.User",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "models.state.S... |
7003120074 | from analysis import load_subset_data, define_meta_class, feature_choice
from analysis import keep_important_variables, create_pairs
from analysis import normalize_data, Bigger_Net, global_loop, save_error
from vizualisation import color_map
from torch.utils.data import dataset, DataLoader
import torch
import torch.nn... | pierrecavalier/graph_fink | main.py | main.py | py | 3,056 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "analysis.load_subset_data",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "analysis.define_meta_class",
"line_number": 25,
"usage_type": "argument"
},
{
"api_name": "vizualisation.color_map",
"line_number": 31,
"usage_type": "call"
},
{
"... |
36085301774 | import bs4
import requests
import pandas as pd
import re
import warnings
warnings.filterwarnings('ignore')
def get_page(url):
headers = {
'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/106.0.0.0 Safari/537.36"}
... | MECAI2022/short_text_classification | webscraping.py | webscraping.py | py | 1,538 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv... |
32829514166 | # 문제 풀이 실패
# 모범 답안
from collections import deque
n, m = map(int, input().split())
graph = [list(map(int, input())) for _ in range(n)]
# 이동할 네 방향 정의
dx = [-1, 1, 0, 0]
dy = [0, 0, -1, 1]
# BFS 구현
def bfs(x, y):
# queue 구현
queue = deque()
queue.append((x, y))
# queue가 빌 때까지 반복
while queue:
... | veluminous/CodingTest | [이것이 코딩테스트다] 실전 문제/[BFS] 미로 탈출.py | [BFS] 미로 탈출.py | py | 1,067 | python | ko | code | 0 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 17,
"usage_type": "call"
}
] |
34344785626 | import pika
connection = pika.BlockingConnection(
pika.ConnectionParameters(host='localhost'))
channel = connection.channel()
channel.exchange_declare(
exchange='publish',
exchange_type='fanout'
)
result = channel.queue_declare(
queue='',
exclusive=True
)
queue_name = result.method.queue
chann... | drupadh-eunimart/my_projects | RabbitMQ/PublishFanout/consumer.py | consumer.py | py | 628 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pika.BlockingConnection",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pika.ConnectionParameters",
"line_number": 4,
"usage_type": "call"
}
] |
15870414551 | from typing import List, Union, Tuple
from functools import reduce
from rdkit import Chem
import torch
import torch.nn as nn
from .args import ModelArgs
from .features import BatchMolGraph, get_atom_fdim, get_bond_fdim, mol2graph
from .nn_utils import index_select_ND, get_activation_function
class MPNEncoder(nn.Mod... | gmum/graph-representations | graphrepr/chemprop/mpn.py | mpn.py | py | 8,069 | python | en | code | 18 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "args.ModelArgs",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "args.atom_messages",
... |
73578540903 | # coding: utf-8
_all_ = [ ]
import os
from pathlib import Path
import sys
parent_dir = os.path.abspath(__file__ + 2 * '/..')
sys.path.insert(0, parent_dir)
from dash import Dash, dcc, html, Input, Output, State, ctx
from dash.exceptions import PreventUpdate
import argparse
import numpy as np
import pandas as pd
imp... | bfonta/bye_splits | bye_splits/plot/display_plotly/main.py | main.py | py | 4,073 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "os.path.abspath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.path.insert",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number... |
12536549602 | from datetime import datetime
from .models import Employee, Shift
import pulp
def save_shifts_to_database(prob, x, u, dienstplan, employee_id_to_idx):
num_hours_per_day = len(x)
num_days = len(x[0])
num_employees = len(x[0][0])
for h in range(num_hours_per_day):
for d in range(num_days):
... | reneHoellmueller/Algo_schedule | app/schedule/save_shifts_to_database.py | save_shifts_to_database.py | py | 1,300 | python | de | code | 0 | github-code | 36 | [
{
"api_name": "pulp.value",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "models.Employee.objects.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "models.Employee.objects",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "m... |
11166510919 | #! /usr/bin/env python
# prototype / test - for parsing commands from CLI
# basics: ArgumentParser
# https://docs.python.org/3/howto/argparse.html
#
# ArgumentParser - docs
# https://docs.python.org/3/library/argparse.html#type
# taking had written help like this and generating help using ArgumentParser (Python stdLi... | UnacceptableBehaviour/movie_picker | scripts/cli_parse.py | cli_parse.py | py | 7,173 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"line_number": 136,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"line_number": 137,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",... |
16935982634 | from enum import unique
from flask import Flask, jsonify, request, render_template
from flask_sqlalchemy import SQLAlchemy
import json
app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///students.sqlite"
db = SQLAlchemy(app)
class students(db.Model):
id = db.Column(db.Integer, unique=True, p... | Ernest0G/Grader | grader.py | grader.py | py | 3,221 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask.jso... |
11565125878 |
import keras
import morse
import numpy as np
import cwmodel
checkpoint_fn = "weights_detect.h5"
try:
from google.colab import drive
drive.mount('/content/drive')
checkpoint_fn = '/content/drive/MyDrive/Colab Notebooks/' + checkpoint_fn
except:
print("Couldn't mount Google Colab Drive")
model = cwmod... | sehugg/cwkeras | train_detect.py | train_detect.py | py | 1,183 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "google.colab.drive.mount",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "google.colab.drive",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "cwmodel.make_model",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "keras.... |
30922847459 | from pylatex import Document, Section, Figure, SubFigure, Command, Subsection, Package, NoEscape
class PdfGenerator:
def __init__(self, directory, name):
geometry_options = {"right": "1cm", "left": "1cm", "top": "1cm", "bottom": "1cm"}
self.doc = Document("{}/{}-Report".format(directory, name), g... | bgreni/Set_Data_Report | PdfGenerator.py | PdfGenerator.py | py | 4,903 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pylatex.Document",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pylatex.Command",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pylatex.Command",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pylatex.Command",
... |
74248266663 | import argparse
import sys
import nested_diff
import nested_diff.cli
class App(nested_diff.cli.App):
"""Diff tool for nested data structures."""
supported_ofmts = ('auto', 'html', 'json', 'term', 'toml', 'text', 'yaml')
def diff(self, a, b):
"""
Return diff for passed objects.
... | grafviz/hatvp-json | modif_nested_diff/diff_tool.py | diff_tool.py | py | 4,955 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "nested_diff.cli",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "nested_diff.diff",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "argparse.FileTyp... |
11828562957 | # -*- coding: utf-8 -*-
"""
Created on Sat Oct 21 10:41:14 2017
@author: Juan Antonio Barragán Noguera
@email: jabarragann@unal.edu.co
"""
import matplotlib.pyplot as plt
import numpy as np
FS=8000
TS=1/FS
f=1500
x=np.arange(0,200)
y=np.sin(2*np.pi*f*TS*x)
plt.stem(x,y)
| jabarragann/DiscretSignalsUnal | temp.py | temp.py | py | 283 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.arange",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.stem",
"li... |
10955703754 | from datetime import datetime, timedelta
from itertools import islice, tee, izip
from django.conf import settings
from django.db import models
# output log if difference in traffic is less than than TRAFFIC_DELTA_MIN
TRAFFIC_DELTA_MIN = 1000.0
SLIDING_WINDOW_LEN = 4
LINK_ALIVE_INTERVAL = getattr(settings, 'GMAP_LINK_A... | shakirjames/ndnmap | gmap/models.py | models.py | py | 3,287 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "django.conf.settings",
"line_number": 9,
"usage_type": "argument"
},
{
"api_name": "django.db.models.Manager",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 12,
"usage_type": "name"
},
{
"api_name":... |
18363762101 | from Bio import SeqIO, Entrez
from Bio.SeqFeature import FeatureLocation
import json, os, doctest
Entrez.email = "fayssal.el.ansari@gmail.com"
# TODO: faut modifier cette fonction pour accepter
# une seqRecord avec plusieurs sequences
def find_cds(seqRecord): #marche
'''Renvoie une liste des couples de positions ... | fayssalElAnsari/Bioinformatics-python-sequence-analyser | app/src/utilsTest.py | utilsTest.py | py | 6,111 | python | fr | code | 0 | github-code | 36 | [
{
"api_name": "Bio.Entrez.email",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "Bio.Entrez",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "Bio.Entrez.elink",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "Bio.Entrez",
"lin... |
3745949617 | # pylint: disable=C0413
# Standard Library
import logging
import os
import urllib
# Third Party
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
# First Party
from resc_backend.db.model import Base
basedir = os.path.abspath(os.path.dirname(__file__))
logger = logging.getLogger(__name__)
... | abnamro/repository-scanner | components/resc-backend/src/resc_backend/db/connection.py | connection.py | py | 1,725 | python | en | code | 137 | github-code | 36 | [
{
"api_name": "os.path.abspath",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
... |
7110168618 | from django.shortcuts import render, get_object_or_404
from django.views import generic
from django.contrib.auth.models import User
from django.dispatch import receiver
from django.db.models.signals import post_save
from CodeConfab.models import Profile, Language,Post,FriendRequest,Poke, Prompt,Resources,Comment,Reply
... | Tekkieware/CodeConfab | CodeConfab/views.py | views.py | py | 10,814 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "CodeConfab.models.Post.objects.filter",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "CodeConfab.models.Post.objects",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "CodeConfab.models.Post",
"line_number": 23,
"usage_type": "name... |
37005491530 | import pytest
import re
from itertools import chain
from pathlib import Path
from sphinx.application import Sphinx
from sphinx.util.docutils import docutils_namespace
from sphinx.testing.restructuredtext import parse as sphinx_parse
from .diffpdf import diff_pdf
from .pdf_linkchecker import check_pdf_links
from .uti... | Chris-Jr-Williams/rinohtype | tests_regression/helpers/regression.py | regression.py | py | 5,470 | python | en | code | null | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "rinoh.template.DocumentTemplate",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "rinoh.attribute.OverrideDefault",
"line_number": 30,
"usage_type": "call"
},
{
"api_... |
28431033139 | # -*- coding: utf-8 -*-
from __future__ import print_function
import time
import pygame
import OpenGL.GL as gl
import OpenGL.GLU as glu
import numpy as np
import itertools
import fractions
import copy
import numpy as np
#local imports
from common import COLORS, DEBUG, VSYNC_PATCH_HEIGHT_DEFAULT, VSYNC_PATCH_WIDTH_DE... | SridharLab/neurodot-present | neurodot_present/triple_checkerboard_flasher.py | triple_checkerboard_flasher.py | py | 8,015 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "screen.Screen",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "common.DEFAULT_FLASH_RATE",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "common.DEFAULT_FLASH_RATE",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "com... |
35553846638 | from datetime import datetime
from turtle import position
from urllib.error import HTTPError
from td.client import TdAmeritradeClient
from td.rest.options_chain import OptionsChain
from Authenticator import TDAuthenticator
from time import sleep
class TDPosition():
def __init__(self, position_dict : dict):
... | gatordevin/TradingBot | v3/TD.py | TD.py | py | 19,700 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "datetime.da... |
70190136745 | import re
from datetime import datetime
from bs4 import BeautifulSoup
from ..utils.http import wget
from ..utils.data import DataEngine
from dateutil import parser, tz
class Engine(object):
"""
Engine to process: https://www.letmeread.net
"""
__host__ = 'letmeread'
baseurl: str = "https://www.letm... | maborak/ebooks-dl | ebooksdl/engines/letmeread.py | letmeread.py | py | 6,996 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "utils.data.DataEngine",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "utils.http.wget",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "dateutil.pars... |
7438959251 | # -*- coding: utf-8 -*-
import random
#Libreria random
#librerias web scraping
from os import remove
import os, ssl
import urllib.request
from bs4 import BeautifulSoup
#librerias para descargar y guardar imagenes
#Para hacerlo sin certificaciones
import os, ssl
#Descargar imagen
import requests
#Mover ar... | eduardo-trejo-es/RecoleccionNotas_CronicaReg | old_App/Notas automatico a correo terminal final.py | Notas automatico a correo terminal final.py | py | 6,587 | python | es | code | 0 | github-code | 36 | [
{
"api_name": "os.environ.get",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "ssl._create_default_https_context",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": ... |
1606737974 | from http.server import BaseHTTPRequestHandler
import json
import os
import shutil
import logging
import pytest
import requests
from pytest_httpserver import HTTPServer
from sunfish.lib.core import Core
from sunfish.lib.exceptions import *
from tests import test_utils, tests_template
class TestSunfishcoreLibrary():
... | OpenFabrics/sunfish_library_reference | tests/test_sunfishcore_library.py | test_sunfishcore_library.py | py | 4,902 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "shutil.rmtree",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number"... |
29013033469 | from fastapi import WebSocket
from app.settings import SETTINGS
from app.websocket.exceptions import OnlineLimitException
from app.websocket.classes import OnlineUser
class OnlineUsersConnectionManager:
def __init__(self):
self.online_users: list[OnlineUser] = []
def add(self, online_user: OnlineUse... | mrdudov/tic-tac-toe | backend/app/websocket/connect_manager.py | connect_manager.py | py | 1,335 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "app.websocket.classes.OnlineUser",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "app.websocket.classes.OnlineUser",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "app.settings.SETTINGS.max_online_users",
"line_number": 13,
"usage_type... |
39562384945 | # Author: Zavier
import json
import random
import matplotlib.pyplot as plt
import numpy as np
import requests
import pandas as pd
import calendar
import datetime
from geopy.distance import geodesic
import geopy as gp
from app import *
from sklearn.linear_model import LinearRegression,Ridge,RidgeCV
from sklearn.prepr... | zavier250/ambulance_data_visualization | analysis.py | analysis.py | py | 12,820 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.bar",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "matplo... |
28891356701 | """Utilities for dealing with project configuration."""
import abc
import configparser
from typing import Iterable, Tuple, Type, TypeVar
from pytype.platform_utils import path_utils
import toml
_CONFIG_FILENAMES = ('pyproject.toml', 'setup.cfg')
_ConfigSectionT = TypeVar('_ConfigSectionT', bound='ConfigSection')
... | google/pytype | pytype/tools/config.py | config.py | py | 2,353 | python | en | code | 4,405 | github-code | 36 | [
{
"api_name": "typing.TypeVar",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pytype.platform_utils.path_utils.isdir",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pytype.platform_utils.path_utils",
"line_number": 19,
"usage_type": "name"
},
{... |
31608719442 | import math
from functools import partial
from collections import defaultdict
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from . import torchvision_models
from .torchvision_models import load_pretrained, inflate_pretrained, modify_resnets
from network.non_loca... | Forrest0503/VAT-ABAW | network/resnet3D.py | resnet3D.py | py | 20,933 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv3d",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
20764888384 | from bs4 import BeautifulSoup
import csv
with open("carviewer2.html") as fp:
soup = BeautifulSoup(fp, 'html.parser')
employee_file = open('week02data.csv', mode='w')
employee_writer = csv.writer(employee_file, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
rows = soup.findAll("tr")
#print(ro... | eamonnofarrell/dataRepresentation | week03-webScraping/PY05-readFileFinal.py | PY05-readFileFinal.py | py | 602 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "csv.QUOTE_MINIMAL",
"line_number": 8,
"usage_type": "attribute"
}
] |
10035777489 | import numpy as np
from sklearn.model_selection import StratifiedKFold, GridSearchCV
from sklearn.metrics import roc_auc_score
from sklearn import preprocessing
def runTuneTest(learner, parameters, X, y):
"""
This method takes in a learning algorithm, the possible settings you would use for the algorithm and t... | ameetsoni/CompBioNSF-Module | soln/geneMLLib.py | geneMLLib.py | py | 3,118 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "sklearn.model_selection.StratifiedKFold",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.GridSearchCV",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.argsort",
"line_number": 45,
"usage_type": "call"
},... |
1224550679 | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 18 23:04:53 2018
@author: Carla Pastor
Project: Heat Distribution.
"""
import numpy as np
import matplotlib.pyplot as lb
from matplotlib.colors import ListedColormap
if __name__ == "__main__":
inp=int(input("Enter the starting temperature: "))
... | carlaoutput/matplotlib | heatDistribution.py | heatDistribution.py | py | 2,384 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.zeros",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.copy",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.array_equal",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.copy",
"line_numbe... |
16371835834 | from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
from airflow.hooks.postgres_hook import PostgresHook
from warnings import warn
class CheckFutureYearsOperator(BaseOperator):
"""
Checks number of observations in Postgres table with a year in the future
:param... | davidrubinger/political-contributions-canada | plugins/operators/check_future_years_operator.py | check_future_years_operator.py | py | 1,496 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "airflow.models.BaseOperator",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "airflow.utils.decorators.apply_defaults",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "airflow.hooks.postgres_hook.PostgresHook",
"line_number": 29,
"usage_t... |
34955184359 |
import os
import gspread
from gplus import ClientPlus
from datetime import datetime
from oauth2client.service_account import ServiceAccountCredentials
from flask import Flask, render_template
application = Flask(__name__, static_url_path='/static')
CURRENT_DIR = os.... | CrabbyPete/coastalflyrodders | main.py | main.py | py | 2,877 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line... |
73574130983 | import torch
import torch.nn as nn
import torch.nn.functional as F
class discrete_policy_net(nn.Module):
def __init__(self, input_dim, output_dim, hidden_dim=128):
super(discrete_policy_net, self).__init__()
self.input_dim = input_dim
self.output_dim = output_dim
self.hid... | deligentfool/MAAC_pytorch | policy.py | policy.py | py | 1,529 | 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": "torch.nn.Linear",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
27515709525 | from discord import Embed
from discord.ext import commands
import discord
class ModerationCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(aliases=['удалить'])
@commands.has_role('Админ')
async def clear(self, ctx, amount: int = None):
await ctx.message.del... | RuCybernetic/CyberTyanBot | cogs/commands/moderation.py | moderation.py | py | 4,910 | python | ru | code | 1 | github-code | 36 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "discord.Embed",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "discor... |
35866755353 | import subprocess
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Запуск парсера офисных документов."
def handle(self, *args, **options):
run_parser = subprocess.getoutput(
f'poetry run parser -r -p {settings.RESOUR... | Studio-Yandex-Practicum/adaptive_hockey_federation | adaptive_hockey_federation/core/management/commands/fill-db.py | fill-db.py | py | 574 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "subprocess.getoutput",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.RESOURSES_ROOT",
"line_number": 12,
"usage_type": "attri... |
36723052286 | from django.template import loader, RequestContext
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound, Http404
from django.conf import settings
from django.utils.safestring import mark_safe
from django.contrib.auth.views import redirect_to_login
from django import forms
from django.views.g... | stevecassidy/signbank-pages | pages/views.py | views.py | py | 4,101 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.conf.settings.APPEND_SLASH",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "django.http.HttpResponseRedirect",
"line_number": 29,
"usage_type": "call"
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.