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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10721608630 | from typing import Any
import click
from edgy.cli.base import downgrade as _downgrade
from edgy.cli.env import MigrationEnv
@click.option(
"-d",
"--directory",
default=None,
help=('Migration script directory (default is "migrations")'),
)
@click.option(
"--sql", is_flag=True, help=("Don't emit S... | tarsil/edgy | edgy/cli/operations/downgrade.py | downgrade.py | py | 873 | python | en | code | 33 | github-code | 21 | [
{
"api_name": "edgy.cli.env.MigrationEnv",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "edgy.cli.base.downgrade",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "click.op... |
7996808102 | import csv
from io import StringIO
from typing import Dict, Union
from Mark.models import MarkingTask
from Mark.services import marking_priority
class TaskOrderService:
"""Class for handling task ordering."""
def update_priority_ordering(
self,
order: str,
*,
custom_order: Un... | plomgrading/plom | plom_server/TaskOrder/services/task_ordering_service.py | task_ordering_service.py | py | 2,500 | python | en | code | 10 | github-code | 21 | [
{
"api_name": "typing.Union",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "Mark.services.marking_priority.set_marking_piority_shuffle",
"line_number": 20,
"usage_type": "call"
},
{
... |
22806839902 | from flask_app.config.mysqlconnection import connectToMySQL
from flask import flash
class Reply:
db = 'userCommentReply'
def __init__(self, data):
self.id = data['id']
self.reply = data['reply']
self.replyer_id = data['replyer_id']
self.comment_id = data['comment_id']
... | Python-InstructorMelissa/SepDec2023-FlexPython | lectures/week13/day2/flask_app/models/reply_model.py | reply_model.py | py | 1,896 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "flask_app.config.mysqlconnection.connectToMySQL",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask_app.config.mysqlconnection.connectToMySQL",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "flask_app.config.mysqlconnection.connectToMySQL",... |
41387471524 | #!/usr/bin/env python -u
"""
Example basic VIO interaction.
- Inject ssh pub key
- Download QCOW image from internet
- Convert image to VMDK
- Patch it if it corrupted
- Upload image to a glance
- Create new instance in default availability zone
- Attach nic to external network
- Gets a list flavor from VIO... | spyroot/trex-automation | vio/openstack_vio.py | openstack_vio.py | py | 12,616 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "urllib3.disable_warnings",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.path.environ.get",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "os.path.environ",
"line_number": 71,
"usage_type": "attribute"
},
{
"api_name": "os.... |
39549230349 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from django import forms
from django.core.urlresolvers import reverse
from django.conf import settings
from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from django.db.models import Sum, DateTimeField
from django.template import C... | kaleidos/intranet | backend/intranet/admin.py | admin.py | py | 13,291 | python | en | code | 15 | github-code | 21 | [
{
"api_name": "django.contrib.admin.StackedInline",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "intranet.models.Assignation",
"line_number": 34,
"usage_type": "name"
},
... |
33249885363 | from loguru import logger
# from asyncio import Lock
# from typing import Optional
# from xmlrpc.client import Boolean
# from graia.saya import Channel
# from collections import defaultdict
from typing import DefaultDict, Set, Tuple, Union
# from graia.ariadne.model import Member, MemberPerm, Group
# from graia.broadca... | mikezom/bigbedbot-py | libs/helper/info.py | info.py | py | 4,040 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "enum.Enum",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "dataclasses.dat... |
37128093240 | '''
Compute pi using Monte Carlo integration with uniform variants on the 1-D domain [0,1]
Cameron F Abrams cfa22@drexel.edu
Run using
/usr/bin/python3 /home/cfa/cheT580-202035/instructional-codes/originals/pi_integration.py 1000000 100
where first argument is the number of samples and the second is the number of tri... | Abrams-Teaching/instructional-codes | originals/pi_integration.py | pi_integration.py | py | 1,514 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.sqrt",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "random.random",
"line_numb... |
2778313009 | import time
import jwt
from fastapi import Request, HTTPException
from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer
from configs import JWT_SECRET, JWT_ALGORITHM, JWT_COOKIE
JWT_LIFETIME = 60*60*24 # seconds
def generate_jwt_token(data: dict) -> str:
return jwt.encode(data, JWT_SECRET, algo... | Charl1996/churchlife | app/security/auth.py | auth.py | py | 2,393 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "jwt.encode",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "configs.JWT_SECRET",
"line_number": 12,
"usage_type": "argument"
},
{
"api_name": "configs.JWT_ALGORITHM",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "jwt.decode",
... |
8035764763 | from tkinter import *
from tkinter.ttk import Combobox
from pytube import YouTube
FONT_NAME = "Edu VIC WA NT Beginner"
BACKGROUND_COLOR = "#FAD9A1"
FOREGROUND_COLOR = "#BD4B4B"
QUALITY_LIST = ["144p", "240p", "360p", "480p", "720p", "1080p"]
DOWNLOAD_DIRECTORY = 'C:/Users/User/Downloads'
def get_video_u... | SaherMuhamed/YouTube-Downloader | main.py | main.py | py | 4,780 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "pytube.YouTube",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tkinter.ttk.Combobox",
"line_number": 115,
"usage_type": "call"
}
] |
19132334877 | from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('mysite.views',
url(r'^$', 'index'),
url(r'^client/', 'client... | walkerjeffd/phd-wirm-server | mysite/mysite/urls.py | urls.py | py | 667 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.patterns",
"line_number": 8,
"usage_type": "call"
},
{
"api... |
31937961512 | # coding: utf-8
# !/usr/bin/env python3
import numpy as np
from gensim.models import Word2Vec
from .base_embedding import BaseEmbedding
class Word2VecEventEmbedder(BaseEmbedding):
def __init__(self, sentences = [], embedding_size = 64, window_size = 20, workers_number = 1, nb_epoch = 100, method =... | dbouchabou/SmartHomeHARLib | SmartHomeHARLib/embedding/word2vec.py | word2vec.py | py | 4,586 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "base_embedding.BaseEmbedding",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "gensim.models.Word2Vec",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "numpy... |
42848058053 | import abc
import dataclasses
from typing import Any
import httpx
@dataclasses.dataclass
class Request:
method: str
url: str
data: Any
class Response(abc.ABC):
@abc.abstractmethod
def raise_for_status(self) -> None:
raise NotImplementedError
@abc.abstractmethod
def content(self... | PeterD1524/ntu-css | ntu_css/http.py | http.py | py | 1,734 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.Any",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "abc.ABC",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "abc.abstractmethod"... |
36122035936 | from typing import Union, Dict
import sys
import traceback
from src.coin_machine import dispense_count, dispense_odd_count, NWays
__author__ = "Usman Ahmad"
__version__ = "1.0.1"
DOCS = __doc__
def main_coin_calc(in_amt: str,
nways_type_str: str = NWays.ODD
) -> Union[int, Dict... | polardesert/coin-machine | cmain.py | cmain.py | py | 1,959 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "src.coin_machine.NWays.ODD",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "src.coin_machine.NWays",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "src.coin_machine.NWays",
"line_number": 22,
"usage_type": "call"
},
{
"api... |
42360724281 | import argparse
import subprocess
from jinja2 import Environment, FileSystemLoader
def deploy(model_uri: str):
with open("/tmp/manifest.yaml", "w") as f:
env = Environment(loader=FileSystemLoader('./templates'),
trim_blocks=True, lstrip_blocks=True)
template = env.get_te... | canonical/kubeflow-examples | e2e-wine-kfp-mlflow/components/deploy/src/deploy.py | deploy.py | py | 831 | python | en | code | 23 | github-code | 21 | [
{
"api_name": "jinja2.Environment",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "jinja2.FileSystemLoader",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "subprocess.call",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "argparse.Arg... |
29449789611 | import requests
from selenium import webdriver
from lxml import etree
import json
import redis
url = "https://www.zhipin.com/"
def creat_url():
driver = webdriver.Chrome()
driver.get(url=url)
html_tree = etree.HTML(driver.page_source)
city_list = html_tree.xpath("//div[@class='dorp... | 18670775011/BossSpider | BossSpider/spiders/get_url.py | get_url.py | py | 827 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "lxml.etree.HTML",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "lxml.etr... |
23723750526 | import unittest
import doctest
import trytond.tests.test_tryton
from trytond.tests.test_tryton import ModuleTestCase
from trytond.tests.test_tryton import doctest_setup, doctest_teardown
from trytond.tests.test_tryton import doctest_checker
from trytond.modules.carrier_send_shipments_seur.tools import set_seur_referenc... | NaN-tic/trytond-carrier_send_shipments_seur | tests/test_carrier_send_shipments_seur.py | test_carrier_send_shipments_seur.py | py | 1,671 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "trytond.tests.test_tryton.ModuleTestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "trytond.modules.carrier_send_shipments_seur.tools.set_seur_reference",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "trytond.modules.carrier_send_shipme... |
74036402291 | import requests
import urllib3
from bs4 import BeautifulSoup
import re
import pandas as pd
import csv
#urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
def get_url(seminar):
positions_begin = seminar.find("href=")
positions_end = seminar.find("page.htm")
ret = seminar[(positions_begin +... | cschenshuo8/Academic_lecture_information_website | 技术细节/爬虫源码/华南农业大学/Web.py | Web.py | py | 1,427 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 42,
"usage_type": "call"
}
] |
26095025965 | import json
import os
import numpy as np
from keras.layers import Conv2D, Dense, Dropout, Flatten, MaxPooling2D
from sklearn.metrics import (accuracy_score, classification_report,
confusion_matrix, f1_score, precision_score,
recall_score)
from tensorflow import... | LWaetzig/Data-Exploration | src/Model.py | Model.py | py | 6,503 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tensorflow.keras.Sequential",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "keras.layers.Conv2D",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "kera... |
20781993513 | # code is adapted from
# https://github.com/xternalz/WideResNet-pytorch/blob/master/wideresnet.py
# in https://github.com/AhmadQasim/FixMatch/blob/master/models/wideresnet.py
######## difference
# ###### self.relu: ReLU --> LeakyReLU(negative_slope=0.1, inplace=True) --> mish
# def mish(x):
# """Mish: A Self Regul... | Celiali/FixMatch | models/wideresnet.py | wideresnet.py | py | 5,535 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "torch.nn.BatchNorm2d",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"li... |
37789515822 | from typing import Optional
import cv2
import imutils
from chimerapy.engine import DataChunk, Node
from chimerapy.orchestrator import source_node
@source_node(name="GSDCP_DroidCam")
class DroidCam(Node):
def __init__(
self,
phone_ip: str,
droidcam_port: int = 4747,
frame_key: str ... | oele-isis-vanderbilt/GSDCP | gsdcp/droidcam_node.py | droidcam_node.py | py | 1,884 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "chimerapy.engine.Node",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "chimerapy.engi... |
4627994843 | """Currently this script tests `chainerrl.wrappers.atari_wrappers.FrameStack`
only."""
import unittest
from unittest import mock
from chainer import testing
import gym
import gym.spaces
import numpy as np
from chainerrl.wrappers.atari_wrappers import FrameStack
from chainerrl.wrappers.atari_wrappers import LazyFram... | chainer/chainerrl | tests/wrappers_tests/test_atari_wrappers.py | test_atari_wrappers.py | py | 5,581 | python | en | code | 1,134 | github-code | 21 | [
{
"api_name": "unittest.TestCase",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "unittest.mock.Mock",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "unittest.mock",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "numpy.random.... |
37341493552 | from fastapi import APIRouter
from libs.email_lib import Email
from models.result import Result
from os import getenv
router = APIRouter()
# Test email
@router.get('/emails', status_code = 200)
def test_email() -> Result:
try:
Email().send_test_email()
return Result(
Result.SUCCESS,
... | shippedbrain/shipped-brain-backend | api/src/routers/health_checks.py | health_checks.py | py | 566 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "libs.email_lib.Email",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.result.Result",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "models.res... |
70130358134 | from rest_framework import viewsets
from rest_framework.response import Response
from tyadmin_api.custom import XadminViewSet
from django.contrib.auth.models import Permission, Group
from django.contrib.contenttypes.models import ContentType
from api.models import User, Zones, Customers, Agendas, ArchiveBodyData, Bills... | zrpxx/gymGo | demos/tyadmin_demo_init/tyadmin_api/auto_views.py | auto_views.py | py | 10,058 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tyadmin_api.custom.XadminViewSet",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "tyadmin_api.auto_serializers.PermissionListSerializer",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.models.Permission.objects.all",
"l... |
21616506745 | """
Representation of a decision made for an applicant by ubc admissions
"""
from dataclasses import dataclass
from datetime import datetime
from typing import Optional
import discord
from Campus import Campus
from Decision import Decision
from UBCProgram import UBCProgram
@dataclass
class ApplicantDecision():
... | RandoNandoz/ubc-decisons-bot | src/ApplicantDecision.py | ApplicantDecision.py | py | 2,171 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "Campus.Campus",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "UBCProgram.UBCProgram",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "Decision.Decision",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "datetime.dateti... |
20252504591 | # Django specific modules
from django import forms
from django.forms import ValidationError
from django.forms import models
from django.forms.fields import MultipleChoiceField
from django.contrib.auth.models import User
from django.utils import timezone
# Project specific modules/models
from .models import CustomSet
f... | alfarhanzahedi/chefsarena | core/forms.py | forms.py | py | 6,757 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "django.forms.Form",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.forms.DateTimeField",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django... |
4975394804 | from typing import Tuple, List
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
def box_strip_plot(df,
x: str,
y: str,
hue: str = None,
max_line: int = None,
title: str = None,
h... | fraunhofer-iais/quantum_subset_sum | src/quantum_subset_sum/utils/plots.py | plots.py | py | 1,533 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot... |
35753473657 | # import nltk
# from nltk import data
# from nltk.tokenize import word_tokenize
# from nltk.stem import PorterStemmer, WordNetLemmatizer
# from nltk.corpus import stopwords
# import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# import json
# nltk.download('wordnet')
# nltk.download('punkt')
# nltk.... | tobiassc95/Machine-Learning-With-SNLI-Dataset | PYNB Project/TP1.py | TP1.py | py | 7,328 | python | es | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_json",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "pandas.read_json",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.text.CountVectorizer",
"line_number": 66,
"usage_type": "call"
},
{
... |
12532436010 | import numpy as np
from tensorflow.python.keras.models import Sequential, load_model
from tensorflow.python.keras.layers import Dense
from sklearn.model_selection import train_test_split
from sklearn.datasets import load_boston
from sklearn.metrics import r2_score
from sklearn.preprocessing import MinMaxScaler, MaxAbsS... | SuperMindu/study | keras/keras23 save_load/keras23_6_load_weights.py | keras23_6_load_weights.py | py | 2,949 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.font_manager.FontProperties",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.font_manager",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "matplotlib.rc",
"line_number": 15,
"usage_type": "call"
},
{
"api_... |
45617934905 | import torch
from torch import nn
import torch.nn.functional as f
import time
import os
from datetime import timedelta
from .scale_utils import Accumulator, accuracy
def create_lr_scheduler(optimizer, num_step: int, epochs: int, warmup=True, warmup_epochs=1, warmup_factor=1e-3):
assert num_step > 0 and epochs > 0... | kaddly/NaturalLanguageProcessing | PreTrain/RoBERTa/train_utils/train_eval.py | train_eval.py | py | 6,210 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.optim.lr_scheduler.LambdaLR",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torch.optim",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.functional",
"line_number": 29,
"usage_type": "name"
},
{
"api_name":... |
8427003664 | import numpy as np
import matplotlib.pyplot as plt
def f1(x,y):return (-10)
def f2(x,z):return (z)
h=0.001
a=0
b=10
A=40
B=60
z0=np.linspace(A,B,B-A+1)
y0=0
n=int((b-a)/h)
x=np.linspace(a,b,n+1)
z=np.zeros((z0.size,x.size))
for i in range(len(z0)):
z1=[]
z1.append(z0[i]... | ZAHID-8017/Comp_Ass2 | Zahid_ass2_pb5.py | Zahid_ass2_pb5.py | py | 960 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.linspace",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_num... |
36310400581 | # -*- coding: utf-8 -*-
"""
Created on Sat Sep 14 13:24:41 2019
@author: Liu
"""
import glob, os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import ticker
import pandas as pd
import math
from scipy import signal
data3d=np.zeros((200,2,1000))
data2d=np.zeros((200,2))
os.chdir(r'C:/Users/ma... | Liutech27/Space-Physics | PROBA2plots.py | PROBA2plots.py | py | 3,003 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.zeros",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 24,
... |
13346747350 | from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.common.exceptions import NoSuchElementException
import time
import pandas as pd
import re
import numpy as np
# --| Setup
class ParserDiodes:
def __init__(self):
self.options = Options()
self.define_... | jularina/CompetitorsAmpl1 | diodes_scraper.py | diodes_scraper.py | py | 3,426 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 16,
"usage_type": "name"
},
{... |
37058411398 | #!/usr/bin/python3
"""Almost cycle Alx learnirng project"""
import json
import csv
import turtle
class Base:
"""
base class for the upcoming project...
"""
__nb_objects = 0
def __init__(self, id=None):
if id is not None:
self.id = id
if id is None:
Base.__... | G-omar-H/alx-higher_level_programming | 0x0C-python-almost_a_circle/models/base.py | base.py | py | 5,589 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "json.dumps",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "csv.DictWriter",
"line_number": 119,
"usage_type": "call"
},
{
"api_name": "csv.DictReader",
"line_numb... |
73036492853 | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases()
from collections import deque
import random
import numpy as np
impor... | LiuFang816/SALSTM_py_data | python/pfnet_chainerrl/chainerrl-master/chainerrl/replay_buffer.py | replay_buffer.py | py | 6,990 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "future.standard_library.install_aliases",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "future.standard_library",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "collections.deque",
"line_number": 20,
"usage_type": "call"
},
{
"a... |
42372334236 | import pwn
elf = pwn.ELF("./bof102")
p = elf.process()
pwn.context.log_level="DEBUG"
pr = pwn.remote("bof102.sstf.site", 1337)
system_addr = elf.symbols['system']
pr.recvuntil(b"Name > ")
pr.sendline("/bin/sh\x00") # Putting /bin/sh to global variable name in scanf("%16s", name);
pr.recvuntil(b" > ")
... | olegunza/SSTF2023 | PWN/BOF102/bof102_solve.py | bof102_solve.py | py | 690 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pwn.ELF",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pwn.context",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pwn.remote",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pwn.p32",
"line_number": 17,
... |
6022374997 | from jinja2 import environment
from flask import Flask, render_template, request
import requests
import json
app = Flask(__name__)
@app.route('/')
def entry_page():
return render_template('entry.html', the_title='Pincode_data')
@app.route('/pincode', methods=['POST'])
def check_for_dnd():
"""
Returns the... | akgnitd/PINCODE_details | pincode.py | pincode.py | py | 788 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "flask.reques... |
35273273686 | from datetime import datetime
from os import listdir
from bank import Bank
import sys
import unittest
banks = dict()
data_location = "data/"
"""
Gets and validates input from user, ensuring input is a numerical
value, then returns input.
"""
def get_and_validate_currency_input(name):
entry = None
while entry... | 2105-may24-devops/sam-project0 | manager.py | manager.py | py | 12,891 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 53,
"usage_type": "name"
},
{
"api_name": "bank.Bank",
"line_number": 110,
"usage_type": "call"
},
{
"api_name": "bank.Bank",
... |
70309710454 | # pylint: disable=too-many-lines, too-many-function-args, redefined-outer-name
"""Diagnostic functions for ArviZ."""
import warnings
from collections.abc import Sequence
import numpy as np
import packaging
import pandas as pd
import scipy
from scipy import stats
from ..data import convert_to_dataset
from ..utils impo... | arviz-devs/arviz | arviz/stats/diagnostics.py | diagnostics.py | py | 32,269 | python | en | code | 1,461 | github-code | 21 | [
{
"api_name": "numpy.ndarray",
"line_number": 64,
"usage_type": "attribute"
},
{
"api_name": "data.convert_to_dataset",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "numpy.ndarray",
"line_number": 195,
"usage_type": "attribute"
},
{
"api_name": "numpy.... |
70196149814 | from app import app
from flask import make_response, jsonify, request
import io
import soundfile as sf
import torch
import numpy as np
from models import model, predict_label
class AppConfig:
PORT = 3001
DEBUG = False
@app.route('/classify', methods=["POST"])
def classify_audio():
data = {"su... | CrispenGari/animal-sound-classification | server/api/app.py | app.py | py | 1,370 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "flask.request.method",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "flask.request.files.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask... |
13371845051 | r"""
Layer-Wise Attention Mechanism
================================
Computes a parameterised scalar mixture of N tensors,
`mixture = gamma * sum(s_k * tensor_k)`
where `s = softmax(w)`, with `w` and `gamma` scalar parameters.
If `layer_norm=True` then apply layer normalization.
If `dropout > 0`... | Unbabel/COMET | comet/modules/layerwise_attention.py | layerwise_attention.py | py | 4,856 | python | en | code | 324 | github-code | 21 | [
{
"api_name": "torch.nn",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "typing.Optional",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "torch.softmax",
"line_n... |
35692719917 | # -*- coding: utf-8 -*-
__author__ = 'daniel'
from django.conf.urls import patterns, include, url
from django.contrib import admin
from groups import views
from TownHall.views import home, UserCreate
from rest_framework.urlpatterns import format_suffix_patterns
admin.autodiscover()
urlpatterns = patterns('',
... | TownHall/TownHall | TownHall/urls.py | urls.py | py | 3,019 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.patterns",
"line_number": 14,
"usage_type": "call"
},
{
"... |
72276182774 | #! /usr/bin/python
import re
import os
import sys
import json
import glob
import filecmp
import operator
class ExecutetimeReporter:
fields = ('total', 'io', 'communicate', 'compute')
expr = '#Rank(\d*): total=(\d*) nsec \(io=(\d*), comm=(\d*), comp=(\d*)\)'
world_info = 'world_size (\d+)'
fmt = '{0:30... | leVirve/Parallel-Sorting-odd-even-sort | tools/report.py | report.py | py | 2,901 | python | en | code | 8 | github-code | 21 | [
{
"api_name": "re.compile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "operator.itemgetter",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_numbe... |
30195083703 | from collections import deque
def move(x, y, dx, dy):
cnt = 0
while arr[x+dx][y+dy] != '#' and arr[x][y] != 'O':
x += dx
y += dy
cnt += 1
return x, y, cnt
def solve():
D = ((1, 0), (0, 1), (-1, 0), (0, -1))
while q:
rx, ry, bx, by, step = q.popleft()
i... | seokzin/algorithm-python | Code/Backjoon/13460-구슬 탈출 2.py | 13460-구슬 탈출 2.py | py | 1,651 | python | ko | code | 2 | github-code | 21 | [
{
"api_name": "collections.deque",
"line_number": 50,
"usage_type": "call"
}
] |
11773041032 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: Donny You(youansheng@gmail.com)
# Configer class for all hyper parameters.
import sys
import json
import os
import argparse
from pyhocon import ConfigFactory
from lib.tools.util.logger import Logger as Log
class Configer(object):
def __init__(self, args_... | donnyyou/torchcv | lib/tools/util/configer.py | configer.py | py | 3,908 | python | en | code | 2,235 | github-code | 21 | [
{
"api_name": "pyhocon.ConfigFactory.from_dict",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pyhocon.ConfigFactory",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "... |
73036040693 | import pytest
def pytest_addoption(parser):
parser.addoption("--skip-slow", action="store_true",
help="skip slow tests")
parser.addoption("--skip-network", action="store_true",
help="run network tests")
parser.addoption("--only-slow", action="store_true",
... | LiuFang816/SALSTM_py_data | python/pandas-dev_pandas/pandas-master/pandas/conftest.py | conftest.py | py | 782 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "pytest.skip",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pytest.skip",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pytest.skip",
"line_number": 21,
"usage_type": "call"
}
] |
12855087981 | import argparse
import sys
def _main():
parser = argparse.ArgumentParser()
parser.add_argument(
"-c",
"--cols",
type=int,
help="Format <cols> octets per line. Default 16 (-i: 12, -ps: 30)",
)
parser.add_argument(
"-u", "--uppercase", action="store_true", help="u... | nicktimko/xxp | src/xxp/__main__.py | __main__.py | py | 930 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.stdin.buffer.read",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "sys.exit"... |
13368049461 | # -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from logging import INFO, basicConfig, getLogger
from bugbug import db, test_scheduling
basicC... | mozilla/bugbug | scripts/redundant_failures.py | redundant_failures.py | py | 3,459 | python | en | code | 469 | github-code | 21 | [
{
"api_name": "logging.basicConfig",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bugbug.db.download... |
21194862782 | from loader import bot
from telebot.types import Message
@bot.message_handler(content_types=['text'])
def echo(message: Message) -> None:
"""
Функция реакции на сообщение, не являющееся командой.
:param message: Объект сообщения.
:type message: Message
:return: None
"""
# echo - это реак... | AlexSolokhin/FencingEventsParcingBot | handlers/echo.py | echo.py | py | 1,311 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "telebot.types.Message",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "loader.bot.send_message",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "loader.bot",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "loader.bot.me... |
16731781652 | import logging
from argparse import Namespace
from sklearn.model_selection import train_test_split
import torch
import numpy as np
from torch.utils.data import Subset, DataLoader
from cassava.transforms import get_train_transforms, get_test_transforms
from cassava.utils import DatasetFromSubset
from cassava.pipelines.... | btseytlin/kaggle_cassava | src/cassava/pipelines/train_model/nodes.py | nodes.py | py | 2,460 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cassava.transforms.get_train_transforms",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "cassava.utils.DatasetFromSubset",
"line_number": 27,
"us... |
9897430371 | #!/usr/bin/python3
'''module to define class FileStorage'''
import json
from models.base_model import BaseModel
from models.user import User
from models.place import Place
from models.state import State
from models.city import City
from models.review import Review
from models.amenity import Amenity
class FileStorage:... | abel2319/AirBnB_clone | models/engine/file_storage.py | file_storage.py | py | 2,192 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.dump",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "models.base_model.BaseModel",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "models.user.User",
... |
33816584975 | from __future__ import with_statement
import logging
from logging.config import fileConfig
from flask import current_app
from alembic import context
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config fi... | ClearKeep/ck-backend | migrations/env.py | env.py | py | 6,360 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "alembic.context.config",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "alembic.context",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "logging.config.fileConfig",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": ... |
16935979376 | import sys
import os
import re
import argparse
import numpy as np
import pandas as pd
from anndata import AnnData
import scanpy as sc
from scipy import sparse
sc.settings.verbosity = 3
sc.logging.print_header()
sc.settings.set_figure_params(dpi=80, facecolor='white')
parser = argparse.ArgumentParser()
parser.add_ar... | annacuomo/CellRegMap_analyses | neuroseq/preprocessing/pseudobulk_from_pseudocells.py | pseudobulk_from_pseudocells.py | py | 4,621 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "scanpy.settings",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "scanpy.logging.print_header",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "scanpy.logging",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "... |
37753141737 | from wsgiref.simple_server import make_server
def runserver(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/html')])
userurl = environ['PATH_INFO']
return [bytes('<h1>hello {}</h1>'.format(userurl).encode())]
httpd = make_server('', 1234, runserver)
print('Web Server is startin... | DMLTZY/python-test | test32wsgi.py | test32wsgi.py | py | 350 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "wsgiref.simple_server.make_server",
"line_number": 9,
"usage_type": "call"
}
] |
7768018219 | import re
import string
import nltk
from .preprocessing import *
from .counterHelper import *
from collections import Counter
# allow words of all size
word_size_cut = 4
# list of words that should not be in the count
#filter_list = ['a', 'the', 'of', 'to', 'is', 'for', 'it', 'and']
filter_list = []
# convert collec... | homosapien-lcy/turbo_write_app_and_database | vocabulary-database-processor-high-volume/python_utils/gramHelper.py | gramHelper.py | py | 3,084 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.Counter",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "collectio... |
12751622592 | from django.contrib.auth import get_user_model
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from user.models import Contact
User = get_user_model()
class ContactCreateSerializer(serializers.ModelSerializer):
default_error_messages = {
'email_404': _("Use... | ThePokerFaCcCe/messenger | user/serializers/contact_serializers.py | contact_serializers.py | py | 1,617 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 10,
"usage_... |
41581030477 | import pytest
from collections import Counter
import numpy as np
from sklearn.linear_model import LogisticRegression
# from scipy.spatial.distance import hamming
from termcolor import colored
from alasmc.main import ModelSelectionSMC, normal_prior_log, beta_binomial_prior_log
from alasmc.kernels import SimpleGibbsK... | antotocar34/masters_project | alasmc/tests/test_simple_inference.py | test_simple_inference.py | py | 3,527 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "numpy.concatenate",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.diag",
"line_numbe... |
37386534911 | import requests
import json
from bs4 import BeautifulSoup
import urllib
#headers = {'content-type': 'application/json',"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"}
#params = {'sessionKey': '9ebbd0b25760557393a43064a92bae539d9... | Aechee/Museum-Scrapping | test.py | test.py | py | 2,437 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.Session",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 53,
"usage_type": "call"
}
] |
38954702774 | import argparse
import os
import csv
import math
from sklearn.utils import shuffle
from sklearn.model_selection import train_test_split
import cv2
import numpy as np
import random
import matplotlib.image as mpimg
from keras.models import Model
from keras.layers import Input, Dense, Lambda, Flatten, Dropout
from ker... | guiqiong/self-driving-car | behavioral-cloning/model.py | model.py | py | 8,088 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.DataFrame",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
... |
39198352303 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 13 16:13:41 2021
@author: mohsenr
"""
import numpy as np
import os
import csv
from root_folder_list import *
def read_log(subject: str):
'''
Read the log (csv format) file from subjects behavioral responses
Parameters
----------
... | mohsenrumd/Temporal_Fric | Behavioral.py | Behavioral.py | py | 3,395 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "os.path.join",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "csv.reader",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number... |
32435372193 | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="user_Identification_System",
version="0.0.91",
author="Ayaan Imran",
author_email="miskiacuberayaan2509@gmail.com",
description="A tool to help you build a signup and log... | Ayaan-Imran/User-Indentifier-System | setup.py | setup.py | py | 727 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "setuptools.setup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 15,
"usage_type": "call"
}
] |
19604413732 | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 30 12:24:20 2021
@author: richa
"""
import yfinance as yf
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy import stats
import math
from datetime import date
#get prices from yahoo finance
tday = date.today()
tday_str = tday.strftime(... | RS1987X/Short-term-reversal | short term reversal crypto.py | short term reversal crypto.py | py | 5,792 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datetime.date.today",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "yfinance.download",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"... |
23575555741 | """
Validator functions module.
@author Monica-Maria Baluna
"""
from datetime import datetime
import json
from flask import request
HTTP_ERROR_CODE = 400
MISSING_FIELD_TEMPLATE = 'Missing field \'{}\''
INVALID_FIELD_TEMPLATE = 'Invalid data for field \'{}\''
def is_date(date_string):
""" Verifies if a string rep... | monicabaluna/transactions | validators.py | validators.py | py | 2,362 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "flask.request.method",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name":... |
70013934452 | import pathlib
import numpy as np
import pytest
import wannier90io as w90io
@pytest.mark.parametrize('example', ['example02', 'example03', 'example04'])
def test_read_eig(wannier90, example):
with open(pathlib.Path(wannier90)/f'examples/{example}/wannier.eig', 'r') as fh:
eig = w90io.read_eig(fh)
... | wannier-developers/wannier90io-python | tests/test_eig.py | test_eig.py | py | 1,026 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "wannier90io.read_eig",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.fromstring",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parame... |
40751482807 | #!/usr/bin/env python
from lib.Bcolors import Bcolors
from lib.WritePort import WritePort
from lib.ReadPort import ReadPort
import lib.commands_chip as chip
import lib.constants as const
from lib.Rigol_DP832A import RigolDP832A
from datetime import datetime
import time
def chip_setup():
#Setup read and write port
wr... | ThomasVandenabeele/oscar-test-setup | python/test_rd_memory.py | test_rd_memory.py | py | 1,601 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "lib.WritePort.WritePort",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "lib.ReadPort.ReadPort",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "lib.Bcolors.Bcolors.FAIL",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_n... |
337269902 | import sys
import subprocess
from PyQt6.QtCore import Qt, QRunnable, QThreadPool
from PyQt6.QtGui import QAction, QIcon
from PyQt6.QtWidgets import QApplication, QWidget, QTableWidget, QTableWidgetItem, QHeaderView, QVBoxLayout, QPushButton
class CommandRunner(QRunnable):
def __init__(self, command):
super... | wlmqljj/MyScript | AdbToolkit.py | AdbToolkit.py | py | 3,430 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "PyQt6.QtCore.QRunnable",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "subprocess.call",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PyQt6.QtWidgets.QWidget",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "PyQt6.Q... |
39969583199 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from numpy import array
from keras.models import Sequential
from keras.layers import Dense, Activation, Dropout, LSTM
np.random.seed(0)
def create_model(inputs, neurons, dropout =0.25):
model = Sequential()
model.add(Dense(100, input_dim=2... | elvis0502/DeepLeanring | PowerUsageClassifier.py | PowerUsageClassifier.py | py | 3,234 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.random.seed",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "keras.models.Sequential",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "keras.layer... |
31790977221 | """
author : Lee Sang Min
github : https://github.com/sangm1n
e-mail : dltkd96als@naver.com
title : 큰 수 구성하기
description : Brute Force
"""
from itertools import product
N, K = map(int, input().split())
arr = list(map(int, input().split()))
length = len(str(N))
flag = True
while length > 0:
prod = list(product(a... | sangm1n/problem-solving | BOJ/18511.py | 18511.py | py | 582 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "itertools.product",
"line_number": 18,
"usage_type": "call"
}
] |
25940028082 | import argparse
import os
import sys
import numpy as np
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
def parse_args():
parser = argparse.ArgumentParser(description="Convert Giotto output to CSV")
parser.add_argument(
"--path",
dest="path",
help="pat... | TissUUmaps/TissUUmaps | examples/giotto2tmap.py | giotto2tmap.py | py | 3,068 | python | en | code | 33 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
21352238456 | from pygame import mixer
from datetime import datetime
from time import time
def musiconloop(file,sttoper):
mixer.init()
mixer.music.load(file)
mixer.music.play()
while True:
a=input("enter commound to stop:\n")
if a==sttoper:
mixer.music.stop()
break
... | Asthabarpete/healthy_programmer | healty_programmer.py | healty_programmer.py | py | 1,363 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.mixer.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "pygame.mixer.music.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.mixer.musi... |
37481481230 | import math
import copy
from functools import partial
from collections import OrderedDict
from typing import Optional, Callable
import torch
import torch.nn as nn
from torch import Tensor
from torch.nn import functional as F
# 将传入的channel调整到离他最近的8的倍数
def _make_divisible(ch, divisor=8, min_ch=None):
"""
This ... | Mythszj/QHZJ_classification | models/EfficientNet.py | EfficientNet.py | py | 16,319 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.rand",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 49,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"l... |
74347528054 | #!/usr/bin/env python
"""
Script for processing the contents of the CMS pool.
"""
import os
import sys
import time
import signal
import logging
import argparse
import multiprocessing
import htcondor_es
import htcondor_es.history
import htcondor_es.queues
from htcondor_es.utils import (
get_schedds,
get_schedd... | dmwm/cms-htcondor-es | scripts/spider_cms.py | spider_cms.py | py | 7,812 | python | en | code | 11 | github-code | 21 | [
{
"api_name": "time.time",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "signal.alarm",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "htcondor_es.utils.TIMEOUT_MINS",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "htcondor_es.uti... |
27118057266 | #!/usr/bin/env python3
# title : cryptocoin_price.py
# description : LIVE CRYPTOCOIN PRICE INDICATION
# author : Debjyoti Guha
# date : 01/01/18
# version : 1.0.0
# usage : nohup python3 cryptocoin_price.py &
# notes : Can also be run with debug output with ... | blockhead404/cryptocoin-price | cryptocoin_price.py | cryptocoin_price.py | py | 13,077 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "gi.require_version",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "gi.require_version",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "datetime.... |
6362227082 | #!/usr/bin/env python3
#-*- coding : utf-8-*-
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
def tree_from_list(l):
from collections import deque
root = TreeNode(l[0])
queue = deque()
queue.append(root)
i = 1
while i <... | TwoAnts/leet | leet101.py | leet101.py | py | 2,178 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.deque",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 53,
"usage_type": "call"
}
] |
39522997550 | from absl import logging
import numpy as np
import scipy.stats
from typing import List
from wfa_planning_evaluation_framework.models.reach_point import ReachPoint
from wfa_planning_evaluation_framework.models.reach_curve import ReachCurve
# The following constant defines the highest frequency that will be
# used for p... | world-federation-of-advertisers/planning-evaluation-framework | src/models/gamma_poisson_model.py | gamma_poisson_model.py | py | 27,187 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "wfa_planning_evaluation_framework.models.reach_curve.ReachCurve",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 102,
"usage_type": "name"
},
{
"api_name": "wfa_planning_evaluation_framework.models.reach_point.ReachPoint",
... |
239897282 | import json
from difflib import get_close_matches
data = json.load(open("dictionary.json"))
def translate(word):
word = word.lower()
if word in data:
return data[word]
elif word.title() in data:
return data[word.title()]
elif word.upper() in data:
return data[word.upper()]
... | ElshadaiK/PythonProjects | dictionary.py | dictionary.py | py | 1,153 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "difflib.get_close_matches",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "difflib.get_close_matches",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "difflib.... |
74301966132 | """calc.py: Classes for EOS and gun simulation
>>> Nx = 10 # len(self.x)
>>> C = 2.56e10 # EOS parameter
>>> xi = .4 # Initial x
>>> xf = 4.0 # Final x
>>> mass = 100.0
>>> dev = 0.2 # +/- 10%
>>> gun = GUN(C,xi,xf,mass,Nx,dev)
>>> gun.set_a_b(-1.0,-0.4)
>>> print('E(2.0)=%.3e'%gun.E(2.0))
E(2.0)=7.680e+1... | fraserphysics/metfie | calc.py | calc.py | py | 30,228 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.dtype",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "numpy.float64",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "scipy.sparse.lil_matrix",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "scipy.sparse",... |
23612718088 | #Encoding: utf-8
import argparse
# Se definen los argumentos opcionales.
parser = argparse.ArgumentParser(description='Procesa argumentos..')
parser.add_argument("-n", "--numero", metavar='N', type=int, dest="varnumero", help="Guarda número", required=True)
parser.add_argument("-t", "--texto", metavar='TEXT', dest="va... | CarlosManuelRodr/Curso-Python | Unidad 7 - Parsers y excepciones/2_ArgumentosOpcionales.py | 2_ArgumentosOpcionales.py | py | 676 | python | es | code | 0 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
}
] |
14618364236 | # -*- coding: utf-8 -*-
import scrapy
from scrapy.selector import Selector
import urllib
class FreeproxylistsSpider(scrapy.Spider):
name = "FreeProxyLists"
allowed_domains = ["freeproxylists.net"]
start_urls = ['http://www.freeproxylists.net/']
def parse(self, response):
for ipdata in respons... | hernanrocha/scrapy-crawler | scrapy_crawler/spiders/FreeProxyLists.py | FreeProxyLists.py | py | 939 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "scrapy.Spider",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "scrapy.selector.Selector",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "urllib.unquote",
"line_number": 16,
"usage_type": "call"
}
] |
74186860213 | from .content_collector import ContentCollector
import os
import shutil
import importlib
from pathlib import Path
from feasium.content_type.content import Content
class SiteCollector:
def __init__(self, base_path):
self.base_path = base_path
def collect(self):
cwd = self.base_path
site... | austin880625/feasium | feasium/collector/site_collector.py | site_collector.py | py | 1,750 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "os.path.join",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 2... |
15184208425 | import importlib.metadata
from collections.abc import Callable
from functools import wraps
from pprint import pformat
from typing import Any
import click
from .scenelib.scene import Scene
from .scenelib.utils import SceneStdinError
__version__ = importlib.metadata.version("asciinema_scene")
input_option = click.opt... | jdum/asciinema-scene | asciinema_scene/sciine.py | sciine.py | py | 9,365 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "importlib.metadata.metadata.version",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "importlib.metadata.metadata",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "importlib.metadata",
"line_number": 12,
"usage_type": "name"
},
... |
23339973606 | import os
import logging
import shutil
import struct
from functools import lru_cache
from itertools import accumulate, islice
from dataclasses import dataclass
import numpy as np
import torch
dtypes = {1: np.uint8, 2: np.int8, 3: np.int16, 4: np.int32, 5: np.int64, 6: np.float32, 7: np.float64, 8: np.uint16}
def co... | ekgren/simple-transformer | src/dataset/nemo.py | nemo.py | py | 10,801 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "numpy.uint8",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.int8",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.int16",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.int32",
"... |
6664860150 | #!/usr/bin/env python3
import os
import textwrap
from xml.etree import ElementTree
VERSION = '0.0.1'
readme = open('README.md', 'w')
readme.write(textwrap.dedent("""\
# Space Haven Mods
This is a collection of unofficial mods tool for [Space Haven by Bugbyte](http://bugbyte.fi/spacehaven/), an early-alph... | anatarist/spacehaven-mods | tools/build.py | build.py | py | 1,707 | python | en | code | 7 | github-code | 21 | [
{
"api_name": "textwrap.dedent",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "xml.etree.Elem... |
17862872853 | """
Tests for artist APIs.
"""
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
from core.models import List, Entry, Artist, Album
from list.serializers import ListSerializer
fr... | biurs/custom-music-charts | app/list/tests/test_list_api.py | test_list_api.py | py | 5,319 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.reverse",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.urls.reverse",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "core.models.Artist.objects.get_or_create",
"line_number": 30,
"usage_type": "call"
},
{
"... |
70309681014 | """Bokeh linear regression plot."""
import numpy as np
from bokeh.models.annotations import Legend
from ...hdiplot import plot_hdi
from ...plot_utils import _scale_fig_size
from .. import show_layout
from . import backend_kwarg_defaults, create_axes_grid
def plot_lm(
x,
y,
y_model,
y_hat,
num_sa... | arviz-devs/arviz | arviz/plots/backends/bokeh/lmplot.py | lmplot.py | py | 5,391 | python | en | code | 1,461 | github-code | 21 | [
{
"api_name": "plot_utils._scale_fig_size",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.random.uniform",
"line_number": 97,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 97,
"usage_type": "attribute"
},
{
"api_name": "hdi... |
301931289 | from Demotivor import demotivate
from PIL import Image, ImageSequence
import io
def demotivate_gif(upper_text, lower_text, gif_name: str):
# спихжено отсюда https://github.com/python-pillow/Pillow/issues/3128
im = Image.open(gif_name)
frames = []
for frame in ImageSequence.Iterator(im):
frame ... | quadrixx/romadelaetjunky | Demogif.py | Demogif.py | py | 590 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "PIL.Image.open",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PIL.ImageSequence.Iterator",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PIL.ImageSequence",... |
19476722126 | import pygame as pg
#Esta clase será la encargada del sonido del juego.
class Sound:
def __init__(self, game):
self.game = game
pg.mixer.init()
self.path = 'resources/sound/'
self.theme = pg.mixer.music.load(self.path + 'theme2.mp3')
pg.mixer.music.set_volume(0.4) | nachoblwh/IESJandulaMAP3D | sound.py | sound.py | py | 311 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.mixer.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pygame.mixer.music.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.mixe... |
13751121775 | # app.py
from logging import StreamHandler, getLogger
import logging
from threading import Lock
from cachetools import TTLCache, cached
from fastapi import FastAPI, Form, Header, Query, Path, Request
from fastapi.exceptions import RequestValidationError
from fastapi.exception_handlers import (
request_validation_ex... | codeforbielefeld/teuto-moisture-map-python | services/tmm-api/tmm_api/app.py | app.py | py | 4,782 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHan... |
28705958705 | from __future__ import absolute_import
import logging
import os
import re
# FIXME: This could be replaced with hooking into the `AppConfig.ready()`
# signal in Django 1.7:
#
# https://docs.djangoproject.com/en/1.7/ref/applications/#django.apps.AppConfig.ready
#
# For now though we have to load in the monkey patches h... | lumanjiao/XLS_BigData_Hue | desktop/core/src/desktop/urls.py | urls.py | py | 4,320 | python | en | code | 13 | github-code | 21 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.patterns",
"line_number": 35,
"usage_type": "call"
},
{
"... |
20684768937 | import numpy as np
import matplotlib.pyplot as plt
sims = 24
dataname = 'lgt22223620000100002p0'
def plotconfig(dataname,sims,silent,residuals):
inlocation = ".\Debug\\"
outlocation = ".\outdata\\"
fname = inlocation + dataname +'.txt'
outfname = outlocation + 'out' + dataname
outcorrelatordata = [[],[],[]]
#T... | MGHawes/Lattice-Gauge-Theory | dataprocess.py | dataprocess.py | py | 4,001 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "numpy.sqrt",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
... |
27247863210 | import pickle
from queue import PriorityQueue
from random import random, randint
import numpy as np
import pygame
from utils import *
class Map:
def __init__(self, n=20, m=20):
self.n = n
self.m = m
self.surface = np.zeros((self.n, self.m))
self.random_map()
def generate_drone... | GeorgeDanicico/Artificial-Intelligence-Year2 | Assignment4/domain/map.py | map.py | py | 4,207 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.zeros",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_... |
32684302016 | ########################################################################
# File name: testutils.py
# This file is part of: aioxmpp
#
# LICENSE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Founda... | horazont/aioxmpp | aioxmpp/testutils.py | testutils.py | py | 27,451 | python | en | code | 215 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "time.get_clock_info",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "os.environ",
... |
11922462370 | # 将设置从代码中分离开
# decouple将帮助你解析你的程序配置文件,达到更改你的设置而不用重新部署程序的效果
# decouple完成的事情:
# # 1. 在ini或者.env文件中存储你的参数
# # 2. 定义你的默认值
# # 3. 适当的将你的配置转换成合适的值
# # 4. 你的程序中只需要一个配置模块来进行设置
# Decouple支持两种类型:.ini文件和.env 文件
# pip install python-decouple
from decouple import config
from unipath import Path
from dj_database_url import parse ... | jolingcome/python-learning | 学习/常见模块/decouple_model.py | decouple_model.py | py | 1,230 | python | zh | code | 0 | github-code | 21 | [
{
"api_name": "unipath.Path",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "decouple.config",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "decouple.config",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "dj_database_url.parse",
... |
4879246223 | import pickle
import os
from keras.layers import Embedding, Conv1D, MaxPooling1D, LSTM, Dense
from keras.models import Sequential
from keras.models import load_model
from keras.utils import pad_sequences
from nltk.corpus import stopwords
from flask import Flask, request, jsonify
from flask_cors import CORS
imp... | amrutwali/Depression-Detector | server/app.py | app.py | py | 2,394 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "nltk.download",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words... |
32341977998 | import os
from zoneinfo import available_timezones
from flask import Flask, request, abort, jsonify
from flask_sqlalchemy import SQLAlchemy
from flask_cors import CORS
import random
from models import setup_db, Book, Genre, Author, db
#Function to Paginate
ITEMS_PER_PAGE = 10
def paginate(request,selection):
page... | akande7/Library-rest-api | app.py | app.py | py | 5,651 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.request.args.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "flask.Fl... |
41230555668 | import math
from sklearn import datasets
import numpy as np
data = datasets.load_iris()
nbdata = data.data.shape[0]
print(data.data.shape)
print(np.array(data.target).shape)
fulldata = np.c_[data.data, data.target]
print(fulldata.shape)
np.random.shuffle(fulldata)
x_full = fulldata[:,:-1]
y_full = fulldata[:,... | AlexisPlo/Mocad | A2DI/TP1/TP1_PPV.py | TP1_PPV.py | py | 1,248 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.c_",
... |
22633996642 | # UTILIZES RUSTY_MWS, HGLOM FOR ALL SEGMENTATION, ORIGINALLY WRITTEN BY BRIAN REICHER (2023)
import rusty_mws
import hglom
from ..utils import neighborhood
from ..predict.network_predictions import predict_task
from ..networks import *
from ..models import *
def _setup_model(network=setup_unet(), model=MTLSDModel):
... | htem/autoseg | src/autoseg/postprocess/segment_mws.py | segment_mws.py | py | 3,062 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "utils.neighborhood",
"line_number": 49,
"usage_type": "argument"
},
{
"api_name": "predict.network_predictions.predict_task",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "rusty_mws.PostProcessor",
"line_number": 68,
"usage_type": "attribute"
... |
7760865683 | ####################################
#
# PDSB Project 2021
#
# Module: Classification with Convolutional Neural Networks (CNN)
# File: load_dataset
#
# Created on May 30, 2021
#
# Code rights reserved to João Saraiva
#
####################################
from scipy.io import loadmat
import numpy as np
from scipy... | jomy-kk/AutICA | cnn/load_dataset.py | load_dataset.py | py | 5,132 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "scipy.io.loadmat",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "scipy.io.loadmat",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line... |
74600397171 | import tensorflow as tf
import numpy as np
from collections import deque
from DeepAgent.interfaces.ibaseBuffer import BaseBuffer, Transition
class ExperienceReplay(BaseBuffer):
"""
This class manages buffer of agent.
"""
def __init__(self, size, **kwargs):
super(ExperienceReplay, self).__ini... | LANNDS18/DeepAgent_Atari | DeepAgent/utils/buffer.py | buffer.py | py | 4,962 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "DeepAgent.interfaces.ibaseBuffer.BaseBuffer",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "collections.deque",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "DeepAgent.interfaces.ibaseBuffer.Transition",
"line_number": 18,
"usage_type... |
9560567144 | from django.urls import path
from . import views
from posts import views as postViews
app_name = "masterminds"
urlpatterns = [
path("", postViews.PostListView.as_view(), name="home"),
path("coming-soon/", views.ComingSoonView.as_view(), name="comingsoon"),
path("about/", views.AboutView.as_view(), name="a... | tahaboud/MastermindsGit | MasterSite/theSite/urls.py | urls.py | py | 467 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "posts.views.PostListView.as_view",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "posts.views.PostListView",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_... |
73738717172 | #!/usr/bin/python3
import sys
import itertools
import numpy as np
import random
def read(fn):
with open(fn, 'r') as f:
for line in f:
sp = line.split()
if len(sp) != 7:
continue
yield tuple(sp)
def groupByIter(ls):
ixCol = 3
iyCol = 4
sls = ... | ccp-project/eval-scripts | parse/sampleCwndEvo.py | sampleCwndEvo.py | py | 868 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "itertools.groupby",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "random.sample",
"li... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.