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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
19706742389 | # -*- coding: utf-8 -*-
# @Time :2021/3/3 20:00
# @Author :huangzg28153
# @File :model_step.py
# @Software :PyCharm
import argparse
from log import *
from train import *
from simulate import *
parser = argparse.ArgumentParser('Interface for DE-GNN framework')
# general model and training setting
parser... | hzg0601/cn-annotation | DE-GNN-cn-annotation/main_step.py | main_step.py | py | 5,894 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
}
] |
22535578667 | from django.core.management.base import BaseCommand, CommandError
# from django.db.models.loading import get_model
import csv
from apps.stores.models import Kitchen, Store, Item, Category
from apps.users.models import User
from config import settings
class Command(BaseCommand):
help = "import csv file of store da... | Abhisheksoni1/pkbpy | application/apps/authentiation/management/commands/import_dummy_data.py | import_dummy_data.py | py | 6,048 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "config.settings.MEDIA_ROOT",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "config.settings",
"line_number": 13,
"usage_type": "name"
},
{... |
30292126417 | import statsmodels.formula.api as smf
import scipy.stats
import longitudinal_statistics
def response(data, phecode_info, case_status):
# morning vs evening person
res = smf.ols("temp_amplitude ~ self_report_chronotype + " + " + ".join(longitudinal_statistics.COVARIATES), data=data).fit()
delta = -res.para... | tgbrooks/ukbb | reviewer_response.py | reviewer_response.py | py | 2,350 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "statsmodels.formula.api.ols",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "statsmodels.formula.api",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "longitudinal_statistics.COVARIATES",
"line_number": 8,
"usage_type": "attribute"
},
... |
12998076138 | import random
from collections import deque
from copy import deepcopy
from typing import Any, List, Tuple
import gym
import numpy as np
from ml_fun.muzero.model import AbstractMuZeroModel
from ml_fun.muzero.search import mcts, naive_search
class Game:
def __init__(self, environment: gym.Env, discount_factor: fl... | KappaDistributive/ml_fun | ml_fun/muzero/game.py | game.py | py | 7,356 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "gym.Env",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "copy.deepcopy",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "typing.Any",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "copy.deepcopy",
"line_numbe... |
16948733878 | from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
class WaitUtil(object):
def __init__(self, driver):
self.locationDict = {
"xpath": By.... | liumengren/KeyWordsFrameWork | util/WaitUtil.py | WaitUtil.py | py | 2,395 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.common.by.By.XPATH",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.common.by.By",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.by.By.ID",
"line_number": 12,
"usage... |
7158710216 | import json
import os
import sys
import FullStack
# os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'FullStack.settings')
os.environ['DJANGO_SETTINGS_MODULE'] = 'FullStack.settings'
import django
django.setup()
DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(DIR)
from FullStack.setti... | HayHiTee/FullStack | populate_data.py | populate_data.py | py | 3,159 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.setup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numbe... |
30891552570 |
import os
import sys
import shutil
import config
import tools
import printer
def build(builder_data_dict, parent_function):
check_non_privileged_user()
check_mount_point()
check_tools_directory(builder_data_dict["tools_directory"])
give_permission_build_dir()
# Call parent function
parent_f... | gongomgra/lfsbuilder | recipes/builders/toolchain/functions.py | functions.py | py | 5,238 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "tools.check_user_exists",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "config.NON_PRIVILEGED_USERNAME",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "config.NON_PRIVILEGED_USERNAME",
"line_number": 26,
"usage_type": "attribute"... |
36797436874 | """Function Utils, decorators for debugging and other utilities"""
import functools
import gc
import cProfile
import io
import pstats
from pprint import pprint
from src.utils import debugutils
def debug(apply=True, sign=True, ret=True, sign_beautify=False, ret_beautify=False):
"""
Print the function signatur... | KhaledElTahan/Real-World-Anomaly-Detection | src/utils/funcutils.py | funcutils.py | py | 4,105 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "src.utils.debugutils.tensors_to_shapes",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "src.utils.debugutils",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "src.utils.debugutils.tensors_to_shapes",
"line_number": 35,
"usage_type": "ca... |
9401554209 | """
Contains testing functions for the models. Tests for the models ensure:
* The SQLAlchemy interface works as expected.
* Model objects are stored in the database correctly.
* Model attributes are correctly set and retrieved.
To test this suite only, run `pytest -v tests/test_models.py`.
"""
import pytest
from date... | coniferousdyer/Stats-Portal | api/tests/test_models.py | test_models.py | py | 12,131 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "application.models.models.User",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "application.models.orm.db.session.add",
"line_number": 47,
"usage_type": "call"
},
{... |
2690932257 | #!/usr/bin/env python
# coding: utf-8
"""
This file implements the 'LstmForecast' class
to compute the prediction results using a deep
learning technique. It uses LSTM network
(special kind of recurrent neural network) with
sequence length of over 100.
"""
__author__ = 'Emad Bin Abid, Ateeb Ahmed, Syed Bilal Hoda... | EmadBinAbid/pcatr | src/pcatr-package/src/PCATR/CallTimePredictor/CTPAlgorithm/lstm_forecast.py | lstm_forecast.py | py | 5,754 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "torch.nn.LSTM",
"line_n... |
36932862237 | import os
from pathlib import Path
import platform
from types import TracebackType
from typing import Any, AnyStr, Callable, Iterator, List, Optional, Tuple, Type, Union
from warnings import warn
from packaging.utils import canonicalize_name as normalize
import requests
from . import PYPI_SIMPLE_ENDPOINT, __url__, __ve... | AmbeyiBrian/ELECTRONIC-SCHOOL-MANAGER-KENYA | elimu_backend/venv/Lib/site-packages/pypi_simple/client.py | client.py | py | 13,937 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.__version__",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "platform.python_implementation",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "platform.python_version",
"line_number": 23,
"usage_type": "call"
},
{
"... |
14374877365 | """Unit tests for common.py."""
from flask import g
# import first so that Fake is defined before URL routes are registered
from .testutil import Fake, TestCase
import common
from flask_app import app
from web import Web
class CommonTest(TestCase):
def setUp(self):
super().setUp()
g.user = Fake(... | snarfed/bridgy-fed | tests/test_common.py | test_common.py | py | 3,056 | python | en | code | 219 | github-code | 6 | [
{
"api_name": "testutil.TestCase",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "flask.g.user",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "flask.g",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "testutil.Fake",
"line... |
72531890749 | # pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
# pylint: disable=unused-variable
""" Fixtures to create docker-compose.yaml configuration files (as in Makefile)
- Basically runs `docker compose config
- Services in stack can be selected using 'core_services_selection', 'ops_se... | ITISFoundation/osparc-simcore | packages/pytest-simcore/src/pytest_simcore/docker_compose.py | docker_compose.py | py | 13,376 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "dotenv.dotenv_values",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "helpers.utils_docker.get_localhost_ip",
"line_number": 56,
"usage_type": "call"
},
{
"api_name"... |
73826492666 | #
# Exemplo de acesso a uma base de dados SQLite
#
import sqlite3
def manipula_dados(bancoDados, comando):
conexao = sqlite3.connect(bancoDados)
cursor = conexao.cursor()
cursor.execute(comando)
conexao.commit()
conexao.close()
def seleciona_dados(bancoDados, comando):
conexao = sqlite3.con... | Feltrim/CursoPython-LinkedInLearning | Exercicios/arquivos_de_exercicios_descubra_o_python/Cap. 06/buscarDadosSQLite_start.py | buscarDadosSQLite_start.py | py | 854 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 17,
"usage_type": "call"
}
] |
32710813136 | import torch
import random
from timebudget import timebudget
import sys
class FastMemory:
def __init__(self, desc, chunks):
self.xmemory = []
self._memory = []
self.desc = desc
self.capacity = self.desc.optim_pool_size
self.chunks = chunks
assert self.capacity
... | rezer0dai/dlppoh | utils/fastmem.py | fastmem.py | py | 4,006 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.zeros",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "random.sample",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "timebudget.timebudget",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "random.randint",
... |
1270389032 | #https://www.datacamp.com/tutorial/recommender-systems-python
from cgi import test
from unittest import result
from scipy.sparse import csr_matrix
from sklearn.neighbors import NearestNeighbors
import numpy as np
import pandas as pd
from alive_progress import alive_bar
import os.path
import os
class RSWeightedRating():... | tanapattara/rs-py | rs_weighted_rating.py | rs_weighted_rating.py | py | 2,724 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "alive_progress.alive_bar"... |
27741425451 | import os
import tools
class OutputDirectory() :
output_dir = "output_dir"
def __init__(self, parent, name, number = -1, mkdir=True) :
self.number = number
self.parent = parent
# set parent directory for subfolder creation
if self.parent :
parent_dir = self.parent.... | piclas-framework/reggie2.0 | outputdirectory.py | outputdirectory.py | py | 785 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 2... |
39909869027 | from django.shortcuts import render
from .models import Coordination, ClassroomAllocation, SyllabusBaseInfo
from .forms import SearchForm
import json
def search_page(request):
if request.method == "POST":
form = SearchForm(request.POST)
if form.is_valid():
season = form.cleaned_data["時... | gdsc-tmu/tmu_map | map/views.py | views.py | py | 2,691 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "forms.SearchForm",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "forms.SearchForm",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "django.short... |
41029616611 | # this file is to merge the jupyter notebooks into one.
# source: https://towardsdatascience.com/how-to-easily-merge-multiple-jupyter-notebooks-into-one-e464a22d2dc4
import json
import copy
# functions
def read_ipynb(notebook_path):
with open(notebook_path, 'r', encoding='utf-8') as f:
return json.load(f... | ubco-W2020ST2-data301/group10-project | analysis/scripts/merge.py | merge.py | py | 887 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 22,
"usage_type": "call"
}
] |
7350708900 | from comet_ml import Experiment, OfflineExperiment
import copy
import glob
import os
import time
from collections import deque
import gym
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from a2c_ppo_acktr import algo
from a2c_ppo_acktr.arguments impor... | NishanthVAnand/pytorch-a2c-ppo-acktr-filter | main.py | main.py | py | 13,928 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "a2c_ppo_acktr.arguments.get_args",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "comet_ml.OfflineExperiment",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "comet_ml.Experiment",
"line_number": 42,
"usage_type": "call"
},
{
"a... |
9192363714 | import math
import numpy as np
import os
import time
import sys
from datetime import datetime
from naoqi import ALProxy
ROBOT_IP = '192.168.1.193'
#ROBOT_IP = '192.168.1.163'
#ROBOT_IP = '192.168.1.162'
class PepperHandler(object):
__instance = None
@staticmethod
def getInstanc... | SocialBrainInActionLab/Heartbot | pepper_heartbot_lights.py | pepper_heartbot_lights.py | py | 7,903 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "naoqi.ALProxy",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "naoqi.ALProxy",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "naoqi.ALProxy",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_... |
73022887867 | import statistics
import numpy as np
class KNN:
def __init__(self, metric):
self.metric = metric
def distance(self, training_data_point, test_dp):
dist = 0
if self.metric == 'eucledian':
for i in range(len(training_data_point) - 1):
dist += (training_data_... | Prathamesh-Palatshaha/Machine-Learning-Custom-Models | KNN.py | KNN.py | py | 1,315 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.sqrt",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "statistics.mode",
"line_number": 45,
"usage_type": "call"
}
] |
36441584845 | # -*- coding:utf-8 -*-
"""
Author:Wei Mao
Date :2022-12-08
Email : weimao@whu.edu.cn
"""
import os
from PySide2.QtWidgets import QApplication
from PySide2.QtUiTools import QUiLoader
from PySide2.QtWidgets import QInputDialog
from PySide2.QtWidgets import QLineEdit
class DeMo:
def __init__(self):
# 从文件中加... | Weiwei-Mao/PySide2 | demo8.4.py | demo8.4.py | py | 1,496 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PySide2.QtUiTools.QUiLoader",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PySide2.QtWidgets.QInputDialog.getText",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "PySide2.QtWidgets.QInputDialog",
"line_number": 26,
"usage_type": "nam... |
26040917666 | from __future__ import annotations
import platform
import sqlite3
from collections.abc import Sequence
from pathlib import Path
from textwrap import dedent
import pytest
from pants.backend.python.goals.coverage_py import CoverageSubsystem
from pants.base.build_environment import get_buildroot
from pants.testutil.pan... | pantsbuild/pants | src/python/pants/backend/python/goals/coverage_py_integration_test.py | coverage_py_integration_test.py | py | 17,395 | python | en | code | 2,896 | github-code | 6 | [
{
"api_name": "textwrap.dedent",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "textwrap.dedent",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "textwrap.dedent",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "textwrap.dedent",
... |
41546863265 | """---------------------------------------------------------------------------------------\
| This is An IMPORTANT Interpreter & Compiler for the IMPORTANT language |
-----------------------------------------------------------------------------------------|
Version: 0.1.1alpha
"""
import argparse
impo... | csertant/important | an_important_interpreter.py | an_important_interpreter.py | py | 3,733 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "important_cleaning.important_clean_program",
"line_number": 51,
"usage_type": "call"... |
30357964171 | from traitsui.testing.tester.command import MouseClick
from traitsui.testing.tester.query import DisplayedText, IsChecked
from traitsui.testing.tester._ui_tester_registry.qt import (
_interaction_helpers,
)
from traitsui.qt.boolean_editor import ReadonlyEditor, SimpleEditor
def register(registry):
"""Register... | enthought/traitsui | traitsui/testing/tester/_ui_tester_registry/qt/_traitsui/boolean_editor.py | boolean_editor.py | py | 1,227 | python | en | code | 290 | github-code | 6 | [
{
"api_name": "traitsui.qt.boolean_editor.SimpleEditor",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "traitsui.testing.tester.command.MouseClick",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "traitsui.testing.tester._ui_tester_registry.qt._interaction_he... |
32461111143 | import time, pygame, sys, random
pygame.init()
fps = pygame.time.Clock()
time = 0
width = 800
height = 600
pygame.display.set_caption('Snake')
screen = pygame.display.set_mode((width, height))
game_over = False
# player
player_position = [400, 320]
player_size = [40, 40]
lastdirection = 'right'
direction = 'right'
dire... | JohnPullmann/OldProjects2020 | Game-2_10-2-2020-small-pygame/Snake.py | Snake.py | py | 4,953 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "pygame.time.Clock",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pygame.time",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_captio... |
24905683983 | import cadquery as cq
import cadquery.selectors as cqs
import logging, importlib
from math import asin as asin, degrees as degrees
from math import atan as atan
# Choose where to load the measures from (always a module, from the local directory).
# Choose one or create your own measures file.
#measures_modulename = "... | tanius/cadquery-models | footblock/foot_block.py | foot_block.py | py | 8,122 | python | en | code | 11 | github-code | 6 | [
{
"api_name": "importlib.import_module",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "importlib.import_module",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "importlib.reload",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "math... |
37539769214 | from pyexpat.errors import XML_ERROR_UNKNOWN_ENCODING
#from cameraDriver import takeAPicture
import cv2.aruco as aruco
import cv2 as cv
import numpy as np
import os
import math
import sys
sys.path.insert(1, './motorEmbeddedCode')
import piece
def modified_binary_search(arr, low, high, x):
# Check base case
... | Pearston/ReChess | imageProcessingCode/abstractionMaker.py | abstractionMaker.py | py | 11,010 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.insert",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "cv2.cvtColor",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"li... |
71600514107 | import os
import argparse
import json
import grpc
import connector_service_pb2_grpc
import connector_service_pb2
import psycopg2
def make_mock_schema():
# todo
schema = connector_service_pb2.TableSchema(
columns=[
connector_service_pb2.TableSchema.Column(name="id", data_type=2),
... | gridgentoo/risingwave | java/connector-node/python-client/integration_tests.py | integration_tests.py | py | 7,977 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "connector_service_pb2.TableSchema",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "connector_service_pb2.TableSchema.Column",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "connector_service_pb2.TableSchema",
"line_number": 14,
"usage_... |
22996233167 | import cv2
import numpy as np
imagedb = cv2.imread("../../BilderV2/dunkelbild.png") #dunkelbild
imagedb = imagedb.astype('float32')
imagewb = cv2.imread("../../BilderV2/weißbild.png") #weißbild
imagewb = imagewb.astype('float32')
eingangsbildname = "unbearbeitet"
imageub = cv2.imread("../../BilderV2/" + eingangsbil... | sehirsig/AIN3-SSS | Versuch 2/Aufgabe3/einlesenteil2.py | einlesenteil2.py | py | 955 | python | de | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.subtract",
"line_number": 15... |
4417075664 | import cv2
import numpy as np
class Color_check:
def __init__(self, img):
# img = cv2.imread(img_path)
img = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
self.img = img
def Color_check(self):
# define green threshold
lower_green = (38, 90, 30)
upper_green = (70, 255,255... | khangnguyenhuu/AI-Inspector | Process/color_check.py | color_check.py | py | 2,114 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.cvtColor",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2HSV",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.inRange",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"lin... |
26112334595 | __authors__ = ["V. Valls"]
__license__ = "MIT"
__date__ = "14/06/2018"
import functools
import numpy
try:
import scipy
except ImportError:
scipy = None
from silx.gui import qt
from silx.gui.dialog.ColormapDialog import ColormapDialog
from silx.gui.colors import Colormap
from silx.gui.plot.ColorBar import Col... | silx-kit/silx | examples/colormapDialog.py | colormapDialog.py | py | 8,296 | python | en | code | 106 | github-code | 6 | [
{
"api_name": "silx.gui.qt.QMainWindow",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "silx.gui.qt",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "silx.gui.colors.Colormap",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sil... |
70911592187 | # Counts the number of events from start to end time in a given window of fixed interval
import h5py
from pyspark import SparkConf, SparkContext
from pyspark.sql.types import Row, StructField, StructType, StringType, IntegerType, LongType, ArrayType, TimestampType
from datetime import datetime, date, timedelta
import s... | CSCfi/spark-analysis | sparkles/modules/liq_curve_parquet.py | liq_curve_parquet.py | py | 6,591 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "c... |
10452720058 | import pygame as pg
# 自己的 library
import env
# 設定起始參數
window_size = env.WINDOW_SIZE
border_size = 10
# 遊戲邊界
class BlockSprite(pg.sprite.Sprite):
def __init__(self, x, y, width, height):
super().__init__()
self.image = pg.Surface((width, height))
self.image.fill((0, 0, 0))
self.re... | PM25/Simulation-of-Life | block.py | block.py | py | 975 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "env.WINDOW_SIZE",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pygame.Surface",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.sprite.G... |
21929763881 | import cv2
import mediapipe as mp
import time
import handTrackingModule as htm
import math
pTime = 0
cTime = 0
cap = cv2.VideoCapture(0)
detector = htm.handDetector(detectionCon=0.7)
while True:
success, img = cap.read()
# setting draw to true will allow you to see points along the hand
img = detector.fin... | joshuaaduarte/gestureRecognition | volumeAdjust.py | volumeAdjust.py | py | 1,372 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "handTrackingModule.handDetector",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.circle",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "cv2.FILLED... |
40982998914 | from selenium import webdriver
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.by import By
from time import sleep
drive = webdriver.Chrome()
drive.get('https://www.google.com/webhp?source=search_app')
WebDriverW... | aeabom741/Web_automatic_test_selenium | 顯性等待複習.py | 顯性等待複習.py | py | 1,734 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.support.wait.WebDriverWait",
"line_number": 9,
"usage_type": "call"
},
... |
70986007228 | import torch
import torch.nn as nn
import torch.utils.data as data
activations = {
"relu": nn.ReLU(),
"sigmoid": nn.Sigmoid(),
"tanh": nn.Tanh(),
"leaky_relu": nn.LeakyReLU(),
}
class MLP(nn.Module):
def __init__(self, input_size, hidden_sizes, output_size, activation="relu"):
super(MLP,... | Fleyja/ROAD-Sensor-array-optimization | Code availability/src/models.py | models.py | py | 2,437 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torch.nn.ReLU",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sigmoid",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 8,... |
9988861904 | import logging
import os
import json
from threading import Thread
import defaults
from app.common.Kafka_consumer_service.kafka_consumer_service import KafkaConsumerService
from app.common.kafka_producer.kafka_producer import KafkaProducer
from app.common.Kafka_consumer_service.termination_processor import Termination... | kcheryatov/zeebe-example | app/event_processors/order_action_service/order_action_kafka_event_consumer_service.py | order_action_kafka_event_consumer_service.py | py | 2,448 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.getenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 20,
... |
38511120207 | # imports
import os
from datetime import datetime
from flask import (Flask, flash, render_template, request, session, url_for,
redirect)
from flask_pymongo import PyMongo
from bson.objectid import ObjectId
from pymongo.message import query
from werkzeug.security import generate_password_hash, check_p... | bozy15/recipe-pod | app.py | app.py | py | 10,214 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_nu... |
33393405899 | import cv2 as cv
import numpy as np
cap = cv.VideoCapture(0)
if not cap.isOpened():
print('Camera open failed')
exit()
print('Frame width : ', int(cap.get(cv.CAP_PROP_FRAME_WIDTH)))
print('Frame height : ', int(cap.get(cv.CAP_PROP_FRAME_HEIGHT)))
print('Frame count : ', int(cap.get(cv.CAP_PROP_FRA... | durumi99/OpenCV | 과제 1/3.py | 3.py | py | 1,377 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FRAME_WIDTH",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cv2.CAP_PROP_FRAME_HEIGHT",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_... |
4510160425 | import pygame
from pygame.locals import *
class game(object):
def __init__(self):
pygame.init()
pygame.font.init()
self.WIDTH=1024 # Initialising screen Width
self.HEIGHT=680 # Initialising screen height
self.screen=pygame.display.set_mode((self.WIDTH,self.HEIGHT)) # Ini... | karanpathak/pygame_test | game.py | game.py | py | 4,784 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.font.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mode",
... |
12904138645 | from random import randrange, getrandbits
from gmpy2 import mpz
# define length of prime to be found
bit_length = 10
def get_odd_rand(bit_length):
return mpz(getrandbits(bit_length) | 1 << (bit_length - 1) | 1)
def test_strong_prime(n, s, t):
a = randrange(2, n - 1)
b = pow(a, t, n)
if (b == 1) or ... | pereira/lmat2440 | miller-rabin-count.py | miller-rabin-count.py | py | 1,160 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "gmpy2.mpz",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "random.getrandbits",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "random.randrange",
"line_number": 13,
"usage_type": "call"
}
] |
38042083782 | from flask import Flask, render_template, request
from nltk.tokenize import word_tokenize
from nltk.stem import PorterStemmer
from nltk.corpus import stopwords
from math import log10
app = Flask(__name__)
class ExtendedBooleanRetrieval:
def __init__(self, documents):
self.documents = documents
sel... | ardhln/extended_boolean | app.py | app.py | py | 6,555 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "nltk.ste... |
72531795709 | # pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
from collections.abc import Iterator
from pathlib import Path
from typing import Any
import pytest
from models_library.services import ServiceKey, ServiceVersion
from models_library.user_preferences import (
FrontendUserPreference,
NoPre... | ITISFoundation/osparc-simcore | packages/models-library/tests/test_user_preferences.py | test_user_preferences.py | py | 4,622 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "models_library.services.ServiceKey",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "models_library.services.ServiceVersion",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "pydantic.parse_obj_as",
"line_number": 22,
"usage_type": "call"... |
3344416579 | import string
import re
from abc import ABC
import numpy as np
import numpy.random as random
import nlpaug.augmenter.char as nac
from nlpaug.util import Method
import app.services.spelling.utils as utils
TOKENIZER_REGEX = re.compile(r'(\W)')
COMPOSITION_CHARS = ['á', 'à', 'ạ', 'ả', 'ã', 'â', 'ấ', 'ầ', 'ậ', 'ẩ', 'ẫ',... | hieunt2501/text-augmentation | app/services/spelling/modules/base_module.py | base_module.py | py | 14,182 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "string.punctuation",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "nlpaug.augmenter.char.CharAugmenter",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_n... |
41003512849 | #import torch
#import torch.nn as nn
#import os
#import sys
import numpy as np
#import time
import argparse
#from argparse import Namespace
from loading_utils import *
import matplotlib.pyplot as plt
from copy import copy
'''
Markov Process 1
'''
tp = 0.05
# 0 1 2 3 4 5 6 7 ... | rkruser/granger-causal-frames | general_interface/artificial_data.py | artificial_data.py | py | 16,885 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 36... |
7794055874 |
from django.contrib import admin
# Local Django
from . models import Institute, Department, Course
# Register your models here.
class InstituteAdmin(admin.ModelAdmin):
list_display = ('user', 'name', 'website')
list_display_links = ('user', 'name', 'website')
search_fields = ('user', 'name', 'short_nam... | amjedsaleel/Institute-Management | institute/admin.py | admin.py | py | 891 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 16,
"usage_type": "attribute"
... |
73819867066 | from refactors.ga_hyper.options import options, options_phase0
from tensorflow import keras
from tensorflow.keras import Input, Model
from tensorflow.keras.layers import Conv2D, BatchNormalization, Dense, Add, GlobalAveragePooling2D
import pprint
pp = pprint.PrettyPrinter(indent=4)
import numpy as np
import wa... | GAntonacci95/room_shape_classification | src/refactors/ga_hyper/organism.py | organism.py | py | 7,025 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pprint.PrettyPrinter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.backend.clear_session",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.backend",
"line_number": 35,
"usage_type": "attribute"
},
... |
36089689738 | from __future__ import unicode_literals
# import stdlib
import re
import os
import time
import uuid
import tempfile
from scp import SCPClient
import paramiko
import hashlib
import socket
from datetime import datetime
# import third party lib
from netaddr import IPAddress
from netaddr.core import AddrFormatError
from... | napalm-automation/napalm-nxos | napalm_nxos_ssh/nxos_ssh.py | nxos_ssh.py | py | 57,431 | python | en | code | 10 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "re.M",
"line_number": 85,
"us... |
33854286401 | import os
from pymongo import MongoClient
import requests
from datetime import datetime
import re
# These Envars are crucical to function, so throws error if not found
try:
MONGO_URI = os.environ.get('MONGODB_URI')
API_KEY = os.environ['APIKEY']
except KeyError as e:
print(f"ERROR: Environment variable: {e... | akenworthy87/getAddressAPI-Printer | getAddressAPI-Printer.py | getAddressAPI-Printer.py | py | 3,616 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pymongo.MongoClient",
... |
74636551868 | #!/bin/env python3
import sys
import PIL.Image as Image
import numpy as np
import websockets
import base64
import os
png = 0
def transform(string):
if len(string) > 7 and string[:7] == "\x1b[1;32m":
return (0, 255, 0)
elif len(string) > 7 and string[:7] == "\x1b[1;33m":
return (255, 255, 0)
... | Afourcat/CoreWar-Online | link/dumper.py | dumper.py | py | 1,474 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "websockets.connect",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_... |
3045127293 | #*******UPDATE 07/10/2020 This file is no longer useful as the Alloy output is in JSON format
#*******TODO: CHANGE ALL CODE HERE TO JSON alloy output************
'''
Description: This file requires the Alloy output file in "alloyXMLFile" and the robots database db.Robots_db.xml
Author: Gricel Vazquez
Last u... | Gricel-lee/Multi-Robot-Task-Allocation | system_0/utils/utilsFunctions/ParseAlloyOutput.py | ParseAlloyOutput.py | py | 5,013 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.path.abspath",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
25051753563 | # from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.contrib.auth import login, authenticate, logout
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from .forms import PostForm, CommentForm, LoginForm
from .models import Post... | oxleberry/sharit | sharit_project/sharit/views.py | views.py | py | 4,212 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.auth.forms.UserCreationForm",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.authenticate",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.login",
"line_number": 24,
"usage_type": ... |
14038557311 | import tkinter as tk
import tkinter.font as tkFont
from tkinter import ttk
from PIL import Image, ImageTk
from graphs import *
fourier_commun_functions=["Onda cuadrada","Tren de pulsos rectangulares", "Onda diente de sierra", "Onda triangular", "Función seno rectificado de media onda","Función seno rectificado de onda... | StormShadow010/Fourier-Project | main.py | main.py | py | 4,528 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tkinter.Toplevel",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "tkinter.Label",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_n... |
27200148959 | from inspect import trace
from os import sep
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as st
from collections import namedtuple
from scipy.optimize import minimize
import pickle
from scipy import stats
# Define the candidate distributions
# DISTRIBUTIONS = [
# st.alp... | powerpratik/distributed_storage_trace_generator | script_nexus.py | script_nexus.py | py | 8,760 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scipy.stats.alpha",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "scipy.stats",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "scipy.stats.beta",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "scipy.stats.... |
2688688847 | """Initial
Revision ID: 3fc2a567e75c
Revises:
Create Date: 2021-06-24 13:05:57.336714
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '3fc2a567e75c'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated ... | BossOfCreeps/CFT_test | alembic/versions/3fc2a567e75c_initial.py | 3fc2a567e75c_initial.py | py | 2,125 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "alembic.op.create_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
10622082576 | import requests
import sys
def main():
if len(sys.argv) == 2:
try:
response = requests.get("https://blockchain.info/ticker")
data = {}
data = response.json()
bitcoin_usd_value_15m = data["USD"]["15m"]
print("$", bitcoin_usd_value_15m*float(sys.ar... | HyanLucas/CS50P | Libraries/bitcoin.py | bitcoin.py | py | 568 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": ... |
69814430908 | from azureml.core import RunConfiguration
# Create PipelineData to hold the output
translated_output = PipelineData("translated_output", datastore=ws.get_default_datastore())
# Pipeline parameters
text_to_translate_param = PipelineParameter(name="text_to_translate", default_value="Hello World")
target_language... | dereknguyenio/aml-translation-pipeline-component | 4-create-pipeline.py | 4-create-pipeline.py | py | 1,365 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "azureml.core.RunConfiguration",
"line_number": 11,
"usage_type": "call"
}
] |
41283393861 | from .base import WebhookRequestParserBase
class GitLabRequestParser(WebhookRequestParserBase):
def get_matching_projects(self, request_headers, request_body, action):
import json
data = json.loads(request_body)
repo_urls = []
gitlab_event = 'x-gitlab-event' in request_headers ... | olipo186/Git-Auto-Deploy | gitautodeploy/parsers/gitlab.py | gitlab.py | py | 1,519 | python | en | code | 1,365 | github-code | 6 | [
{
"api_name": "base.WebhookRequestParserBase",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 9,
"usage_type": "call"
}
] |
10944511237 | # Làm nhân vật
import pygame
from option import Option
SCREEN_WIDTH = Option.WITDH(0)
SCREEN_HEIGHT = Option.HEIGHT(0)
ATTACK_WIDTH = 0
ATTACK_Y = 1
ATTACK_HEIGHT = 0
RED = (255, 0, 0)
GREEN = (0,255,0)
YELLOW = (255,255,0)
WHITE = (255,255,255)
#pygame.Rect((x, y, 80, 180))
class Fighter(pygame.sprite.Sprite):
... | longne123456/FirstGame | Fighter.py | Fighter.py | py | 8,211 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "option.Option.WITDH",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "option.Option",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "option.Option.HEIGHT",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "option.Option",
... |
28837853241 | from aiogram import types
from aiogram.dispatcher import FSMContext
from app.utils.shortener import get_lang
from app.middlewares.i18n import _
async def change_language(query: types.CallbackQuery, state: FSMContext):
data = query.data.split(',')[1]
async with state.proxy() as state_data:
state_data... | Divaltor/URLShortenerBot | app/handlers/callbacks.py | callbacks.py | py | 980 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "aiogram.types.CallbackQuery",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "aiogram.types",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "aiogram.dispatcher.FSMContext",
"line_number": 8,
"usage_type": "name"
},
{
"api_nam... |
22164886027 | from torch import nn as nn
import torch
class SimpMLP(nn.Module):
def __init__(self, noise_var=0.5) -> None:
super().__init__()
self.rep_layers = nn.Sequential(
nn.Linear(784, 500),
nn.ReLU(),
nn.Linear(500,10),
nn.Sigmoid()
)
sel... | nimasheikh/discrete-representation | pytorch/models.py | models.py | py | 1,097 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
29780886656 | from django.urls import path
from . import views
urlpatterns = [
path('', views.about, name="about"),
path('index', views.index, name="index"),
path('about', views.about, name="about"),
path('programerarecord', views.programerarecord, name="programerarecord"),
path('programerapeople', views.progr... | ecds/post45 | post45/app/urls.py | urls.py | py | 804 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
26403112790 | import os
import sys
import glob
from cx_Freeze import setup, Executable
version = next(open("../version.txt")).rstrip()
docfiles = glob.glob(os.path.join("..", "docs", "*.html"))
docfiles_dest = [x.replace("..\\docs", "Docs") for x in docfiles]
assert len(docfiles) > 0
import os.path
PYTHON_INSTALL_DIR = os.path.di... | gausssum/gausssum | src/setup.py | setup.py | py | 1,366 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "glob.glob",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number":... |
27251051826 | import matplotlib.pyplot as plt
import numpy as np
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def plot():
x = np.linspace(-6, 6, 100)
y = sigmoid(x)
plt.plot(x, y, c='b')
x = np.linspace(-2.5, 2.5, 10)
y = 0.235 * x + 0.5
plt.plot(x, y, c='b', linestyle='--')
plt.vlines(-1.1, -0.1... | moon-hotel/DeepLearningWithMe | Archived/02_ConvolutionalNN/07_BN/pic_1_sigmoid.py | pic_1_sigmoid.py | py | 467 | python | en | code | 116 | github-code | 6 | [
{
"api_name": "numpy.exp",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
38777161136 | from django.core.management.base import BaseCommand
from travel_maker.google_data_collector.management.collectors import GooglePlaceInfoCollector, \
GooglePlaceReviewInfoCollector
class Command(BaseCommand):
help = 'Collect google data'
def __init__(self):
super(Command, self).__init__()
... | gsroot/travel_maker | travel_maker/google_data_collector/management/commands/collectgoogledata.py | collectgoogledata.py | py | 599 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "travel_maker.google_data_collector.management.collectors.GooglePlaceInfoCollector",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "travel_maker.google_data... |
6717361917 | import datetime
from django.test import TestCase
from django.utils import timezone
from .models import ProductsHasReworksmanager,LogsManager,Batchs,ProductsHasReworks,Products,Logs,Tests,TestBenchs,Manufacturers,SerialNumbers,Reworks,Models
# Create your tests here.
class ProductsHasReworksModelTests(TestCase):
de... | kiriudo/ProjetTestBench | reworking/tests.py | tests.py | py | 2,656 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.test.TestCase",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.utils.timezone.now",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.utils.timezone",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "dat... |
33247468084 | import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix
# import eli5
dataset = pd.read_csv("../data/sample_data.csv")
train, test = train_test_... | Beau-Smit/toxic-comment | src/models/logistic_tfidf.py | logistic_tfidf.py | py | 1,497 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.text.TfidfVectorizer",
"line_number": 17,
"usage_type"... |
32584189454 | from collections import defaultdict
from threading import Event
from time import sleep
from typing import DefaultDict
from ..logger import LoggerManager
from ..registry.registered.actors import RegisteredActors
from ...component import BasicComponent
from ...connection import MessageToSend
from ...types import Message... | Cloudslab/FogBus2 | containers/master/sources/utils/master/profiler/dataRate.py | dataRate.py | py | 4,529 | python | en | code | 17 | github-code | 6 | [
{
"api_name": "component.BasicComponent",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "logger.LoggerManager",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "typing.DefaultDict",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "typi... |
32741010963 | import matplotlib.pyplot as plt
import numpy as np
plt.cm.register_cmap(
cmap=plt.cm.colors.LinearSegmentedColormap.from_list(
"p:sign", [(0.1, 0, 0.7), (0, 0, 0), (0.8, 0, 0.1)],
)
)
trajectory = np.loadtxt("_output.dat")
n = (trajectory.shape[1] - 1) // 2
t = trajectory[:, 0]
q = trajectory[:, 1:... | snsinfu/bit5 | test354/plot.py | plot.py | py | 974 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.cm.register_cmap",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.cm",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 5,
"usage_type": "name"
},
{
"api_n... |
24219475634 | import configparser
import redis
from datetime import datetime
from .objects import User
from .constants import SaveState
from ._scripts import get_scripts
config = configparser.ConfigParser()
config.read('config/flaskcap.ini')
POOL = redis.ConnectionPool(host=config['redis']['hostname'],
... | willcipriano/flaskcap | flaskcap/repository.py | repository.py | py | 1,438 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "redis.ConnectionPool",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "redis.Redis",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "_scripts.ge... |
17630759164 | #!/usr/bin/python3
from random import shuffle, choice
from itertools import combinations, permutations
from math import sqrt
from scipy.stats import norm
from pprint import pprint
n_run = 10000000
def di_average(n=10):
data = list(range(1, n+1))
shuffle(data)
total = 0.0
total_comb = 0
for each_i... | magicknight/zhouli | di/q1.py | q1.py | py | 1,723 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "random.shuffle",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "itertools.combin... |
74472076346 | import json
def zapisz(kolekcja, nazwa_pliku):
with open(nazwa_pliku, 'w') as plik:
json.dump(kolekcja, plik)
kolekcja = [
{'Tytuł': 'Rok 1984 1', 'Gatunek': 'Fantasy', 'Autor': 'Gorge Orwell', 'isbn': '7463528561'},
{'Tytuł': 'Birmańskie dni', 'Gatunek': 'Literatura Pięka', 'Autor': 'Gorg... | Lisiozmur/Njpo | Ćwiczenie2/Zadanie3.py | Zadanie3.py | py | 1,167 | python | pl | code | 0 | github-code | 6 | [
{
"api_name": "json.dump",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 16,
"usage_type": "call"
}
] |
5192984648 | import pandas as pd
import numpy as np
from numpy import mean
from numpy import std
import matplotlib.pyplot as plt
import scipy.io
import scipy.signal
from scipy.stats import skew, kurtosis
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
from sklearn.metrics import clas... | NibrasAz7/Binary_EEG_Identificatiom | Binary_EEG_Identification.py | Binary_EEG_Identification.py | py | 9,137 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "sys.version",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "scipy.io.io.loadma... |
75224158268 | import asyncio
import discord
from discord.ext import commands
import youtube_dl
from discord import app_commands, Interaction
# Suppress noise about console usage from errors
youtube_dl.utils.bug_reports_message = lambda: ''
ytdl_format_options = {
'format': 'bestaudio/best',
'outtmpl': '%(extractor)s-%(id)s... | Alexici/discordpybot | cogs/Music.py | Music.py | py | 4,396 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "youtube_dl.utils",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "youtube_dl.YoutubeDL",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "discord.PCMVolumeTransformer",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_n... |
23608891424 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import pynbody, sys
from pynbody.analysis import profile, angmom, halo
from pynbody import units, config
import pynbody.filt as filt
import socket
import pandas as pd
from pynbody.analysis import luminosity as lum
import os, glob
#Run with
#%run /h... | CharlotteRuth/python_analysis | plotColumnDen.py | plotColumnDen.py | py | 16,496 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.shape",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.meshgrid",
"line_numb... |
12400974079 | from flask import Flask, request, jsonify
from flask_cors import CORS
from flask_sqlalchemy import SQLAlchemy
from os import environ
app = Flask(__name__)
CORS(app)
# comment out when using docker
# app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+mysqlconnector://root:root@localhost:3306/transaction'
# unc... | danellegoh/is213 | microservice/transaction.py | transaction.py | py | 2,497 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_numbe... |
5266322122 | from posixpath import abspath
from typing import KeysView
from django.db.models.query import InstanceCheckMeta
from django.template import RequestContext
from numpy import dtype
import csv
from main import resume_parser
from .models import Document, Education, Experience, Resumes, Score, Skills,user_directory_path
fro... | nomanajmal009/Automatic-Resume-Ranking | AutomaticResumeRanking/main/views.py | views.py | py | 9,136 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.shortcuts.render",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 40,
"usage_type": "call"
},
{
"api_name"... |
5891445840 | import openai
openai.api_key = "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"
response = openai.Completion.create(
model="text-davinci-003",
prompt="我爱你,gpt",
temperature=0,
max_tokens=100,
top_p=1,
frequency_penalty=0,
presence_penalty=0,
)
message = response.choices[0... | daazhuai/campus-robot-based-on-paddlepaddle-and-chatGPT | chatGPT.py | chatGPT.py | py | 350 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "openai.api_key",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "openai.Completion.create",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "openai.Completion",
"line_number": 5,
"usage_type": "attribute"
}
] |
2519294122 | from ppro.job_scheduler.framework.kafka_mock import subscribe, Producer
from ppro.job_scheduler.framework.logger import Logger
from ppro.job_scheduler.models.event import Event, Payload, Request
from datetime import datetime
from ppro.job_scheduler.models.topics import Topics
import time
logger = Logger.get_logger(__n... | zandrewitte/job-scheduler | ppro/job_scheduler/consumers/mock_kafka.py | mock_kafka.py | py | 1,696 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "ppro.job_scheduler.framework.logger.Logger.get_logger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "ppro.job_scheduler.framework.logger.Logger",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "ppro.job_scheduler.framework.kafka_mock.subscribe"... |
72935782587 | from collections import deque
class Solution:
def updateMatrix(self, mat: List[List[int]]) -> List[List[int]]:
# Store the number of rows and columns
m, n = len(mat), len(mat[0])
# Create a queue to use for BFS
q = deque()
# Iterate through each value in th... | Anuj-gr8/Leet-code-solutions | 0542-01-matrix/0542-01-matrix.py | 0542-01-matrix.py | py | 1,699 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 9,
"usage_type": "call"
}
] |
12203460831 | from bs4 import BeautifulSoup as soup
import pprint, os, re, requests
# This function gets the content and caches it in the working directory
def get_site_content(cache_filename, url):
if not os.path.exists(filename):
html_content = requests.get(url).text
with open(filename, "w", encoding='UTF-8') as f:
f.writ... | zero41120/PourmandLab | Webscraper/web_scrape_google.py | web_scrape_google.py | py | 2,905 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_n... |
31606097385 | from collections import namedtuple
from functools import partial
# Nodes
Control = namedtuple('Control', ['type', 'signals'])
Signal = namedtuple('Signal', ['name', 'index', 'inverted'])
Node = namedtuple('Node', ['type', 'signals'])
Output = partial(Node, type='out')
Condition = partial(Node, type='in')
Jump = named... | rrader/ADCS | CAD/src/adcs/consts.py | consts.py | py | 3,123 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "collections.namedtuple",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "fun... |
26113141595 | __authors__ = ["T. Vincent"]
__license__ = "MIT"
__date__ = "03/01/2019"
import unittest
import logging
import numpy
import pytest
from silx.utils.testutils import ParametricTestCase
from silx.gui.utils.testutils import SignalListener
from silx.gui.utils.testutils import TestCaseQt
from silx.gui import qt
from silx... | silx-kit/silx | src/silx/gui/plot/test/testPlotWidget.py | testPlotWidget.py | py | 84,119 | python | en | code | 106 | github-code | 6 | [
{
"api_name": "numpy.arange",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "utils.PlotWidgetTestCase",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "silx.utils.te... |
599300245 | import json
import time
from app import status
from app import view_util
from app import views
from app.config import app_name
from app.config import navigation_bar
from flask import Flask
def create_app(environment):
flask = Flask(__name__)
flask.config.from_pyfile('config.py')
config = load_config(env... | null | app/app.py | app.py | py | 1,500 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.config.from_pyfile",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.config",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
... |
277067047 | __author__ = 'Sefa Sahin Koc'
__email__ = 'shnkoc@gmail.com'
import psutil
import utils
from proc_info import ProcTotalInfo
"""
This class stores list of processes with the process name given. Their children are also included.
It collects data about these ones.
"""
class TProcessList:
def __init__(self, processna... | null | bekci/process_list.py | process_list.py | py | 5,666 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "utils.get_pid_byname",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "psutil.Process",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "proc_info.ProcTotalInfo",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "psutil.Pr... |
259046727 | """
This is a Tank Game based on PocketTanks, made in Python 3 using Pygame and Pymunk for physics
"""
from random import randint
import sys
import pygame
import pymunk
import pymunk.pygame_util
# CLASS AND FUNCTION IMPORTS
from ground import Ground
from tank import Tank
from text import text
class PyTanksIO:
"... | null | scripts/main.py | main.py | py | 5,851 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.display.set_mode",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_caption",
"line_number": 26,
"usage_type": "call"
},
{
"api_name":... |
228056187 | from sqlalchemy.orm import sessionmaker
from models import Deals, db_connect, create_deals_table
class LivingSocialPipeline(object):
"""LivingSocial pipeline for storing scraped items in database"""
def __init__(self):
"""
Initialize database connection and sessionmaker
Creates deals table
"""
... | null | scrape/living_social/scraper_app/pipelines.py | pipelines.py | py | 1,095 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.db_connect",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.create_deals_table",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 13,
"usage_type": "call"
},
{
"api_name"... |
246049111 | # -*- encoding: utf-8 -*-
import locale
from pyramid.config import Configurator
from pyramid.settings import asbool
from sqlalchemy import engine_from_config
from paste.translogger import TransLogger
from .models import (
DBSession,
Base,
)
def main(global_config, **settings):
""" This function ret... | null | tvhadikode/__init__.py | __init__.py | py | 1,769 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlalchemy.engine_from_config",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "models.DBSession.configure",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "models.DBSession",
"line_number": 20,
"usage_type": "name"
},
{
"api_nam... |
447459002 | # -*- coding: utf-8 -*-
# Author: HaiNT
import json
from flask import Blueprint, request, jsonify
from .. import exceptions
from ..oauth2 import oauth
from ..utils.decorators import consumes, use_args
from ..model.oauth2_tokens import Oauth2TokensModel
api = Blueprint('api_oauth', __name__, url_prefix='/api/v1/oauth'... | null | todo-list/backend/app/api/api_oauth.py | api_oauth.py | py | 3,044 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Blueprint",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "utils.decorators.consumes",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "utils.decorators.use_args",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "o... |
38596926 | import cv2
import parinya
import pafy #pip install pafy # pip install --upgrade youtube_dl
url = 'https://youtu.be/iv89oPjBkGY'
vPafy = pafy.new(url)
play = vPafy.getbest(preftype="mp4") # (preftype="webm") not work!
cap = cv2.VideoCapture(play.url)
yolo = parinya.YOLOv3('coco.names','yolov3-tiny.cfg','yolov... | null | testYolo3.py | testYolo3.py | py | 576 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pafy.new",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "parinya.YOLOv3",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number"... |
296723356 | import re
import time
import pandas as pd
from selenium import webdriver
import vaxutils
def main():
data = {
"location": "Guatemala",
"source_url": "https://gtmvigilanciacovid.shinyapps.io/3869aac0fb95d6baf2c80f19f2da5f98",
"vaccine": "Moderna",
}
with webdriver.Chrome() as dr... | null | Applied_Plotting_Charting_and_Data_Representation_in_Python/data/covid-19-data-master/scripts/scripts/vaccinations/automations/incremental/guatemala.py | guatemala.py | py | 1,315 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
185515581 | #!/usr/bin/env python3
# (c) 2022 Pat Beagan: MIT License
import os
import time
import subprocess
import argparse
from sys import argv
from os.path import join, getsize
import hashlib
import re
description = """
New Script.
"""
verbosity = 0
verbosity_level = {
"quiet": (None, -100),
"error": ("E: ", -2),
... | null | scripts/file_management/shard.py | shard.py | py | 3,653 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists"... |
14623401 | """
Simple NeuroImaging data visualization and manipulation
========================================================
Simple example to show data manipulation and visualization.
"""
# Fetch data ################################################################
from nilearn import datasets
haxby_files = datasets.fetch_h... | null | plot_visualization.py | plot_visualization.py | py | 2,762 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "nilearn.datasets.fetch_haxby_simple",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "nilearn.datasets",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "nibabel.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "num... |
634710095 | def resolve():
n, a = map(int, input().split())
x = list(map(int, input().split()))
max_x = max(max(x), a)
dp = [[[0] * (n * max_x + 1) for _ in range(n + 1)] for _ in range(n + 1)]
dp[0][0][0] = 1
for i in range(n + 1):
for j in range(n + 1):
for k in range(n * max_x + 1):
... | null | ABC-C/ABC044C.py | ABC044C.py | py | 1,735 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "unittest.TestCase",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout",
... |
139839730 | from django import forms
from django.core.exceptions import ValidationError
from django.contrib.auth.models import User
from PIL import Image as PILImage
from form_utils.widgets import ImageWidget
from profile.models import UserProfile, CollaborationChoice, ResearchField
attrs_dict = {'class': 'required'}
class Twit... | null | seabirds/profile/forms.py | forms.py | py | 2,916 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.forms.CharField",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.core.exceptions.ValidationError",
"line_number": 20,
"usage_type": "call"
},
{
"a... |
156296361 | from sklearn import datasets
import numpy as np
from sklearn import cross_validation
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score
from sklearn.ensemble import RandomForestClassifier
def initiate_data(i... | null | SklearnTitanic.py | SklearnTitanic.py | py | 2,127 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.cross_validation.train_test_split",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "sklearn.cross_validation",
"line_number": 39,
"usage_type": "name"
},
{
... |
436416668 | from __future__ import print_function
import torch
import torch.nn as nn
import torch.utils.data
from torch.autograd import Variable
import torch.nn.functional as F
import math
from submodule import *
import sys
sys.path.append("../")
from utils.activations_autofn import MishAuto
from utils.selectedNorm import *
impor... | null | models/CVSMNet_SoftArgMin_increaseDim.py | CVSMNet_SoftArgMin_increaseDim.py | py | 4,987 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.ReLU",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line... |
604829350 | import time
import cPickle
import numpy as np
import tensorflow as tf
from matplotlib import pyplot as plt
from tensorflow.contrib.layers import conv2d, bias_add, linear, batch_norm
def relu(X, leak=0.1):
return tf.select(tf.less(X, 0.0), leak*X, X)
# variables
initial_learning_rate = 1.0
num_batches_for_decay = ... | null | projects/project2/cifar_4.py | cifar_4.py | py | 6,563 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.select",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tensorflow.less",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tensorflow.train.AdamOptimizer",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "tensor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.