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
73815019386
import logging from os import environ from unittest.mock import patch import pytest from bonobo import settings from bonobo.errors import ValidationError TEST_SETTING = "TEST_SETTING" def test_to_bool(): assert not settings.to_bool("") assert not settings.to_bool("FALSE") assert not settings.to_bool("N...
python-bonobo/bonobo
tests/test_settings.py
test_settings.py
py
1,851
python
en
code
1,564
github-code
6
[ { "api_name": "bonobo.settings.to_bool", "line_number": 14, "usage_type": "call" }, { "api_name": "bonobo.settings", "line_number": 14, "usage_type": "name" }, { "api_name": "bonobo.settings.to_bool", "line_number": 15, "usage_type": "call" }, { "api_name": "bonob...
74183020029
# -*- coding: utf-8 -*- from django.conf import urls from django.contrib.auth import decorators from .views import HistoriaCreateView from .views import HistoriaDetailView from .views import HistoriaPacienteListView from .views import HistoriaUpdateView HISTORIA_CREATE_URL_NAME = 'historia_create' HISTORIA_UPDATE_URL...
gustavoatt/consultas
consultas_proyecto/historias_app/urls.py
urls.py
py
1,138
python
en
code
0
github-code
6
[ { "api_name": "django.conf.urls.patterns", "line_number": 15, "usage_type": "call" }, { "api_name": "django.conf.urls", "line_number": 15, "usage_type": "name" }, { "api_name": "django.conf.urls.url", "line_number": 16, "usage_type": "call" }, { "api_name": "djang...
25549629589
# coding: utf-8 __author__ = "Ciprian-Octavian Truică" __copyright__ = "Copyright 2020, University Politehnica of Bucharest" __license__ = "GNU GPL" __version__ = "0.1" __email__ = "ciprian.truica@cs.pub.ro" __status__ = "Production" from tokenization import Tokenization from vectorization import Vectorization from t...
cipriantruica/news_diffusion
news-topic-modeling/main.py
main.py
py
2,856
python
en
code
0
github-code
6
[ { "api_name": "sys.argv", "line_number": 35, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 36, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 37, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number...
33875332851
import torch from care_nl_ica.independence.hsic import HSIC class IndependenceChecker(object): """ Class for encapsulating independence test-related methods """ def __init__(self, hparams) -> None: super().__init__() self.hparams = hparams self.test = HSIC(hparams.num_permut...
rpatrik96/nl-causal-representations
care_nl_ica/independence/indep_check.py
indep_check.py
py
1,920
python
en
code
12
github-code
6
[ { "api_name": "care_nl_ica.independence.hsic.HSIC", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.no_grad", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number": 39, "usage_type": "attribute" }, { "api_name": "to...
74553223546
import time from datetime import datetime, timedelta from num2words import num2words # Todo: returns an timedelta: def calculate_time(sleep_time: float) -> timedelta: """Function to calculate time to perform it's action, which is takes a . Args: sleep_time (float) : Time that the function will t...
bvmcardoso/pwn
challenge.py
challenge.py
py
3,411
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime....
73580429947
import torch import torchvision import torchvision.datasets as datasets import os import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm import math def convert(imgf, labelf, outf, n): f = open(imgf, "rb") o = open(outf, "w") l = open(labelf, "rb") f.read(16...
smit-1999/NaiveBayes
nn.py
nn.py
py
9,372
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.title", "line_number": 35, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 35, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.imshow", "line_number": 36, "usage_type": "call" }, { "api_name": "ma...
15821968201
#!/usr/bin/env python import rospy from std_msgs.msg import Bool import psutil import argparse def monitorAvailableMemory(memory_upperlimit_percent): """ This function is used to monitor the memory utilization and throw an error if it exceeds a preset value. Arguments: memory_upperlimit_percent...
robotpt/ros-data-capture
src/tools/mem_use_watcher/scripts/watcher.py
watcher.py
py
1,420
python
en
code
0
github-code
6
[ { "api_name": "psutil.virtual_memory", "line_number": 19, "usage_type": "call" }, { "api_name": "rospy.Publisher", "line_number": 28, "usage_type": "call" }, { "api_name": "std_msgs.msg.Bool", "line_number": 29, "usage_type": "argument" }, { "api_name": "rospy.ini...
75018787708
# -*- coding: utf-8 -*- """ Created on Tue Jun 7 22:05:01 2022 @author: Marcin """ import numpy as np import matplotlib.pyplot as plt # Sigmoid activation function def sigmoid(X): out = 1.0 / (1.0 + np.exp(-X)) return out # Dervative of sigmoid funcition def sigmoid_derivative(X): retu...
MarcinJ7/kNN-implementation
NN.py
NN.py
py
3,321
python
en
code
0
github-code
6
[ { "api_name": "numpy.exp", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number":...
20342943646
import numpy as np import matplotlib.pyplot as mplt M = 10000 N = 50 s = np.zeros(M) number_of_cols = 0 for i in range(M): S_min = 0 S_plus = 0 for j in range(N): chooser_of_state = np.random.randint(2) if chooser_of_state == 1: S_min += 1 else: S_plus += 1 s_value = (S_plus - S_min)/2. if s_value n...
tellefs/FYS2160
Oblig1/oppgm.py
oppgm.py
py
545
python
en
code
0
github-code
6
[ { "api_name": "numpy.zeros", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.random.randint", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 14, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.h...
2116122344
""" A command line interface to the qcfractal server. """ import argparse import signal import logging from enum import Enum from math import ceil from typing import List, Optional import tornado.log import qcengine as qcng import qcfractal from pydantic import BaseModel, BaseSettings, validator, Schema from . imp...
yudongqiu/QCFractal
qcfractal/cli/qcfractal_manager.py
qcfractal_manager.py
py
42,285
python
en
code
null
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 26, "usage_type": "call" }, { "api_name": "enum.Enum", "line_number": 35, "usage_type": "name" }, { "api_name": "pydantic.BaseSettings", "line_number": 41, "usage_type": "name" }, { "api_name": "pydantic.Schema", ...
24219583345
# -*- coding: utf-8 -*- """ Created on 2022/9/23 @author: nhsiao 2022/9/5 avg_rsrp 改成 c_rsrp, 圖片從 2022/8/27閞始 2022/9/29 c_rsrp 改成 pos_first_rsrp, 圖片從 2022/9/23 閞始 """ import cx_Oracle import pandas as pd import matplotlib.pyplot as plt from matplotlib import dates as mpl_dates import gc import gzip from datetime imp...
tonhsiao/cnn_cbam
CNN_CBAM_Daily/generateImg.py
generateImg.py
py
18,040
python
en
code
0
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 20, "usage_type": "call" }, { "api_name": "warnings.filterwarnings", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 29, "usage_type": "call" }, { "api_name": ...
72532680189
# pylint:disable=protected-access # pylint:disable=redefined-outer-name from collections.abc import Awaitable, Callable from pathlib import Path from typing import AsyncContextManager import pytest from aiopg.sa.engine import Engine from faker import Faker from models_library.api_schemas_storage import FileUploadSche...
ITISFoundation/osparc-simcore
services/storage/tests/unit/test_simcore_s3_dsm.py
test_simcore_s3_dsm.py
py
4,006
python
en
code
35
github-code
6
[ { "api_name": "pydantic.parse_obj_as", "line_number": 27, "usage_type": "call" }, { "api_name": "pydantic.ByteSize", "line_number": 27, "usage_type": "argument" }, { "api_name": "pytest.fixture", "line_number": 25, "usage_type": "attribute" }, { "api_name": "pydan...
73944977468
from difflib import SequenceMatcher from elasticsearch import Elasticsearch import string INDEX = 'video-search' DOC_TYPE = 'video' es = Elasticsearch(['elasticsearch:9200']) def index_video(body): es.index(index=INDEX, doc_type=DOC_TYPE, body=body) es.indices.refresh(index=INDEX) def delete_index(): ...
colanconnon/cs410project
cs410videosearchengine/videosearchengine/search.py
search.py
py
1,263
python
en
code
0
github-code
6
[ { "api_name": "elasticsearch.Elasticsearch", "line_number": 8, "usage_type": "call" }, { "api_name": "spacy.lang.en.English", "line_number": 46, "usage_type": "call" }, { "api_name": "spacy.matcher.PhraseMatcher", "line_number": 47, "usage_type": "call" } ]
15910442299
import unittest from mock import Mock, call from six import StringIO from trashcli.restore.file_system import RestoreReadFileSystem, \ RestoreWriteFileSystem, FakeReadCwd from trashcli.restore.restore_cmd import RestoreCmd from trashcli.restore.trashed_file import TrashedFile, TrashedFiles def last_line_of(io):...
cloudlylooudy/trash-cli
tests/test_restore/restore_cmd/test_trash_restore_cmd.py
test_trash_restore_cmd.py
py
3,233
python
en
code
null
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 16, "usage_type": "attribute" }, { "api_name": "six.StringIO", "line_number": 18, "usage_type": "call" }, { "api_name": "six.StringIO", "line_number": 19, "usage_type": "call" }, { "api_name": "mock.Mock", "lin...
18843150286
import pytest from unittest import mock from types import SimpleNamespace from clean.exceptions import FilterDoesNotExist from clean.request.inout.ports import Response, Request from clean.request.inout.filter import Page, Sort from clean.use_case.common import SaveUseCase, RetrieveUseCase, UpdateUseCase, DeleteUseCas...
bahnlink/pyclean
tests/clean/use_case/test_common.py
test_common.py
py
3,835
python
en
code
0
github-code
6
[ { "api_name": "clean.use_case.common.SaveUseCase", "line_number": 14, "usage_type": "name" }, { "api_name": "types.SimpleNamespace", "line_number": 17, "usage_type": "call" }, { "api_name": "clean.use_case.case.BaseUseCase", "line_number": 22, "usage_type": "name" }, ...
25867867346
from SpeechEmotionRecognizer import SpeechEmotionRecognizer import pandas as pd import numpy as np import librosa from sklearn.preprocessing import StandardScaler, OneHotEncoder from sklearn.model_selection import train_test_split from keras.callbacks import ReduceLROnPlateau from keras.models import Sequential from k...
jsalinas98/SpeechEmotionRecognition
SpeechEmotionRecognizer/SER_CNN.py
SER_CNN.py
py
4,216
python
en
code
0
github-code
6
[ { "api_name": "SpeechEmotionRecognizer.SpeechEmotionRecognizer", "line_number": 12, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.hstack", "line_number": 25, "usage_type": "call" }, { "api_name...
28656442402
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms from torch.autograd import Variable from sklearn.metrics import mean_squared_error import models import helper_functions import pandas as pd import os...
jmandivarapu1/SelfNet-Lifelong-Learning-via-Continual-Self-Modeling
Split_MNIST_10x/getMeanNet.py
getMeanNet.py
py
4,781
python
en
code
4
github-code
6
[ { "api_name": "matplotlib.use", "line_number": 18, "usage_type": "call" }, { "api_name": "models.Net", "line_number": 29, "usage_type": "call" }, { "api_name": "models.Net", "line_number": 32, "usage_type": "call" }, { "api_name": "models.Net", "line_number": ...
36406111862
import os from textwrap import dedent import openai openai.api_key = os.getenv("OPENAI_KEY", "%%OPENAI_KEY%%") user_input = input() ml_prompt = dedent( """ You are an artificial intelligence bot named generator with a goal of generating a log format string for a given natural-language description of what a ...
dicegang/dicectf-2023-challenges
misc/mlog/chall/mlog/predict.py
predict.py
py
1,294
python
en
code
61
github-code
6
[ { "api_name": "openai.api_key", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 6, "usage_type": "call" }, { "api_name": "textwrap.dedent", "line_number": 10, "usage_type": "call" }, { "api_name": "openai.Completion.create"...
74506164668
from database import crm_db from typing import List from models.research import Research, ResearchIn from bson import ObjectId from pymongo.errors import DuplicateKeyError from fastapi import HTTPException async def read_researches(skip: int = 0, limit: int = 200): researchs = [] for research in ( aw...
MaximeRCD/cgr_customer_api
services/research.py
research.py
py
1,988
python
en
code
0
github-code
6
[ { "api_name": "database.crm_db.Research.find", "line_number": 13, "usage_type": "call" }, { "api_name": "database.crm_db.Research", "line_number": 13, "usage_type": "attribute" }, { "api_name": "database.crm_db", "line_number": 13, "usage_type": "name" }, { "api_n...
12774203513
from bs4 import BeautifulSoup import requests response = requests.get("http://stackoverflow.com/questions/") soup = BeautifulSoup(response.text, "html.parser") questions = soup.select(".question-summary") print(questions.get("id", 0)) for question in questions: print(questions.select_one(".question-hyperlink").ge...
AnantaJoy/Python-for-Geographers-v0.1
13-05-2023/Packages/web_crawler/app.py
app.py
py
396
python
en
code
1
github-code
6
[ { "api_name": "requests.get", "line_number": 4, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 5, "usage_type": "call" } ]
70281107068
import torch class VQAClassifier(torch.nn.Module): def __init__(self, hs, vs): super(VQAClassifier, self).__init__() # from: https://github.com/dandelin/ViLT self.vqa_classifier = torch.nn.Sequential( torch.nn.Linear(hs, hs * 2), torch.nn.LayerNorm(hs * 2), ...
esteng/ambiguous_vqa
models/allennlp/modules/rsa_vqa/vqa_classifier.py
vqa_classifier.py
py
476
python
en
code
5
github-code
6
[ { "api_name": "torch.nn", "line_number": 3, "usage_type": "attribute" }, { "api_name": "torch.nn.Sequential", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn.Linear", "l...
35619601544
from nltk.corpus import cmudict words = cmudict.entries() count = 0 for entry in words: if len(entry[1]) > 1: count += 1 # Percentage of words with more than one possible pronunciation print(1.0 * count / len(words))
hmly/nlp-solutions
c-02/2-12_cmudict.py
2-12_cmudict.py
py
231
python
en
code
0
github-code
6
[ { "api_name": "nltk.corpus.cmudict.entries", "line_number": 3, "usage_type": "call" }, { "api_name": "nltk.corpus.cmudict", "line_number": 3, "usage_type": "name" } ]
26041799986
from __future__ import annotations from pants.backend.scala.subsystems.scala import ScalaSubsystem from pants.backend.scala.util_rules.versions import ( ScalaArtifactsForVersionRequest, ScalaArtifactsForVersionResult, ) from pants.core.goals.repl import ReplImplementation, ReplRequest from pants.core.util_rule...
pantsbuild/pants
src/python/pants/backend/scala/goals/repl.py
repl.py
py
3,012
python
en
code
2,896
github-code
6
[ { "api_name": "pants.core.goals.repl.ReplImplementation", "line_number": 23, "usage_type": "name" }, { "api_name": "pants.core.util_rules.system_binaries.BashBinary", "line_number": 30, "usage_type": "name" }, { "api_name": "pants.backend.scala.subsystems.scala.ScalaSubsystem", ...
38038218212
""" References Machine Learning to Predict Stock Prices: https://towardsdatascience.com/predicting-stock-prices-using-a-keras-lstm-model-4225457f0233 Twitter Sentiment Analysis using Python https://www.geeksforgeeks.org/twitter-sentiment-analysis-using-python/ Streamlit 101: An in-depth introduction: htt...
qvinh-du/finalproject
finalproject.py
finalproject.py
py
13,804
python
en
code
0
github-code
6
[ { "api_name": "nltk.download", "line_number": 42, "usage_type": "call" }, { "api_name": "warnings.filterwarnings", "line_number": 50, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 52, "usage_type": "attribute" }, { "api_name": "datetime.date.t...
25012412373
#!/usr/bin/env python # -*- coding: utf-8 -*- """ pytorch-dl Created by raj at 7:48 AM, 7/31/20 """ import os import time import torch from dataset.iwslt_data import rebatch_source_only from models.decoding import batched_beam_search from models.utils.model_utils import load_model_state from onmt import opts, inputt...
patelrajnath/pytorch-dl
translate.py
translate.py
py
4,521
python
en
code
10
github-code
6
[ { "api_name": "onmt.utils.set_random_seed", "line_number": 21, "usage_type": "call" }, { "api_name": "models.utils.model_utils.load_model_state", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 23, "usage_type": "call" }, { ...
70766866107
from typing import Union, Tuple, List, Sequence from .base import BasePayload class FlowPayload(BasePayload): """ """ def payloads(self) -> Union[Tuple, List]: return findall_subpayload([self.__args__, self.__kwargs__]) def __make__(self, *args, **kwargs): raise NotImplementedError def...
ZSAIm/VideoCrawlerEngine
helper/payload/flow.py
flow.py
py
1,523
python
en
code
420
github-code
6
[ { "api_name": "base.BasePayload", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.List", "line_numbe...
75226771708
#............ Calculates average return for every time interval for every stock and store in the DB import pymongo import datetime import numpy as np myclient = pymongo.MongoClient("mongodb://localhost:27017/") historical_col = myclient["core"]["historical_data"] time_heat_map = myclient["core"]["analytics"][...
prashanth470/trading
source/analysis/time_heat_map.py
time_heat_map.py
py
4,241
python
en
code
0
github-code
6
[ { "api_name": "pymongo.MongoClient", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.size", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.size", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.size", "line_numbe...
17702310414
import os import shutil import time from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler # Construct the path to the download folder download_folder = os.path.join(os.path.expanduser('~'), 'Downloads') class FileSorter(FileSystemEventHandler): def on_created(self,...
phelannathan42/Download-Librarian
DLIBV0.04WATCHDOG.py
DLIBV0.04WATCHDOG.py
py
1,885
python
en
code
0
github-code
6
[ { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.expanduser", "line_number": 9, "usage_type": "call" }, { "api_name": "watchdog.events.FileSystemE...
27407521058
from livereload import Server, shell from pathlib import Path import sys cur_dir = Path(__file__).parent server = Server() if "no" not in sys.argv: exts = ("rst", "py", "jinja2") print(f"Watching file changes {exts}") cmd = shell("make html", cwd=str(cur_dir)) for ext in exts: # nested or ...
sudojarvis/xonsh
docs/serve_docs.py
serve_docs.py
py
499
python
en
code
null
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 5, "usage_type": "call" }, { "api_name": "livereload.Server", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "livereload.shell", "lin...
24905743163
import cadquery as cq import logging from types import SimpleNamespace as Measures log = logging.getLogger(__name__) # A parametric mount for stepper motors shaped as an L-bracket. class MotorMountL: def __init__(self, workplane, measures): """ A parametric stepper motor mount in the shape of an...
tanius/cadquery-models
motormount/motor_mount_l.py
motor_mount_l.py
py
4,389
python
en
code
11
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "cadquery.Workplane", "line_number": 36, "usage_type": "call" }, { "api_name": "cadquery.Workplane", "line_number": 93, "usage_type": "attribute" }, { "api_name": "types.Sim...
926305752
from http import HTTPStatus from unittest.mock import patch import pytest import requests from rotkehlchen.constants.assets import A_JPY from rotkehlchen.db.settings import DEFAULT_KRAKEN_ACCOUNT_TYPE, ROTKEHLCHEN_DB_VERSION, DBSettings from rotkehlchen.exchanges.kraken import KrakenAccountType from rotkehlchen.tests...
fakecoinbase/rotkislashrotki
rotkehlchen/tests/api/test_settings.py
test_settings.py
py
17,491
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "rotkehlchen.tests.utils.api.api_url_for", "line_number": 21, "usage_type": "call" }, { "api_name": "rotkehlchen.tests.utils.api.assert_proper_response", "line_number": 22, "usage_type"...
15548564668
import sys import re from typing import Dict, Union, List def get_symb_value(symb: Dict[str, str], context) -> (Union[str, int, bool], str): """ Get value and type of symbol. :param symb: XML argument :param context: Interpret class :return: Tuple of value and type """ if symb['type'] == ...
lukasvecerka23/ipp-hw
lib/utils.py
utils.py
py
4,409
python
en
code
0
github-code
6
[ { "api_name": "typing.Dict", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": ...
26581236560
from TrelloApi.TrelloConfig import Trello as tconfig import requests import datetime import json import re import os import threading import xlsxwriter class OpenFolderError(Exception): def __str__(self): return 'Diretório já exite' class GeraRelatorio(object): def __init__(self): self.Tr...
LeandroGelain/PersonalGit
2018-2019/Programas executaveis/tkinterApp_arquivosSemExe/TrelloApi/GeraRelatório.py
GeraRelatório.py
py
10,255
python
en
code
0
github-code
6
[ { "api_name": "TrelloApi.TrelloConfig.Trello", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.request", "line_number": 45, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 46, "usage_type": "call" }, { "api_name": "requests.re...
71718729148
import wx from . import GUIclasses2 as GUI from .DataClass2 import PointData from . import GPS import numpy as np from . import MapBase #Last update/bugfix 11.03,2010 simlk #Two GUI interfaces wrapping MapBase.py for ML-programs. Simple interface designed for in-field use.... class BasePanel(wx.Panel): #This o...
SDFIdk/nivprogs
MyModules/MLmap.py
MLmap.py
py
8,768
python
en
code
0
github-code
6
[ { "api_name": "wx.Panel", "line_number": 9, "usage_type": "attribute" }, { "api_name": "wx.Panel.__init__", "line_number": 12, "usage_type": "call" }, { "api_name": "wx.Panel", "line_number": 12, "usage_type": "attribute" }, { "api_name": "wx.TE_READONLY", "li...
30754602045
from collections import Counter for _ in range(int(input())): n = int(input()) if n < 3: input() print(-1) else: nb = list(map(int, input().split(' '))) cnt = Counter(nb) flag = True for k, v in cnt.items(): if v >= 3: print(k)...
Tanguyvans/Codeforces
784/B.py
B.py
py
412
python
en
code
0
github-code
6
[ { "api_name": "collections.Counter", "line_number": 13, "usage_type": "call" } ]
6807988061
import setuptools import os import codecs from setuptools import setup # https://packaging.python.org/guides/single-sourcing-package-version/ def read(rel_path): here = os.path.abspath(os.path.dirname(__file__)) with codecs.open(os.path.join(here, rel_path), 'r') as fp: return fp.read() def get_versi...
wesuuu/oo-tools
setup.py
setup.py
py
1,004
python
en
code
0
github-code
6
[ { "api_name": "os.path.abspath", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "codecs.open", "line_num...
7138653574
import sys sys.path.append(".") from argparse import ArgumentParser import json import os import numpy as np import torch from torch.utils.data import Dataset, DistributedSampler, DataLoader, SequentialSampler, RandomSampler from torch.optim import AdamW from callback.lr_scheduler import get_linear_schedule_with_warmup...
laohur/PoorBERT
v1/tasks/task.py
task.py
py
17,353
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "tasks.utils.TaskConfig", "line_number": 28, "usage_type": "call" }, { "api_name": "tools.common.init_...
19815525990
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index), url(r'^regprocess$', views.user), url(r'^jobs/new$', views.registration), url(r'^loginprocess$', views.login_process), url(r'^login$', views.login), url(r'^logout$', views.logout), ...
aidapira/handyhelper
apps/job_manager_app/urls.py
urls.py
py
724
python
en
code
0
github-code
6
[ { "api_name": "django.conf.urls.url", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.co...
8185206077
import json import yaml import subprocess def add_cluster_ips(cluster_name, save=True): """ Adds the IPs for the specified cluster. Args: cluster_name (str): The name of the cluster. save (bool, optional): Whether to save the IPs to the file. Defaults to False. Returns: dict...
chevalsumo/5G-Services-Placement-in-Dynamic-Multi-clusters
kind_automatisation/scripts/submariner_configuration/broker_context.py
broker_context.py
py
7,163
python
en
code
0
github-code
6
[ { "api_name": "subprocess.check_output", "line_number": 18, "usage_type": "call" }, { "api_name": "subprocess.check_output", "line_number": 19, "usage_type": "call" }, { "api_name": "subprocess.run", "line_number": 21, "usage_type": "call" }, { "api_name": "json.l...
40892321700
import os import discord import re import asyncio from keepAlive import KeepAlive from spotifySelfAPI import SpotifyAuthAccessToken, SpotifySearch, SpotifyPlaylistCreate, SpotifyPlaylistAdd from replaceBadKeywords import ReplaceBadKeywords from collections import OrderedDict from youtubeSelfAPI import YoutubePlaylistCr...
sarvagya6/discord-playlist-bot
main.py
main.py
py
7,019
python
en
code
1
github-code
6
[ { "api_name": "discord.Client", "line_number": 12, "usage_type": "call" }, { "api_name": "time.time", "line_number": 24, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 31, "usage_type": "attribute" }, { "api_name": "os.environ", "line_numbe...
74165330428
from tkinter import* from tkinter import ttk from tkinter import Tk from PIL import Image, ImageTk from student import student import os import tkinter from train import Train from facereco import Face_Reco from attendance import atendance from developer import developer from help import help ...
kg300902/Smart-Attendance-System
main.py
main.py
py
7,693
python
en
code
0
github-code
6
[ { "api_name": "PIL.Image.open", "line_number": 25, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 25, "usage_type": "name" }, { "api_name": "PIL.Image.ANTIALIAS", "line_number": 26, "usage_type": "attribute" }, { "api_name": "PIL.Image", "li...
4713040273
import os import re import json import numpy as np from tqdm import tqdm_notebook from collections import Counter base_path = 'LongSumm-data/extractive_summaries/' path_to_jsons = base_path + 'papers-jsons/' p_jsons = os.listdir(path_to_jsons) p_unread = [] section_1 = ['abstract'] section_2 = ['introduction', 'pr...
dchandak99/LongSumm
.ipynb_checkpoints/join_sections_manual-checkpoint.py
join_sections_manual-checkpoint.py
py
3,727
python
en
code
1
github-code
6
[ { "api_name": "os.listdir", "line_number": 12, "usage_type": "call" }, { "api_name": "tqdm.tqdm_notebook", "line_number": 27, "usage_type": "call" }, { "api_name": "json.load", "line_number": 30, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 4...
32413683762
from django.contrib.auth import authenticate from django.contrib.auth import login from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.views import LogoutView from django.shortcuts import redirect from django.shortcuts import render from django.urls imp...
ErnestoAquino/LITRevu
litrevu/users/views.py
views.py
py
7,709
python
en
code
0
github-code
6
[ { "api_name": "django.views.generic.View", "line_number": 18, "usage_type": "name" }, { "api_name": "users.forms.LoginForm", "line_number": 28, "usage_type": "attribute" }, { "api_name": "users.forms", "line_number": 28, "usage_type": "name" }, { "api_name": "djan...
1705824671
import sys import json import h5py import numpy as np import matplotlib.pyplot as plt import sys_id_utils for i, data_file in enumerate(sys.argv[1:]): data = h5py.File(data_file, 'r') run_param = json.loads(data.attrs['jsonparam']) print(run_param) t = data['t'][()] v_stimu = data['v_stimulus'][...
willdickson/imafly
python/imafly/examples/data_step_tmp/analyze_step_data.py
analyze_step_data.py
py
2,044
python
en
code
0
github-code
6
[ { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "h5py.File", "line_number": 12, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "sys_id_utils.freq_response", "l...
27998557212
# -*- coding: utf-8 -*- """ Created on Sat Oct 2 14:50:05 2021 @author: mizo_ """ import os from PIL import Image import numpy as np import csv from impreproc5 import processImg # image =Image.open('test/test.png') # z='test/resize/testresize.png' # c=processImg(image,z) c=0 directory = f't...
moataz-abbas/NeuralNetworks
createTestCSV.py
createTestCSV.py
py
1,101
python
en
code
0
github-code
6
[ { "api_name": "csv.writer", "line_number": 24, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_number": 26, ...
18972684429
import pandas as pd from dagster import asset, get_dagster_logger from SSH_DEMO.resources import daily_partitions_def # path for the directory as served from the SFTP server GLOBAL_PREFIX = "upload" DB_ZONE = "landing" def _source_path_from_context(context): return ( context.solid_def.output_defs[0]...
geoHeil/dagster-ssh-demo
SSH_DEMO/assets/ingest_assets.py
ingest_assets.py
py
2,839
python
en
code
1
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 34, "usage_type": "call" }, { "api_name": "pandas.Timestamp.now", "line_number": 36, "usage_type": "call" }, { "api_name": "pandas.Timestamp", "line_number": 36, "usage_type": "attribute" }, { "api_name": "pandas.Dat...
35707696287
import bcrypt import time from flask import Flask, jsonify, request from flask import Flask, jsonify from flask_cors import CORS # * ============ (Core functions) ============ *# from utils.save_results_in_db import save_results_in_db from utils.scan_for_vulns import scan_for_vulns from utils.data_adapter import da...
JorgeAVargasC/router-scan-backend
app.py
app.py
py
6,478
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 36, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 37, "usage_type": "call" }, { "api_name": "flask.request.get_json", "line_number": 47, "usage_type": "call" }, { "api_name": "flask.request", ...
33078595311
#!/usr/bin/env python # -*- coding: utf-8 -*- from time import time from threading import Thread import requests class DownloadHandler(Thread): def __init__(self, url): super().__init__() self.url = url def run(self): filename = self.url[self.url.rfind('/') + 1:] resp = req...
letterli/py-cookbook
books/python-100-days/Day14/requests_demo.py
requests_demo.py
py
733
python
en
code
0
github-code
6
[ { "api_name": "threading.Thread", "line_number": 10, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 18, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 26, "usage_type": "call" } ]
1047110963
from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit from django import forms class ticketChatForm(forms.Form): def __init__(self, *args, **kwargs): super(ticketChatForm, self).__init__(*args, **kwargs) self.helper = FormHelper() # self.helper.form_id = 'id-exa...
hewimetall/django_Help_Desk
label_ListPage/form.py
form.py
py
931
python
en
code
0
github-code
6
[ { "api_name": "django.forms.Form", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 6, "usage_type": "name" }, { "api_name": "crispy_forms.helper.FormHelper", "line_number": 9, "usage_type": "call" }, { "api_name": "crisp...
2018421498
import unittest import sys import os import tempfile import shutil from appliapps.examples.a_pyecho import PythonEcho from appliapps.examples.b_extecho import ExternalEcho from appliapps.examples.cp import CpApp from appliapps.examples.template import TemplateApp class Test(unittest.TestCase): @classmethod d...
lcb/applicake
tests/test_examples.py
test_examples.py
py
1,160
python
en
code
1
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 13, "usage_type": "attribute" }, { "api_name": "tempfile.mkdtemp", "line_number": 16, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.argv", "line...
27147516534
import pytest from ..common_imports import PdfXmp, PdfResource class TestPdfXmp: @pytest.fixture def resource(self, test_params): return PdfResource(test_params.resources_path + "XmpAndOtherSample.pdf", "XmpAndOtherSample.pdf") @pytest.fixture def text(self, resource, test_params, get_end...
dynamicpdf-api/python-client
test/PdfXmpEndpoint/test_pdf_xmp.py
test_pdf_xmp.py
py
688
python
en
code
0
github-code
6
[ { "api_name": "common_imports.PdfResource", "line_number": 8, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 6, "usage_type": "attribute" }, { "api_name": "common_imports.PdfXmp", "line_number": 12, "usage_type": "call" }, { "api_name": "py...
10854990799
import numpy as np import pytorch_lightning as pl import torch from torch.utils.data import Dataset, DataLoader from utils import Language SRC_LANG = Language('src') TRG_LANG = Language('trg') class SentenceDataset(Dataset): """ This class loads the desired data split for the Occupation Classification datas...
matprst/deceptive-attention-reproduced
deceptive-attention/src/seq2seq/lightning/data_utils.py
data_utils.py
py
5,858
python
en
code
0
github-code
6
[ { "api_name": "utils.Language", "line_number": 8, "usage_type": "call" }, { "api_name": "utils.Language", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.utils.data.Dataset", "line_number": 12, "usage_type": "name" }, { "api_name": "numpy.zeros", ...
32833821340
from appium import webdriver import time from appium.webdriver.common.touch_action import TouchAction from selenium.common.exceptions import ElementNotVisibleException, ElementNotSelectableException, NoSuchElementException from selenium.webdriver.support.wait import WebDriverWait desired_caps = {} desired_caps['plat...
candi-project/Automation_framework_Android
Appiumpython/Gestures/SwipeGesture2.py
SwipeGesture2.py
py
1,460
python
en
code
0
github-code
6
[ { "api_name": "appium.webdriver.Remote", "line_number": 18, "usage_type": "call" }, { "api_name": "appium.webdriver", "line_number": 18, "usage_type": "name" }, { "api_name": "appium.webdriver.common.touch_action.TouchAction", "line_number": 38, "usage_type": "call" }, ...
26024158970
# 建立COO 稀疏矩阵 from scipy.sparse import coo_matrix # 引入所需要的库 row = [0, 1, 2, 2] col = [0, 1, 2, 3] data = [1, 2, 3, 4] # 建立矩阵的参数 c = coo_matrix((data, (row, col)), shape=(4, 4)) # 构建4*4的稀疏矩阵 print(c) d = c.todense() # 稀疏矩阵转化为密集矩阵 print(d) e = coo_matrix(d) # 将一个0值很多的矩阵转为稀疏矩阵 print(e) f = e.to...
suanhaitech/pythonstudy2023
july/11.py
11.py
py
584
python
en
code
2
github-code
6
[ { "api_name": "scipy.sparse.coo_matrix", "line_number": 6, "usage_type": "call" }, { "api_name": "scipy.sparse.coo_matrix", "line_number": 11, "usage_type": "call" } ]
71276865469
# internal imports from typing import Dict, Optional # external imports import gspread def add_new_row(sheet, data): sheet.append_row(data) def update_row(sheet, cell, data): for idx, d in enumerate(data): sheet.update_cell(cell.row, cell.col + idx, data[idx]) def upload_results(sheet_name: str, ...
jaypmorgan/labscribe
labscribe/googlesheets.py
googlesheets.py
py
968
python
en
code
0
github-code
6
[ { "api_name": "typing.Dict", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 17, "usage_type": "name" }, { "api_name": "gspread.service_account", "line_number": 23, "usage_type": "call" }, { "api_name": "gspread.CellNotFo...
41191258670
#? pip install flask flask-pymongo from flask import Flask, render_template from flask_pymongo import PyMongo app = Flask(__name__) app.config['MONGO_URI'] = "mongodb://localhost:27017/myDatabase" mongo = PyMongo(app) @app.route('/') def hello_world(): mongo.db.inventory.insert_one({"b":31}) a = mongo.db.inve...
Vedant817/Flask-and-MongoDB
main.py
main.py
py
569
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask_pymongo.PyMongo", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.render_te...
71601274107
#!/usr/bin/env python3 from jinja2 import Template import numpy as np min_x = -20 max_x = 20 min_z = 0.0 max_z = 20.0 with open('nonapod_input.jinja') as template_file: templ = Template(template_file.read()) # Do the cases for grid sampling. Since 50 and 500 are not perfect squares, # must use an approximate num...
gridley/truss_optimization
write_big_grid.py
write_big_grid.py
py
730
python
en
code
0
github-code
6
[ { "api_name": "jinja2.Template", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 16, "usage_type": "call" } ]
24615532465
from tiles import AnimatableTile import pygame class Coin(AnimatableTile): def __init__(self, size, position, frames, data): super().__init__(size, position, frames, data) for i in range(len(self.frames)): self.frames[i] = pygame.transform.scale(self.frames[i], (8, 8)) self.pos...
ysbrandB/M6FinalProject
code/coin.py
coin.py
py
462
python
en
code
0
github-code
6
[ { "api_name": "tiles.AnimatableTile", "line_number": 5, "usage_type": "name" }, { "api_name": "pygame.transform.scale", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.transform", "line_number": 9, "usage_type": "attribute" } ]
74667821627
from typing import List, Optional from fastapi import Depends from ..service import Service, get_service from app.utils import AppModel from . import router class InsideObjectResponse(AppModel): _id:str address:str type:str price:int area:float rooms_count:int location:dict class GenRespo...
MamushevArup/code-climb-ai-back
app/shanyrak/router/router_get_pagination.py
router_get_pagination.py
py
770
python
en
code
0
github-code
6
[ { "api_name": "app.utils.AppModel", "line_number": 8, "usage_type": "name" }, { "api_name": "app.utils.AppModel", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.Optional", ...
22050926816
from flask import Flask, request, render_template, session, redirect, url_for, jsonify from models.user import User from models.rawpicture import Rawpicture from models.savepicture import Savepicture from models.comment import Comment from random import choice import mlab import base64 import requests mlab.con...
hoangcuong9x/test
app.py
app.py
py
16,081
python
vi
code
0
github-code
6
[ { "api_name": "mlab.connect", "line_number": 10, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "models.savepicture.Savepic...
30157505435
from find_dir import cmd_folder import pandas as pd import os import json import numpy as np buyer_history = pd.read_csv(cmd_folder+"data/processed/buyer_history.csv") sorted_history = buyer_history[["buyer_id","visit_id","timestamp","event"]].sort_values(["buyer_id","visit_id","timestamp","event"],ascending=True) s...
pierrenodet/PFE
src/make_trace_bis.py
make_trace_bis.py
py
1,746
python
en
code
2
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "find_dir.cmd_folder", "line_number": 7, "usage_type": "name" }, { "api_name": "find_dir.cmd_folder", "line_number": 24, "usage_type": "name" }, { "api_name": "json.load", ...
27318923223
# @PascalPuchtler # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # dis...
iisys-hof/autonomous-driving
car-controller/src/mainController/View/Render/GenerateCarView.py
GenerateCarView.py
py
2,531
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.use", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.getTickFrequency", "line_number": 30, "usage_type": "call" }, { "api_name": "cv2.getTickCount", "line_number": 31, "usage_type": "call" }, { "api_name": "cv2.putText", ...
1701461424
import argparse import numpy as np import cv2 import time import math from sympy.solvers import solve from sympy import Symbol X_POS = 0 Y_POS = 1 Thresh = 170 imageName = "picture.jpg" def modImage(sceneName, img, kernel, erodeNum, dilateNum, invertion=False): ret, result = cv2.threshold(img, Thresh, 255, cv2.THRE...
Edwin222/CPL-20181-Team3
iris_detect_service/iris_detection.py
iris_detection.py
py
6,860
python
en
code
0
github-code
6
[ { "api_name": "cv2.threshold", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.THRESH_BINARY", "line_number": 16, "usage_type": "attribute" }, { "api_name": "cv2.THRESH_OTSU", "line_number": 16, "usage_type": "attribute" }, { "api_name": "cv2.bitwise...
41636163192
"""Insert Noop: insert a statement that doesn't affect any other variables.""" from refactorings.base import BaseTransformation, JoernTransformation, SrcMLTransformation from refactorings.random_word import get_random_word, get_random_typename_value import string from srcml import E from lxml import etree import loggi...
bstee615/cfactor
refactorings/insert_noop.py
insert_noop.py
py
1,800
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "refactorings.base.SrcMLTransformation", "line_number": 19, "usage_type": "name" }, { "api_name": "refactorings.random_word.get_random_word", "line_number": 27, "usage_type": "call"...
21396845249
from typing import Dict from starlette.types import ASGIApp, Receive, Scope, Send class AsgiDispatcher: def __init__(self, patterns: Dict[str, ASGIApp], default: ASGIApp): self.patterns = patterns self.default_app = default async def __call__(self, scope: Scope, receive: Receive, send: Send) ...
TheRacetrack/racetrack
racetrack_commons/racetrack_commons/api/asgi/dispatcher.py
dispatcher.py
py
730
python
en
code
27
github-code
6
[ { "api_name": "typing.Dict", "line_number": 6, "usage_type": "name" }, { "api_name": "starlette.types.ASGIApp", "line_number": 6, "usage_type": "name" }, { "api_name": "starlette.types.Scope", "line_number": 10, "usage_type": "name" }, { "api_name": "starlette.typ...
8797452881
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns df = pd.read_csv("C:/Users/Admin/OneDrive/Desktop/decision tree/Iris.csv") df.head() df.isnull().sum() df.shape df.info() df.describe() df.drop('Id',axis=1, inplace=True) df.shape df['Species'].value_counts()....
ShreyasiDesai/LGMVIP-DataScience
decition tree.py
decition tree.py
py
1,182
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "seaborn.heatmap", "line_number": 18, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 24, "usage_type": "call" }, { "api_name"...
28002035268
import os import torch import numpy as np from PIL import Image # This dataset comes form paper: # [2D and 3D Segmentation of Uncertain Local Collagen Fiber Orientations in SHG Microscopy] # https://github.com/Emprime/uncertain-fiber-segmentation def collagen3d_dataset(dataloader_config, label_type='mask')...
Surtol-Sun/TrainFramework_torch
components/dataset_loader/dataset_loader_3dcollagen.py
dataset_loader_3dcollagen.py
py
7,648
python
en
code
1
github-code
6
[ { "api_name": "os.cpu_count", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.utils.data.DataLoader", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.utils", "line_number": 23, "usage_type": "attribute" }, { "api_name": "torch.utils...
19772157877
# -*- coding: utf-8 -*- """ python -c "import doctest, ibeis; print(doctest.testmod(ibeis.model.hots.hots_nn_index))" python -m doctest -v ibeis/model/hots/hots_nn_index.py python -m doctest ibeis/model/hots/hots_nn_index.py """ from __future__ import absolute_import, division, print_function # Standard from six.moves ...
smenon8/ibeis
_broken/old/hots_nn_index.py
hots_nn_index.py
py
12,775
python
en
code
null
github-code
6
[ { "api_name": "utool.inject", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 21, "usage_type": "attribute" }, { "api_name": "utool.hashstr_arr", "line_number": 36, "usage_type": "call" }, { "api_name": "utool.printex", "lin...
12608079869
''' Load embedding, create dictionary, convert text to index ''' import io import pandas as pd from sklearn.feature_extraction.text import CountVectorizer import argparse #import json import os import numpy as np import pickle import pdb def text2index(text, vocab, analyzer): # 1 is unk doc_toks = [vocab[y] ...
jingsliu/NLP_HW
HW2/code/dataPrep.py
dataPrep.py
py
4,852
python
en
code
0
github-code
6
[ { "api_name": "io.open", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.fromiter", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.float", "line_number": 27, "usage_type": "attribute" }, { "api_name": "sklearn.feature_extraction.te...
12509808903
import requests city = input('enter the city... ') api_address = 'https://samples.openweathermap.org/data/2.5/weather?q={},uk&appid=b6907d289e10d714a6e88b30761fae22'.format( city) url = api_address + city data = requests.get(url).json() # print(data) weather = data['weather'] print(weather[0]['description'])
Riyam224/techcampus---projects
04/testApi.py
testApi.py
py
319
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" } ]
71735044668
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import scipy.stats as stats # Change the display options pd.options.display.max_columns = None pd.options.display.max_rows = None species_df = pd.read_csv('species_info.csv') observations_df = pd.read_csv('observat...
Pavich-3/-Biodiversity-in-National-Parks
project.py
project.py
py
3,509
python
en
code
0
github-code
6
[ { "api_name": "pandas.options", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pandas.options", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_csv...
30192254789
import numpy as np import matplotlib.pyplot as plt import pandas as pd import os # sigmoid函数 def sigmoid(z): return 1 / (1 + np.exp(-z)) # 定义回归模型 def model(X, theta): return sigmoid(np.dot(X, theta.T)) # 计算梯度 def gradient(X, y, theta): grad = np.zeros(theta.shape) # 初始化梯度,维度与参数向量的维度...
TJPU-ML/Homework-for-the-fall-semester-of-2018
iris classification/张家源/iris4.py
iris4.py
py
9,017
python
en
code
0
github-code
6
[ { "api_name": "numpy.exp", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.multiply", "line_number": 22...
72757362749
""" Roll adjusted and multiple prices for a given contract, after checking that we do not have positions NOTE: this does not update the roll calendar .csv files stored elsewhere. Under DRY the sole source of production roll info is the multiple prices series """ from dataclasses import dataclass import numpy as np ...
ahalsall/pysystrade
sysproduction/interactive_update_roll_status.py
interactive_update_roll_status.py
py
18,575
python
en
code
4
github-code
6
[ { "api_name": "syscore.objects.named_object", "line_number": 39, "usage_type": "call" }, { "api_name": "sysdata.data_blob.dataBlob", "line_number": 45, "usage_type": "call" }, { "api_name": "syscore.interactive.print_menu_of_values_and_get_response", "line_number": 67, "u...
18760758159
import time import aiohttp import discord import importlib import os import sys import requests import asyncio from io import BytesIO from discord.ext import commands from my_utils import permissions, default, dataIO from my_utils.guildstate import state_instance class admin(commands.Cog): def __init__(self, bot...
Albedo-Discord/ext
cogs/admin.py
admin.py
py
10,872
python
en
code
1
github-code
6
[ { "api_name": "discord.ext.commands.Cog", "line_number": 16, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 16, "usage_type": "name" }, { "api_name": "my_utils.default.get", "line_number": 19, "usage_type": "call" }, { "api_name"...
75167070268
import torch import torch.nn.functional as F from torch.autograd import Variable import numpy as np from math import exp import math def gaussian(window_size, sigma): gauss = torch.Tensor([exp(-(x - window_size/2)**2/float(2*sigma**2)) for x in range(window_size)]) return gauss/gauss.sum() def create_window(window_...
chenkhan/haze-synthesizing
util/metrics.py
metrics.py
py
5,878
python
en
code
1
github-code
6
[ { "api_name": "torch.Tensor", "line_number": 9, "usage_type": "call" }, { "api_name": "math.exp", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.autograd.Variable", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn.functional.conv2...
69869460347
def Mark( x=None, text='', color='', bold=True, underline=False): """ This function prints an object x and adds a description text. It is useful for for debugging. """ start = '' end = '' if color != '' or bold or underline: end='\033[0m' colorDict = { '': '', None: '', 'p...
google/expt-analysis
python/data_analysis.py
data_analysis.py
py
82,173
python
en
code
6
github-code
6
[ { "api_name": "re.sub", "line_number": 619, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 620, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 621, "usage_type": "call" }, { "api_name": "re.search", "line_number": 1113, "usa...
7262256391
from http import HTTPStatus from flask import current_app, jsonify, request from app.models.vacine_model import Vacine from sqlalchemy.exc import IntegrityError from app.exc.errors import CpfInvalid from app.services.verif_data import verify_data from app.services.generate_data import data_generate def get_vacines():...
Kenzie-Academy-Brasil-Developers/q3-sprint5-vacinacao-theogandara
app/controllers/vacine_controller.py
vacine_controller.py
py
1,750
python
en
code
1
github-code
6
[ { "api_name": "app.models.vacine_model.Vacine.query.all", "line_number": 11, "usage_type": "call" }, { "api_name": "app.models.vacine_model.Vacine.query", "line_number": 11, "usage_type": "attribute" }, { "api_name": "app.models.vacine_model.Vacine", "line_number": 11, "u...
2063946987
from loader import dp from aiogram import types from aiogram.dispatcher import FSMContext from aiogram.dispatcher.filters import Text from loguru import logger from datetime import datetime @dp.message_handler(commands='reload', state='*') @dp.message_handler(Text(equals='reload', ignore_case...
Taiven396/tickets_bot
handlers/reload.py
reload.py
py
1,059
python
ru
code
0
github-code
6
[ { "api_name": "aiogram.types.Message", "line_number": 12, "usage_type": "attribute" }, { "api_name": "aiogram.types", "line_number": 12, "usage_type": "name" }, { "api_name": "aiogram.dispatcher.FSMContext", "line_number": 13, "usage_type": "name" }, { "api_name":...
13941876090
from argparse import ArgumentParser from sudoku_solver import SudokuSolver from sudoku import Sudoku def get_args(): parser = ArgumentParser() parser.add_argument('--sudoku', required=True) return parser.parse_args() def main(): args = get_args() sudoku = Sudoku.from_file(args.sudoku) solver...
delabania/sudoku-solver
solve.py
solve.py
py
450
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "sudoku.Sudoku.from_file", "line_number": 14, "usage_type": "call" }, { "api_name": "sudoku.Sudoku", "line_number": 14, "usage_type": "name" }, { "api_name": "sudoku_s...
38354134434
from dataclasses import dataclass from typing import Optional, Tuple import torch.nn as nn import torch from transformers.models.dpr.modeling_dpr import DPRReaderOutput from transformers.modeling_outputs import QuestionAnsweringModelOutput, ModelOutput, SequenceClassifierOutput from transformers.models.vilt.modeling_v...
mdsalem17/reranking
meerqat/train/trainee.py
trainee.py
py
21,260
python
en
code
null
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 16, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 16, "usage_type": "name" }, { "api_name": "transformers.models.dpr.modeling_dpr.DPRReaderOutput", "line_number": 27, "usage_type": "name" }, { ...
5820650421
import hashlib import json import urllib.parse from typing import Union, Dict import asks from asks.response_objects import Response from spins_halp_line.constants import Credentials from spins_halp_line.util import get_logger, SynchedCache _cred_key = "resource_space" _field_ids = { "adventure_name": 86, "p...
aeturnum/spins_halp_line
spins_halp_line/media/resource_space.py
resource_space.py
py
13,353
python
en
code
0
github-code
6
[ { "api_name": "spins_halp_line.util.get_logger", "line_number": 22, "usage_type": "call" }, { "api_name": "spins_halp_line.util.SynchedCache", "line_number": 117, "usage_type": "call" }, { "api_name": "typing.Union", "line_number": 177, "usage_type": "name" }, { "...
12830919470
from typing import Optional class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next class Solution: def reverseList(self, head: Optional[ListNode]) -> Optional[ListNode]: dummy = ListNode() while head: cur = head head = h...
theRobertSan/LeetCode-Solutions-Python
206.py
206.py
py
419
python
en
code
1
github-code
6
[ { "api_name": "typing.Optional", "line_number": 11, "usage_type": "name" } ]
11473045132
''' Terminal !pip install dash==0.26.5 # The core dash backend !pip install dash-html-components==0.12.0 # HTML components !pip install dash-core-components==0.28.0 # Supercharged components !pip install dash_bootstrap_components==0.13.1 ''' # Run this app with `python app.py` and # visit http://127.0.0.1:8050/ in ...
hsyho11/python-plotly-dash
plotly_example.py
plotly_example.py
py
4,180
python
en
code
0
github-code
6
[ { "api_name": "dash.Dash", "line_number": 20, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 28, "usage_type": "call" }, { "api_name": "plotly.express.bar", "line_number": 33, "usage_type": "call" }, { "api_name": "plotly.express", "l...
19583758283
""" This file is used to perform a random hyperparameter search on the Coco dataset using the baseline image captioner. For more info on the ImageCaptionerBaseline class, please check out the docstrings in the image_captioning.py file. """ # Package loading import argparse import os import sys sys.path.append('..') ...
milenakapralova/socraticmodels
scripts/coco_caption_base_hp_tune.py
coco_caption_base_hp_tune.py
py
3,103
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.chdir", "line_number": 16, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", ...
72416331709
from socket import * import time import osascript from multiprocessing import Process, Manager, Value import os #osascript -e 'display notification "{}" with title "{}"' volume = 0 def recieve_data(val): serverSock = socket(AF_INET, SOCK_STREAM) serverSock.bind(('', 7777)) serverSock.listen(1) connect...
Arc1el/DeepLearning_Jetson_AI
server.py
server.py
py
1,802
python
en
code
4
github-code
6
[ { "api_name": "osascript.osascript", "line_number": 23, "usage_type": "call" }, { "api_name": "osascript.osascript", "line_number": 28, "usage_type": "call" }, { "api_name": "os.system", "line_number": 33, "usage_type": "call" }, { "api_name": "osascript.osascript...
20921250486
import networkx as nx from sklearn.cluster import SpectralClustering def spectral_clustering(G, n_clusters=2): adj_mat = nx.to_numpy_matrix(G) sc = SpectralClustering(n_clusters, affinity='precomputed', n_init=100) sc.fit(adj_mat) clusters = {} for i in range(len(sc.labels_)): if sc.labels...
sharpenb/Multi-Scale-Modularity-Graph-Clustering
Scripts/clustering_algorithms/spectral_clustering.py
spectral_clustering.py
py
454
python
en
code
2
github-code
6
[ { "api_name": "networkx.to_numpy_matrix", "line_number": 6, "usage_type": "call" }, { "api_name": "sklearn.cluster.SpectralClustering", "line_number": 7, "usage_type": "call" } ]
12170535231
# Created on 24 September 2019 from square import Square, getScaledFont from random import randint from math import cos, sin, pi, atan, copysign from pygame.mixer import * from pygame.draw import rect from pygame.locals import * from pygame.time import Clock from pygame.display import update from pygame.mouse import g...
AaronOrenstein210/2048
gameDriver.py
gameDriver.py
py
7,331
python
en
code
1
github-code
6
[ { "api_name": "pygame.draw.rect", "line_number": 41, "usage_type": "call" }, { "api_name": "pygame.draw.rect", "line_number": 42, "usage_type": "call" }, { "api_name": "pygame.display.update", "line_number": 43, "usage_type": "call" }, { "api_name": "square.Square...
18654748060
from typing import Dict, List, Type from src.domain.models.pets import Pets from src.domain.use_cases import FindPet as FindPetInterface from src.data.interfaces import PetRepositoryInterface class FindPet(FindPetInterface): """Use case for Find pet""" def __init__(self, pets_repository: Type[PetRepositoryIn...
MatheusDev20/flask-application-clean-arch
src/data/find_pet/find.py
find.py
py
1,392
python
en
code
0
github-code
6
[ { "api_name": "src.domain.use_cases.FindPet", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.Type", "line_number": 10, "usage_type": "name" }, { "api_name": "src.data.interfaces.PetRepositoryInterface", "line_number": 10, "usage_type": "name" }, { ...
19400730749
############################################################################### # Process to read Customer Updates # # # Pre-requisites: Kafka server should be running # ##############################################################################...
bbcCorp/py_microservices
src/app_services_replication/message_processor.py
message_processor.py
py
5,987
python
en
code
1
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.path", "line_num...
74021781309
from typing import List from collections import Counter from time import time import matplotlib.pyplot as plt import numpy as np # constants ENGLISH_ALPHABET_CHARS = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ' def get_string_size(string: str, format: str='utf8') -> int: '''Returns size of string in b...
lucrae/zipf-score
side/score_old.py
score_old.py
py
1,510
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 15, "usage_type": "name" }, { "api_name": "collections.Counter", "line_number": 38, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 42, "usage_type": "call" }, { "api_name": "matplotlib...
71844063869
from django.urls import reverse from django.utils.translation import gettext_lazy as _ from simple_menu import MenuItem submenu_items = [ MenuItem( _("customers").capitalize(), reverse("packs:sales_customer_list"), weight=20, icon="bx-right-arrow-alt", ), MenuItem( _...
dbsiavichay/faclab
apps/accounts/menus/sales.py
sales.py
py
563
python
en
code
0
github-code
6
[ { "api_name": "simple_menu.MenuItem", "line_number": 6, "usage_type": "call" }, { "api_name": "django.utils.translation.gettext_lazy", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.reverse", "line_number": 8, "usage_type": "call" }, { "api_n...
4783789916
# Adapted from pytorch examples from __future__ import print_function from torch import nn, optim from railrl.core import logger import numpy as np from railrl.pythonplusplus import identity from railrl.torch.core import PyTorchModule from railrl.torch.networks import Mlp import railrl.torch.pytorch_util as ptu class...
snasiriany/leap
railrl/torch/vae/reprojection_network.py
reprojection_network.py
py
4,777
python
en
code
45
github-code
6
[ { "api_name": "railrl.torch.pytorch_util.gpu_enabled", "line_number": 26, "usage_type": "call" }, { "api_name": "railrl.torch.pytorch_util", "line_number": 26, "usage_type": "name" }, { "api_name": "torch.optim.Adam", "line_number": 32, "usage_type": "call" }, { "...
29924772061
""" Author: JW Date: 07/26/2023 Module Name: picture_capture_controls_uplink.py Description: This Python script is part of an image processing and classification application. It provides various functions for interacting with images, databases, and user stacks. The script includes functionalities such a...
JonWakefield/Anvil-Web-App
server_code/uplink_scripts/picture_capture_controls_uplink.py
picture_capture_controls_uplink.py
py
22,281
python
en
code
0
github-code
6
[ { "api_name": "stack.Stack", "line_number": 58, "usage_type": "call" }, { "api_name": "tkinter.Tk", "line_number": 68, "usage_type": "call" }, { "api_name": "tkinter.filedialog.askdirectory", "line_number": 71, "usage_type": "call" }, { "api_name": "tkinter.filedi...
25995631588
from dataclasses import dataclass, field from .. import docker from .. import exceptions from .. import utils from ..runtime import register, RuntimePlugin @register @dataclass class Docker(RuntimePlugin): name: str = field(init=False, default="Docker") def init(self, graph, outputs): # Parse the us...
parlaylabs/model
model/runtimes/docker.py
docker.py
py
1,011
python
en
code
2
github-code
6
[ { "api_name": "runtime.RuntimePlugin", "line_number": 11, "usage_type": "name" }, { "api_name": "dataclasses.field", "line_number": 12, "usage_type": "call" }, { "api_name": "runtime.register", "line_number": 9, "usage_type": "name" }, { "api_name": "dataclasses.d...
75385540986
from collections import defaultdict T = int(input()) for i in range(T): N = int(input()) c = list(map(int, input().split(' '))) g = defaultdict(list) for _ in range(N - 1): edge = list(map(int, input().split(' '))) g[edge[0]].append(edge[1]) g[edge[1]].append(edge[0]) def ...
fortierq/competitions
fb_hacker_cup/2021/qualification/c1_gold_mine.py
c1_gold_mine.py
py
686
python
en
code
0
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 8, "usage_type": "call" } ]
27884694892
from django.contrib import admin from .models import Division, Farm # Register your models here. class DivisionAdmin(admin.ModelAdmin): list_display = ( "division_name", "division_code", ) admin.site.register(Division, DivisionAdmin) admin.site.register(Farm)
Wageesha95/dbapp-live
farms/admin.py
admin.py
py
289
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 7, "usage_type": "name" }, { "api_name": "django.contrib.admin.site.register", "line_number": 14, "usage_type": "call" },...
40796544139
import pydantic from pydantic import validator import typing from uuid import UUID, uuid4 class SchemaCustomer(pydantic.BaseModel): id: str name: str last_name: str email: pydantic.EmailStr age: pydantic.PositiveInt @validator('id', pre=True, always=True) def convert_id_to_str(cls, v): ...
edmon1024/workshop-api-ejemplo-fastapi
app/schemas.py
schemas.py
py
708
python
en
code
0
github-code
6
[ { "api_name": "pydantic.BaseModel", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pydantic.EmailStr", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pydantic.PositiveInt", "line_number": 12, "usage_type": "attribute" }, { "api_name"...
5085250146
from copy import deepcopy import json import re from flask import render_template from maf_api_mock_data import EGFR_BLCA_BRCA as FAKE_MAF_DATA from hotspots.seqpeek.tumor_types import tumor_types as ALL_TUMOR_TYPES from app_logging import get_logger log = get_logger() try: from hotspots.seqpeek.gene_list import ...
cancerregulome/multiscale-mutation-hotspots
hotspots/seqpeek/view.py
view.py
py
11,643
python
en
code
1
github-code
6
[ { "api_name": "app_logging.get_logger", "line_number": 9, "usage_type": "call" }, { "api_name": "hotspots.seqpeek.gene_list.gene_list", "line_number": 15, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 34, "usage_type": "call" }, { "api_name": ...
9200799444
from fastapi import status, HTTPException, Depends from fastapi.security import OAuth2PasswordBearer from jose import JWTError, jwt from datetime import datetime, timedelta from sqlalchemy.orm import Session from .schema import TokenData from app import database, models from .config import env SECRET_KEYS = env.SECR...
Ichi-1/FastAPI-example-api
app/oauth2.py
oauth2.py
py
1,581
python
en
code
0
github-code
6
[ { "api_name": "config.env.SECRET_KEY", "line_number": 12, "usage_type": "attribute" }, { "api_name": "config.env", "line_number": 12, "usage_type": "name" }, { "api_name": "config.env.ALGORITHM", "line_number": 13, "usage_type": "attribute" }, { "api_name": "confi...
11670856973
# See subject at https://www.ilemaths.net/sujet-suite-864999.html """ La suite de Conway """ from itertools import groupby, islice def gen_conway(germe): """Génère la suite de Conway à partir du germe""" while True: yield germe germe = ''.join(f"{len(tuple(g))}{c}" for c, g in groupby(germe...
bdaene/ilemaths
suite-864999.py
suite-864999.py
py
667
python
fr
code
0
github-code
6
[ { "api_name": "itertools.groupby", "line_number": 15, "usage_type": "call" }, { "api_name": "itertools.islice", "line_number": 23, "usage_type": "call" } ]