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
41434414625
import json from django.http import HttpResponse from django.utils import timezone from .models import Gateway_task, TaskRecord from gateway.models import GatewayBase # Create your views here. def get_all(request): all_task = Gateway_task.objects.all() result = [] for i in all_task: result.appen...
dragonxu/IoT_device_client
backend/task/views.py
views.py
py
6,225
python
en
code
1
github-code
21
[ { "api_name": "models.Gateway_task.objects.all", "line_number": 12, "usage_type": "call" }, { "api_name": "models.Gateway_task.objects", "line_number": 12, "usage_type": "attribute" }, { "api_name": "models.Gateway_task", "line_number": 12, "usage_type": "name" }, { ...
20114392091
import pandas as pd from typing import Dict, List, Union from sklearn.utils import compute_class_weight from torch import Tensor from fast_tabnet.core import TabNetModel from fastai.optimizer import Optimizer from fastai.tabular.all import ( # data utility get_emb_sz, TabularPandas, CategoryBlock, Categorify, ...
erudic/mt-tabnet-xgboost-model-comparison
model_trainer/tabnet/tabnet_trainer.py
tabnet_trainer.py
py
3,588
python
en
code
1
github-code
21
[ { "api_name": "typing.Dict", "line_number": 18, "usage_type": "name" }, { "api_name": "fastai.optimizer.Optimizer", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 18, "usage_type": "name" }, { "api_name": "fastai.tabular.all...
43893354391
from functools import partial from hamcrest import ( assert_that, contains_exactly, contains_inanyorder, empty, equal_to, has_entries, has_item, has_entry, is_, ) from wazo_test_helpers import until from wazo_test_helpers.hamcrest.uuid_ import uuid_ from .helpers import fixtures, bas...
wazo-platform/wazo-auth
integration_tests/suite/test_tenants.py
test_tenants.py
py
22,502
python
en
code
7
github-code
21
[ { "api_name": "helpers.base.APIIntegrationTest", "line_number": 45, "usage_type": "attribute" }, { "api_name": "helpers.base", "line_number": 45, "usage_type": "name" }, { "api_name": "hamcrest.assert_that", "line_number": 61, "usage_type": "call" }, { "api_name":...
19767433204
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Apr 14 11:08:04 2020 @author: moritz """ import aioredis import json import time import iobcore.object_utils as utils import re class ObjectsDB: def __init__(self, port:int=6379, namespace:str='cfg'): self.port = port self.obj...
foxriver76/ioBroker.adapter-core-py
iobcore/objects.py
objects.py
py
4,511
python
en
code
0
github-code
21
[ { "api_name": "aioredis.create_redis", "line_number": 23, "usage_type": "call" }, { "api_name": "aioredis.create_redis", "line_number": 24, "usage_type": "call" }, { "api_name": "aioredis.pubsub.Receiver", "line_number": 25, "usage_type": "call" }, { "api_name": "...
20595635609
from fourparts.commons.Orbit import Orbit import pytest def test_cases(): orbit_1 = [1, 2, 3] orbit_2 = ("X", "Y", "Z", "T") return [ ([1], 0, [1]), (orbit_1, 0, [1, 2, 3]), (orbit_1, 1, [2, 3, 1]), (orbit_2, 3, ["T", "X", "Y", "Z"]), ] @pytest.mark.parametrize("orbi...
ruixuantan/FourParts
tests/test_commons/test_Orbit/test_get_curr_orbit.py
test_get_curr_orbit.py
py
454
python
en
code
0
github-code
21
[ { "api_name": "fourparts.commons.Orbit.Orbit", "line_number": 19, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 17, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 17, "usage_type": "attribute" } ]
71712596214
import pandas as pd from sklearn.feature_extraction.text import CountVectorizer from sklearn.linear_model import LogisticRegression from sklearn.svm import SVC from sklearn.metrics import confusion_matrix, classification_report from sklearn.ensemble import RandomForestClassifier from sklearn.ensemble import GradientBoo...
l3eniy/CIS_text_classification
blackbox.py
blackbox.py
py
5,516
python
de
code
2
github-code
21
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.CountVectorizer", "line_number": 35, "usage_type": "call" }, ...
73582610931
from ppo import plugins from io import StringIO, BytesIO import yaml import re import six import traceback import codecs class YAMLParser(plugins.ParserPlugin): """ I parse YAML """ name = 'yaml' def readProbability(self, instream): lines = [] for i in range(5): line...
iffy/ppo
ppo/parse_plugins/yaml_plugin.py
yaml_plugin.py
py
1,653
python
en
code
0
github-code
21
[ { "api_name": "ppo.plugins.ParserPlugin", "line_number": 11, "usage_type": "attribute" }, { "api_name": "ppo.plugins", "line_number": 11, "usage_type": "name" }, { "api_name": "yaml.safe_load", "line_number": 23, "usage_type": "call" }, { "api_name": "io.BytesIO",...
27178522990
from flask import Flask, request, jsonify, abort, url_for from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///foodnow.sqlite3' db = SQLAlchemy(app) class Food(db.Model): id = db.Column('id', db.Integer, primary_key = True) name = db.Column(db.Stri...
phatthinh2010/foodnow
app_food.py
app_food.py
py
4,735
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.url_for", "line_number": 50, "usage_type": "call" }, { "api_name": "flask.url_for", ...
1561117597
from flask import Blueprint, jsonify, request from app.models import user api = Blueprint('user', __name__, url_prefix='/api/user') @api.route('') def get_all(): data = user.get() return jsonify(data), 200 @api.route('/<id>') def get_by_id(id): data = user.get(id) if len(...
yunkai1841/coaching-web-app
app/apis/user.py
user.py
py
570
python
en
code
0
github-code
21
[ { "api_name": "flask.Blueprint", "line_number": 3, "usage_type": "call" }, { "api_name": "app.models.user.get", "line_number": 8, "usage_type": "call" }, { "api_name": "app.models.user", "line_number": 8, "usage_type": "name" }, { "api_name": "flask.jsonify", ...
26428978615
# 220830 2458 키 순서 import sys from collections import deque def bfs(start): global graphs, orders queue = deque([start]) graphs[start][start] = 0 while queue: now = queue.popleft() for nxt in orders[now]: if graphs[start][nxt] == -1 or graphs[start][nxt] > graphs[start][now]...
seho27060/aug-algo-study
0830/2458_seho.py
2458_seho.py
py
932
python
en
code
2
github-code
21
[ { "api_name": "collections.deque", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 16, "usage_type": "attribute" } ]
36450592447
import sys from PyQt5.QtWidgets import QApplication, QMainWindow, QMenu, QVBoxLayout, QSizePolicy, QMessageBox, QWidget, QPushButton from PyQt5.QtGui import * from PyQt5.QtCore import * from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure from matplotl...
ssowders3/mini-mARVin
gui_interface.py
gui_interface.py
py
3,916
python
en
code
0
github-code
21
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 17, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QPushButton", "line_number": 35, "usage_type": "call" }, { "api_name": "matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg", "line_number": 45, "usage_...
70742255093
""" Hedging option with actor-critic AI model """ import gym import gym_foo2 import numpy as np from keras.models import Sequential, Model from keras.layers import Dense, Dropout, Input, Reshape from keras.layers.merge import Add, Multiply, concatenate from keras.optimizers import Adam import keras.backend as K from k...
mtab3t/RL_optionhedging
RL_test3.py
RL_test3.py
py
10,765
python
en
code
0
github-code
21
[ { "api_name": "collections.deque", "line_number": 44, "usage_type": "call" }, { "api_name": "tensorflow.placeholder", "line_number": 48, "usage_type": "call" }, { "api_name": "tensorflow.float32", "line_number": 48, "usage_type": "attribute" }, { "api_name": "tens...
37049929913
from gtts import gTTS tts = gTTS(text="welcome to my website", lang='en') tts.save("record.mp3") print("Text Converted Successfully ") import pyttsx3 engine = pyttsx3.init() engine.say("welcome to geekscoders website ") engine.setProperty('rate', 120) engine.setProperty('volume', 0.9) engine.runAndWait()
kevinaprilion/Tugas-Besar_Speech
index.py
index.py
py
311
python
en
code
0
github-code
21
[ { "api_name": "gtts.gTTS", "line_number": 4, "usage_type": "call" }, { "api_name": "pyttsx3.init", "line_number": 11, "usage_type": "call" } ]
24198993006
import numpy as np import time dict = { 0: {"min":1, "med":3, "max":5}, 1: {"min":6, "med":8, "max":10}, 2: {"min":11, "med":12, "max":15}, 3: {"min":16, "med":16, "max":20}, } ...
DocEnd/Image_color_picker
testing.py
testing.py
py
1,449
python
en
code
0
github-code
21
[ { "api_name": "numpy.array", "line_number": 37, "usage_type": "call" }, { "api_name": "time.time", "line_number": 40, "usage_type": "call" }, { "api_name": "time.time", "line_number": 45, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 5...
10844662684
from collections import deque from sys import stdin v, m = map(int, stdin.readline().rstrip().split()) graph = [[] for _ in range(v + 1)] visited = [0] * (v + 1) for _ in range(m): a, b = map(int, stdin.readline().rstrip().split()) graph[b].append(a) def bfs(graph, node, visit_code): visited[node] = visit_c...
K1A2/algorithm_python
baekjoon/bfs_dfs/1325_효율적인_해킹.py
1325_효율적인_해킹.py
py
813
python
en
code
0
github-code
21
[ { "api_name": "sys.stdin.readline", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 3, "usage_type": "name" }, { "api_name": "sys.stdin.readline", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.stdin", "line_nu...
71833989174
import sys # sys.path.append('../') sys.path.insert(0, '../') import unittest import numpy as np import time import pybullet as p class Test_Continous_collision(unittest.TestCase): @classmethod def setUpClass(cls): p.connect(p.DIRECT) # p.connect(p.GUI) p.setGravity(0, 0, -10) ...
k-maheshkumar/trajopt_python
tests/test_continous_collision.py
test_continous_collision.py
py
16,145
python
en
code
25
github-code
21
[ { "api_name": "sys.path.insert", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pybullet.connect",...
35883521791
from typing import Optional, Callable, TypeVar from osmium._osmium import SimpleHandler from osmium.osm import Node, Way, Relation, Area, Changeset T = TypeVar('T') HandlerFunc = Optional[Callable[[T], None]] def make_simple_handler(node: HandlerFunc[Node] = None, way: HandlerFunc[Way] = Non...
osmcode/pyosmium
src/osmium/helper.py
helper.py
py
1,372
python
en
code
274
github-code
21
[ { "api_name": "typing.TypeVar", "line_number": 6, "usage_type": "call" }, { "api_name": "typing.Optional", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.Callable", "line_number": 7, "usage_type": "name" }, { "api_name": "osmium.osm.Node", "li...
375376536
import clu.metrics import clu.periodic_actions import jax import jax.numpy as jnp from flax import struct from jaxtyping import Array, Float, Int32, jaxtyped @jaxtyped @struct.dataclass class F1Score(clu.metrics.Metric): """ Class F1Score This class represents the F1 Score metric for evaluating classifica...
aaarrti/absl_extra
absl_extra/clu_utils.py
clu_utils.py
py
3,216
python
en
code
0
github-code
21
[ { "api_name": "clu.metrics.metrics", "line_number": 11, "usage_type": "attribute" }, { "api_name": "clu.metrics", "line_number": 11, "usage_type": "name" }, { "api_name": "jaxtyping.Float", "line_number": 25, "usage_type": "name" }, { "api_name": "jaxtyping.Array"...
17070920628
#!/usr/bin/env python3 import sys import time from . import FileDownloader from ..utils import common, DownloadError, ContentTooShortError class MGetDownloader(FileDownloader): def __init__(self, urlObj, fileObj, info): super(MGetDownloader, self).__init__(info) self.info = info self.urlObj = urlObj self.fi...
RameshRavone/mget
Mget/downloader/http.py
http.py
py
1,836
python
en
code
4
github-code
21
[ { "api_name": "utils.common._stderr", "line_number": 30, "usage_type": "call" }, { "api_name": "utils.common", "line_number": 30, "usage_type": "name" }, { "api_name": "utils.common.report", "line_number": 31, "usage_type": "call" }, { "api_name": "utils.common", ...
16523403401
import csv import sys import importlib importlib.reload(sys) from pdfminer.pdfparser import PDFParser,PDFDocument from pdfminer.pdfinterp import PDFResourceManager,PDFPageInterpreter from pdfminer.converter import PDFPageAggregator from pdfminer.layout import LTTextBoxHorizontal,LAParams from pdfminer.pdfinte...
changhao2882/changhao0001
django/untitled/文件的封装/dealFile.py
dealFile.py
py
4,740
python
en
code
0
github-code
21
[ { "api_name": "importlib.reload", "line_number": 4, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 27, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 36, "usage_type": "call" }, { "api_name": "pdfminer.pdfparser.PDFParser", ...
73029434293
from cvxpy import * from cvxpy.tests.base_test import BaseTest import unittest import numpy as np import scipy.sparse as sp class TestLS(BaseTest): """ LS solver tests. """ def test_regression(self): # Set the random seed to get consistent data np.random.seed(1) # Number of examples ...
LiuFang816/SALSTM_py_data
python/cvxgrp_cvxpy/cvxpy-master/cvxpy/tests/test_ls.py
test_ls.py
py
4,937
python
en
code
9
github-code
21
[ { "api_name": "cvxpy.tests.base_test.BaseTest", "line_number": 8, "usage_type": "name" }, { "api_name": "numpy.random.seed", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 13, "usage_type": "attribute" }, { "api_name": "num...
42227173852
# -*- coding: UTF-8 -*- """ =========== arr_scatter =========== Script : arr_scatter.py Author : Dan_Patterson@carleton.ca Modified : 2019-03-07 Purpose: -------- Sample scatterplot plotting, in 2D and 3D Notes ----- >>> print(plt.style.available) >>> import matplotlib.pyplot.figure ...
Dan-Patterson/arraytools
arraytools/graphing/arr_scatter.py
arr_scatter.py
py
6,693
python
en
code
3
github-code
21
[ { "api_name": "numpy.set_printoptions", "line_number": 49, "usage_type": "call" }, { "api_name": "numpy.ma.masked_print_option.set_display", "line_number": 51, "usage_type": "call" }, { "api_name": "numpy.ma", "line_number": 51, "usage_type": "attribute" }, { "api...
8763070829
import streamlit as st import seaborn as sns import matplotlib.pyplot as plt st.subheader("Feature Selection") fe_df = st.session_state.updated_df.copy() st.write("#### Correlation Map") st.write(fe_df.corr()) fig = plt.figure(figsize=(30,20)) sns.heatmap(fe_df.corr(), annot=True, vmin=-1, vmax=1, cmap = 'YlGnBu') s...
muneeb-ds/clustering-sandbox
pages/4_FeatureEngineering.py
4_FeatureEngineering.py
py
1,197
python
en
code
0
github-code
21
[ { "api_name": "streamlit.subheader", "line_number": 5, "usage_type": "call" }, { "api_name": "streamlit.session_state.updated_df.copy", "line_number": 7, "usage_type": "call" }, { "api_name": "streamlit.session_state", "line_number": 7, "usage_type": "attribute" }, { ...
37147194930
from django.urls import path from django.views.generic import TemplateView from mailing_service import views as custom_views app_name = 'mailing_service' urlpatterns = [ path('', TemplateView.as_view(template_name='index.html'), name='homepage'), path('mailing-menu/', custom_views.MailingMenuView.as_view(), ...
Abramov0Alexandr/mailing_service_project
mailing_service/urls.py
urls.py
py
1,816
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.views.generic.TemplateView.as_view", "line_number": 9, "usage_type": "call" }, { "api_name": "django.views.generic.TemplateView", "line_number": 9, "usage_type": "name" }, ...
13773077463
"""Extract Genbank info""" from Bio import SeqIO def get_locus(genbank_file): """ The get_locus function takes a genbank file and returns the locus number of that record. If there is only one record in the genbank file, it will return the possible_name. If there are multiple records, it will return a ...
RdrigoE/insaflu_snakemake
workflow/scripts/extract_gb_info.py
extract_gb_info.py
py
9,737
python
en
code
1
github-code
21
[ { "api_name": "Bio.SeqIO.parse", "line_number": 18, "usage_type": "call" }, { "api_name": "Bio.SeqIO", "line_number": 18, "usage_type": "name" }, { "api_name": "Bio.SeqIO.parse", "line_number": 36, "usage_type": "call" }, { "api_name": "Bio.SeqIO", "line_numbe...
72625236852
# Author: Lennart Seeger # This file is based on a notebook created by Rishit Dagli and available at https://keras.io/examples/vision/nnclr/ # Please regard the additional license regulations of the original notebook authors. # # All changes and extensions are licensed under the Apache 2.0 license available at # http:/...
lennartseeger/IFEfNNS
src/models/nnclr.py
nnclr.py
py
10,911
python
en
code
1
github-code
21
[ { "api_name": "sys.path.insert", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "keras.models.Sequential", "line_number": 20, "usage_type": "call" }, { "api_name": "keras.models", ...
36588342052
# -*- encoding: utf-8 -*- import folium import pandas as pd import json import numpy from dbfread import DBF import csv import webbrowser category = "A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15,A16,A17,A18,A19,A20,A21,A22,A23,A24,A25,A26,A27,A28,A29,A30" category = list(map(str, category.split(','))) categor...
tw0226/Analysis_Seoul
visualization.py
visualization.py
py
3,211
python
en
code
0
github-code
21
[ { "api_name": "dbfread.DBF", "line_number": 21, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 23, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 31, "usage_type": "call" }, { "api_name": "folium.Map", "line_number"...
8019692103
alias_help = """ Dynamic alias creator for system Windows. Features: - execute program in fork, or in current command line - custom static invoke arguments Requirements: - python - folder with script in system PATH EXAMPLES: 1) Register this script as new alias with name 'alias': python {script}...
trzecieu/alias
alias.py
alias.py
py
6,270
python
en
code
0
github-code
21
[ { "api_name": "os.path.realpath", "line_number": 40, "usage_type": "call" }, { "api_name": "os.path", "line_number": 40, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 42, "usage_type": "call" }, { "api_name": "os.path", "line_num...
27421957321
import cv2 import numpy as np img_rgb = cv2.imread('img/crack2.bmp') img = cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY) template = cv2.imread('img/template.bmp',0) print(template.shape[::-1]) w, h = template.shape[::-1]
waranyadatong/InspectionMachine
shape.py
shape.py
py
220
python
en
code
1
github-code
21
[ { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 5, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_n...
27848914035
import numpy as np from ..tools.listFiles import listFiles from .readAvailability import readAvailability import os from .. import globs def listAllAvailability(dateLim=[19950101,20041231]): fpath = globs.dataPath + '/Availability' _,fnames = listFiles(fpath,ReturnNames=True) nf = fnames.size out = [] ...
mattkjames7/gmagfft
gmagfft/mags/listAllAvailability.py
listAllAvailability.py
py
572
python
en
code
0
github-code
21
[ { "api_name": "tools.listFiles.listFiles", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.splitext", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "readAvailabil...
1836116381
import os, csv from load_utils import spss_to_posix from models import Mortgage from decimal import Decimal from django.contrib.gis.geos import Point mortgage_file = '/mnt/ebs/data/repdata_mort_2012q4_Fellows.tsv' def run(verbose = True): load_mortgages(mortgage_file, verbose = verbose) def load_mortgages(mortgage...
dssg/land-bank
web/landbank_data/file_import/load_mort.py
load_mort.py
py
3,793
python
en
code
8
github-code
21
[ { "api_name": "csv.reader", "line_number": 14, "usage_type": "call" }, { "api_name": "models.Mortgage.objects.count", "line_number": 17, "usage_type": "call" }, { "api_name": "models.Mortgage.objects", "line_number": 17, "usage_type": "attribute" }, { "api_name": ...
10033498558
from concurrent.futures import TimeoutError from google.api_core.exceptions import AlreadyExists from google.cloud import pubsub_v1 import json import os # Set environment variable if "GOOGLE_APPLICATION_CREDENTIALS" not in os.environ: os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "project-credentials.json" # Lo...
maskebe/iot
test_pubsub.py
test_pubsub.py
py
2,025
python
en
code
0
github-code
21
[ { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "google.cloud.pubsub_v1.subsc...
39099422171
from os.path import abspath from pyspark.sql import SparkSession from pyspark.sql import Row warehouse_location = abspath('spark-warehouse') spark = SparkSession \ .builder \ .appName("Python Spark SQL Hive integration example") \ .config("spark.sql.warehouse.dir", warehouse_location) \ .enableHiveSu...
igory1999/Spark
labs/4/hive.py
hive.py
py
575
python
en
code
0
github-code
21
[ { "api_name": "os.path.abspath", "line_number": 6, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 8, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 8, "usage_type": "attribute" }...
31230687882
import warnings warnings.filterwarnings("ignore") import models import datas import configs import argparse import torch import torchvision import torchvision.transforms as TF import torch.optim as optim import torch.nn as nn import torch.nn.functional as F import time import os from math import log10 import numpy as...
lyh-18/EQVI
interpolate_EQVI.py
interpolate_EQVI.py
py
4,955
python
en
code
112
github-code
21
[ { "api_name": "warnings.filterwarnings", "line_number": 2, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 29, "usage_type": "call" }, { "api_name": "utils.config.Config.from_file", "line_number": 34, "usage_type": "call" }, { "api_...
73557193971
# HW2-Logistic Regression import sys import numpy as np import pandas as pd import csv import matplotlib.pyplot as plt ### Parameters ### RAWDATA_PATH = './dataset/train.csv' OBSERVE_PATH = './dataset/test.csv' SUBMISSION_PATH = './dataset/sample_submission.csv' RAW_FEATURE_PATH = './dataset/X_train' # afte...
willyouyang/MachineLearningForPython
ML2019FALL/hw2-Classfication/LogisticRegression_v2.py
LogisticRegression_v2.py
py
12,954
python
en
code
0
github-code
21
[ { "api_name": "numpy.array", "line_number": 31, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.min", "line_number": 39, ...
25434886517
import numpy as np import cv2 import gym from copy import deepcopy import torch from torch._six import inf def mean_of_list(func): def function_wrapper(*args, **kwargs): lists = func(*args, **kwargs) return [sum(list) / len(list) for list in lists[:-4]] + [explained_variance(lists[-4], lists[-3])]...
alirezakazemipour/PPO-RND
Common/utils.py
utils.py
py
6,842
python
en
code
35
github-code
21
[ { "api_name": "cv2.cvtColor", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.COLOR_RGB2GRAY", "line_number": 19, "usage_type": "attribute" }, { "api_name": "cv2.resize", "line_number": 20, "usage_type": "call" }, { "api_name": "cv2.INTER_AREA", ...
21292388730
from django.test import TestCase from django.contrib.auth import get_user_model from socialapp import models; class TestFriends(TestCase): @classmethod def setUpTestData(cls): User = get_user_model(); cls.user1 = User.objects.create_user('user1', 'user1@user.com') cls.user2 = User.objects.create_user('user2',...
Nessphoro/group-CMPUT404-project
src/backend/socialapp/tests/friends.py
friends.py
py
3,158
python
en
code
1
github-code
21
[ { "api_name": "django.test.TestCase", "line_number": 5, "usage_type": "name" }, { "api_name": "django.contrib.auth.get_user_model", "line_number": 9, "usage_type": "call" }, { "api_name": "socialapp.models.Author.objects.create", "line_number": 15, "usage_type": "call" ...
37905497951
import torch import torch.nn as nn # Define the flow encoder class FlowEncoder(nn.Module): def __init__(self): super(FlowEncoder, self).__init__() self.conv1 = nn.Conv2d(in_channels, 64, kernel_size=7, stride=2, padding=3) self.conv2 = nn.Conv2d(64, 128, kernel_size=3, stride=1, pad...
GeoSciLab/TemDeep
models/FlowEstimationNet.py
FlowEstimationNet.py
py
2,380
python
en
code
0
github-code
21
[ { "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.Conv2d", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn", "line_numbe...
22810635583
import tensorflow as tf import numpy as np from model import * from util import * import argparse import os.path from generator import * def train(conf, data, learning_rate=0.001): X = tf.placeholder(tf.float32, shape=[None, conf.img_height, conf.img_width, conf.channel]) # h = tf.placeholder(tf.float32, shape=[Non...
vietthang207/pixelCnn
main.py
main.py
py
5,002
python
en
code
0
github-code
21
[ { "api_name": "tensorflow.placeholder", "line_number": 10, "usage_type": "call" }, { "api_name": "tensorflow.float32", "line_number": 10, "usage_type": "attribute" }, { "api_name": "tensorflow.train.AdamOptimizer", "line_number": 18, "usage_type": "call" }, { "api...
23494880120
import tweepy import snap import numpy as np import csv # Load API consumer_key = "" consumer_secret = "" access_token = "" access_token_secret = "" auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_token, access_token_secret) API = tweepy.API(auth) # Load followers and followee...
skagankose/sehirTweets
createGraph.py
createGraph.py
py
3,299
python
en
code
0
github-code
21
[ { "api_name": "tweepy.OAuthHandler", "line_number": 12, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.load", "line_numb...
10272246992
import utils import pandas as pd from sklearn.utils import shuffle class DataLoader(): def __init__(self, config): self.smiles2fingerprint = dict() self.smiles2maccs = dict() if config['args_dataset'] == 'biosnap' or config['args_dataset'] == 'unseen_drug_biosnap': train_cpi...
wentao228/KG-CPI
data_loader.py
data_loader.py
py
2,699
python
en
code
0
github-code
21
[ { "api_name": "sklearn.utils.shuffle", "line_number": 31, "usage_type": "call" }, { "api_name": "sklearn.utils.shuffle", "line_number": 32, "usage_type": "call" }, { "api_name": "sklearn.utils.shuffle", "line_number": 33, "usage_type": "call" }, { "api_name": "pan...
29393877967
from django.contrib.auth.models import User from friendships.api.paginations import FriendshipPagination from friendships.api.serializers import ( FollowerSerializer, FollowingSerializer, FriendshipSerializerForCreate, ) from friendships.models import Friendship from friendships.services import FriendshipSe...
LilCybe/Django_Twitter_Project
friendships/api/views.py
views.py
py
3,985
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.viewsets.GenericViewSet", "line_number": 16, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 16, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.User.objects.all", "line_number": 22, "usa...
9240801294
# trunk-ignore(ruff/D400) # trunk-ignore(ruff/D415) """added file_name column to attachments table Revision ID: ba92b48a6dd1 Revises: 1da97c81acd7 Create Date: 2023-03-29 16:26:49.645588 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = "ba92b48a6dd1" down_revisi...
Yahya-git/To-Do-List-MS
alembic/versions/ba92b48a6dd1_added_file_name_column_to_attachments_.py
ba92b48a6dd1_added_file_name_column_to_attachments_.py
py
765
python
en
code
0
github-code
21
[ { "api_name": "alembic.op.add_column", "line_number": 23, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 23, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 23, "usage_type": "call" }, { "api_name": "sqlalchemy.String"...
5227638708
import logging from typing import Callable, List import numpy as np import torch import torch.nn as nn from torch.distributions import Categorical from torch import optim from hprl.policy.policy import Policy from hprl.policy.util import to_tensor_for_trajectory, compute_reward_to_go from hprl.policy.policy import Ad...
AmoyZhp/traffic_light_control
traffic_light_control/hprl/policy/single/actor_critic.py
actor_critic.py
py
7,635
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "hprl.policy.policy.Policy", "line_number": 18, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 21, "usage_type": "attribute" }, { "api_name": "torc...
8540909018
# ======================= # Importing the libraries # ======================= import sys import numpy as np from tqdm import tqdm from time import time import matplotlib.pyplot as plt #import tikzplotlib print( '------------' ) print( 'COMPARATION:' ) print( '------------' ) # ------------ # current work # -------...
marquesleandro/validation
aleCavity/relativeError/relativeError.py
relativeError.py
py
8,873
python
en
code
0
github-code
21
[ { "api_name": "numpy.zeros", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": ...
2921832668
from load_model import * from copy import deepcopy from tqdm import tqdm from torch import optim class approx_fnn: def __init__( self, width, target_depth, frozen_depth, rank, use_bias, activation, std = .25, method = 'ours', batch_siz...
UW-Madison-Lee-Lab/Expressive_Power_of_LoRA
run_exp.py
run_exp.py
py
42,268
python
en
code
9
github-code
21
[ { "api_name": "torch.ones", "line_number": 64, "usage_type": "call" }, { "api_name": "torch.ones", "line_number": 65, "usage_type": "call" }, { "api_name": "torch.block_diag", "line_number": 66, "usage_type": "call" }, { "api_name": "torch.randn", "line_number...
72915296694
from requests import get from json import dumps def getFinantialURL(typeFinantial = "stock"): if typeFinantial == "stock": return "quote" elif typeFinantial == "crypto": return typeFinantial def getStockData(stockCode = ["PETR4"]): urlBase = f"https://brapi.dev/api/{getFinantialURL()}/{...
leocesar1/financial-analysis-using-Python
libs/importData.py
importData.py
py
1,384
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 14, "usage_type": "call" } ]
15740244966
from flask import Flask, session, jsonify, request import flask_restful import pandas as pd import numpy as np import pickle import diagnostics import json import os ######################Set up variables for use in our script app = Flask(__name__) app.secret_key = '1652d576-484a-49fd-913a-6879acfa6ba4' a...
jckuri/Dynamic_Risk_Assessment_System
app.py
app.py
py
2,588
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_restful.Api", "line_number": 13, "usage_type": "call" }, { "api_name": "json.load", "line_number": 17, "usage_type": "call" }, { "api_name": "flask_restful.Resource", ...
32181489905
import logging import uuid from typing import TYPE_CHECKING import dask.dataframe as dd import pandas as pd from dask_sql.datacontainer import ColumnContainer, DataContainer from dask_sql.physical.rel.base import BaseRelPlugin if TYPE_CHECKING: import dask_sql from dask_sql._datafusion_lib import LogicalPlan...
dask-contrib/dask-sql
dask_sql/physical/rel/custom/predict_model.py
predict_model.py
py
3,535
python
en
code
336
github-code
21
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 11, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "dask_sql.physical.rel.base.BaseRelPlugin", "line_number": 18, "usage_type": "name" }, { "a...
74547657652
from collections import defaultdict def jaccard_similarity(users1, users2): set1 = set(users1) set2 = set(users2) intersection = len(set1.intersection(set2)) union = len(set1.union(set2)) return intersection / union if union != 0 else 0 def top_k_similar_pairs(website_user_pairs, k): ...
Shivkisku/Python_adv
top_website_similarity.py
top_website_similarity.py
py
1,537
python
en
code
0
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 13, "usage_type": "call" } ]
30597685245
import argparse import json import tensorflow as tf import time from pck import get_pck_with_sigma,get_pck_with_pixel import numpy as np from utils import * import os import logging import matplotlib.pyplot as plt from sklearn.metrics import auc parser = argparse.ArgumentParser(description='Choose dataset, a...
hanchenchen/Attention-A-Lightweight-2D-Hand-Pose-Estimation-Approach-master
compare.py
compare.py
py
2,345
python
en
code
7
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 20, "usage_type": "attribute" }, { "api_name": "tensorflow.io.gfile.glob", "line_number": 22, "usage_type": "call" }, { "api_name": "tens...
165927584
from models import degrade from models import vae_style from torch import nn import torch from models.vgg import vgg ##weight initialization tooo? class Net(nn.Module): def __init__(self, encoder): super(Net, self).__init__() self.vae = vae_style.se50_fc() ## LATENT 256: Hardcoded for c...
nprithviraj24/face-hallucination
vae/sample.py
sample.py
py
1,696
python
en
code
4
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "models.vae_style.se50_fc", "line_number": 14, "usage_type": "call" }, { "api_name": "models.vae_sty...
9031543581
# @Author: Li # @FileName: GA_sko_opt.py # @Time: 2021/10/30 19:48 import matplotlib.pyplot as plt import numpy as np import pandas as pd from sko.GA import GA # 适应度函数,求取最大值 # 因为GA函数是求最小值,所以我在适应度函数上加一个负号 # GA要求输入维度2维及其以上,所以我传入2个参数,第二维x2不用 a = 20 b = 0.2 c = 2 * np.pi def schaffer(p): """ This function has ...
lwh104/GA
GA_sko_opt.py
GA_sko_opt.py
py
1,185
python
en
code
0
github-code
21
[ { "api_name": "numpy.pi", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.exp", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.power", "line_number": 2...
15333471144
import logging import re from grimoirelab_toolkit.datetime import str_to_datetime, unixtime_to_datetime from .enrich import Enrich, metadata logger = logging.getLogger(__name__) class FunctestEnrich(Enrich): BOOST_PROJECTS = ['functest', 'storperf', 'vsperf', 'bottlenecks', 'qtip', 'yardstick'] def get_...
chaoss/grimoirelab-elk
grimoire_elk/enriched/functest.py
functest.py
py
5,478
python
en
code
58
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "enrich.Enrich", "line_number": 12, "usage_type": "name" }, { "api_name": "re.fullmatch", "line_number": 45, "usage_type": "call" }, { "api_name": "re.fullmatch", "line_...
20426039354
from django.conf import settings as django_settings from django.core.mail import send_mail from django.db.models import Q from django.db.models import F from django.db.models import Sum from django.shortcuts import get_object_or_404 from django.shortcuts import render from django.utils import timezone from faker import...
aclark4life/aclark-net-2018-2
aclarknet/database/utils.py
utils.py
py
29,724
python
en
code
1
github-code
21
[ { "api_name": "faker.Faker", "line_number": 31, "usage_type": "call" }, { "api_name": "django.shortcuts.get_object_or_404", "line_number": 64, "usage_type": "call" }, { "api_name": "obj.profile", "line_number": 66, "usage_type": "attribute" }, { "api_name": "query...
42826231564
import requests import xml.etree.ElementTree as ET import re import sys, os import time, nltk from nltk.stem import PorterStemmer from nltk.tokenize import word_tokenize sys.path.append('../Utils') from Utils.minEditDist import minEditDist class PubMedParser: path = 'PubmedArticle/MedlineCitation/Article' index...
KunChi232/108_BIR_Homework
PubMed_WebCrawler/main.py
main.py
py
11,070
python
en
code
0
github-code
21
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "nltk.stem.PorterStemmer", "line_number": 13, "usage_type": "call" }, { "api_name": "xml.etree.Element...
18421211765
from xml.dom import EMPTY_NAMESPACE from StillWeb.sw_util import getChildText, getChildElementsNS from StillWeb.LinkRewriter import HTML_CRITERIA, rewrite_links # # Plugin interface # class MyFiltersPlugin: def __init__(self, framework): self._framework = framework pg_plugin = self._framework.plu...
dlitz/stillweb
StillWeb/MyFilters.py
MyFilters.py
py
3,660
python
en
code
2
github-code
21
[ { "api_name": "StillWeb.sw_util.getChildElementsNS", "line_number": 31, "usage_type": "call" }, { "api_name": "xml.dom.EMPTY_NAMESPACE", "line_number": 31, "usage_type": "argument" }, { "api_name": "StillWeb.sw_util.getChildElementsNS", "line_number": 32, "usage_type": "c...
72690832054
import torch import torch.nn as nn layer = nn.Conv2d(1, 3, kernel_size=3, stride=1, padding=0) # 输入为单通道灰度图像,用3个3*3的卷积核卷积,步长为1,未加padding x = torch.rand(1, 1, 28, 28) y = layer.forward(x) print(y.shape) layer1 = nn.Conv2d(1, 3, kernel_size=3, stride=1, padding=1) # 增加1padding,卷积后的图片尺寸不变 y1 = layer1.forward(x) print(y1...
hang803/CNN
main.py
main.py
py
699
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Conv2d", "line_number": 4, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 4, "usage_type": "name" }, { "api_name": "torch.rand", "line_number": 5, "usage_type": "call" }, { "api_name": "torch.nn.Conv2d", "line_number":...
28622595693
import logging import os import subprocess import sys from dbnd_airflow.utils import create_airflow_pool # DO NOT IMPORT ANYTHING FROM AIRFLOW # we need to initialize some config values first from dbnd import dbnd_config # isort:skip from dbnd._core.context.bootstrap import dbnd_system_bootstrap # isort:skip def...
kalebinn/dbnd
modules/dbnd-airflow/src/dbnd_airflow/dbnd_airflow_main.py
dbnd_airflow_main.py
py
3,257
python
en
code
null
github-code
21
[ { "api_name": "airflow.configuration.conf.get", "line_number": 22, "usage_type": "call" }, { "api_name": "airflow.configuration.conf", "line_number": 22, "usage_type": "name" }, { "api_name": "os.environ.copy", "line_number": 23, "usage_type": "call" }, { "api_nam...
15276892375
#!flask/bin/python from flask import Flask, jsonify, request import sys import os import subprocess app = Flask(__name__) @app.route('/', methods=['POST']) def index(): data = request.get_json() word = data["discover"] ntweets = data["ntweets"] interested = data["interested"] print('...
nicase/BullyPolice
pythonService/flaskApi.py
flaskApi.py
py
805
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.request.get_json", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 11, "usage_type": "name" }, { "api_name": "os.fork", "line_n...
73962235253
from django.contrib.auth.decorators import login_required from django.core.cache import cache from django.shortcuts import redirect, render from django.urls import reverse_lazy from django.views.generic.edit import DeleteView from .forms import ProfileUpdateForm, VacationUpdateForm from .models import Vacation from .u...
LevityLoveLight/django_crm_test_project
vacation_service/users/views.py
views.py
py
2,603
python
en
code
0
github-code
21
[ { "api_name": "django.core.cache.cache.get", "line_number": 17, "usage_type": "call" }, { "api_name": "django.core.cache.cache", "line_number": 17, "usage_type": "name" }, { "api_name": "models.Vacation.objects.all", "line_number": 22, "usage_type": "call" }, { "a...
15081689927
import itertools from random import sample def calc_euclidean_distance(v1, v2): sum_distance = 0 for pos1, pos2 in zip(v1, v2): sum_distance += (float(pos2) - float(pos1)) ** 2 return sum_distance def calculate_centroid(members): partial_sum = [sum(e) for e in zip(*members)] return tuple...
BrunoKedzierski/Artifical-Intelligence-Tools
Kmeans/KClassifier.py
KClassifier.py
py
1,978
python
en
code
0
github-code
21
[ { "api_name": "itertools.combinations", "line_number": 26, "usage_type": "call" }, { "api_name": "random.sample", "line_number": 40, "usage_type": "call" } ]
74808806771
from collections import defaultdict d = defaultdict(list) with open('26-sg23.txt') as f: f.readline() for s in f.readlines(): k, i = map(int, s.split()) d[k].append(i) for k in d.keys(): d[k] = sorted(set(d[k])) mx_amount = 0 mx_n = 0 for k in sorted(d.keys(), reverse=True): cur_len =...
hypergraphman/grupa2ege23
task26/feb.sg23.py
feb.sg23.py
py
624
python
en
code
0
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 3, "usage_type": "call" } ]
15386265085
""" ----------------------------------------------------------------------------------- Authors: A. Ramirez-Morales htcondor job submitter usage: python3 ./scripts/submit_stats_svm.py sample_name boot/kfold exotic/single ----------------------------------------------------------------------------------- """ from sys...
unciafidelis/SVM-physics
scripts/submit_stats_svm.py
submit_stats_svm.py
py
1,515
python
en
code
3
github-code
21
[ { "api_name": "os.getcwd", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 14, "usage_type": "argument" }, { "api_name": "sys.argv", "line_number": 17, "usage_type": "argument" }, { "api_name": "sys.argv", "line_number": 18,...
40322035154
import timm import torch from PIL import Image from timm.data import resolve_data_config from timm.data.transforms_factory import create_transform CHECKPOINT_PATH = "C:\\Users\\gates\\Desktop\\project\\checkpoint-0.pth.tar" model = timm.create_model('vit_base_patch16_224_miil_in21k', num_classes=84) checkpoint = tor...
gatestan13/plankthon
src/imsofuckingdone.py
imsofuckingdone.py
py
818
python
en
code
0
github-code
21
[ { "api_name": "timm.create_model", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.load", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 11, "usage_type": "call" }, { "api_name": "timm.data.resolve_data_conf...
5745259359
#!/usr/bin/python3 """ Request a RestAPI """ import json import requests from sys import argv if __name__ == '__main__': """ """ u_id = int(argv[1]) # APIS url todo_url = "https://jsonplaceholder.typicode.com/todos" user_url = "https://jsonplaceholder.typicode.com/users" user = requests.get(u...
Imartino4/holbertonschool-back-end
api/0-gather_data_from_an_API.py
0-gather_data_from_an_API.py
py
854
python
en
code
0
github-code
21
[ { "api_name": "sys.argv", "line_number": 11, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 16, "usage_type": "call" } ]
20079489341
import pygame class Settings: """A class to store all settings for Jet Fighter.""" def __init__(self): """Initialize the game's settings.""" # Screen settings self.screenWidth = 1200 self.screenHeight = 800 self.bgColor = (230, 230, 230) self.bg = pygame.image.lo...
bd3young/pygame
settings.py
settings.py
py
1,642
python
en
code
0
github-code
21
[ { "api_name": "pygame.image.load", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pygame.mixer.Sound", "line_number": 23, "usage_type": "call" }, { "api_name": "pygame.mixer",...
18383013771
import os import time import pytest import wazuh_testing as fw from wazuh_testing import event_monitor as evm from wazuh_testing.wazuh_db import query_wdb, insert_agent_in_db from wazuh_testing.tools.services import delete_dbs from wazuh_testing.tools.file import get_list_of_content_yml # Marks pytestmark = [pytest.m...
wazuh/wazuh-qa
tests/integration/test_wazuh_db/test_set_agent_groups.py
test_set_agent_groups.py
py
3,923
python
en
code
29
github-code
21
[ { "api_name": "pytest.mark", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pytest.mark.tier", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
1203942171
# reduce() = applies function of choosing to single cum value # performs function on first two ele and repeats until 1 value remains # reduce(funciton, iterable) import functools #letters = ('H', 'E', 'L', 'L', 'O') #word = functools.reduce(lambda x, y: x + y, letters) #print(word) def factorial(num): ...
rodiiipooo/learningPython
day10/reduceFunction.py
reduceFunction.py
py
507
python
en
code
1
github-code
21
[ { "api_name": "functools.reduce", "line_number": 19, "usage_type": "call" } ]
25093011641
from django.urls import path from .views import( postProject, BidsDeleteView, makeBid, ProjectsListView, BidsUpdateView, viewBidsOnProjects, ProjectDeleteView, ProjectUpdateView, assignTo, ViewProject, ) urlpatterns = [ path('post/', postProject, name="post-bid"), path('...
SketchFrame/sframe
bids/urls.py
urls.py
py
1,033
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 16, "usage_type": "call" }, { "api_name": "views.postProject", "line_number": 16, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 17, "usage_type": "call" }, { "api_name": "views.Project...
35981330105
from abc import ABC,abstractmethod import json class Predictor(ABC): def __init__(self, step, umbral ,results_loc, log_loc): self._step = step self._results_loc = results_loc self._log_loc = log_loc self._umbral = umbral @abstractmethod def _get_prediction(self, item): pass def _save_data(self, dat...
jnparedes/Netder_experiment
FakeNewsData/Predictor.py
Predictor.py
py
2,111
python
en
code
1
github-code
21
[ { "api_name": "abc.ABC", "line_number": 4, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 12, "usage_type": "name" }, { "api_name": "json.dump", "line_number": 22, "usage_type": "call" }, { "api_name": "json.load", "line_number": 25...
25621072174
from tkinter import * from tkinter import ttk from PIL import ImageTk, Image #FlipProxy sample_nameA = "Bant Spirits" sample_mainA = ("2 Anafenza, Kin-Tree Spirit" + "\n1 Birds of Paradise" + "\n2 Breeding Pool" + "\n2 Cavern of Souls" + "\n4 Collected Company" + "\n4 Drogskol Captain" + "\n3 Flooded Strand"...
dwinniford/MTG-Proxy-Generator
Archive/menu.py
menu.py
py
6,128
python
en
code
0
github-code
21
[ { "api_name": "PIL.ImageTk.PhotoImage", "line_number": 147, "usage_type": "call" }, { "api_name": "PIL.ImageTk", "line_number": 147, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 147, "usage_type": "call" }, { "api_name": "PIL.Image", ...
32181382305
import dask.dataframe as dd import pandas as pd from dask_sql import Context c = Context() data = """ name,x Alice,34 Bob, """ df = pd.DataFrame({"name": ["Alice", "Bob", "Chris"] * 100, "x": list(range(300))}) ddf = dd.from_pandas(df, npartitions=10) # This needs to be temprarily disabled since this query require...
dask-contrib/dask-sql
continuous_integration/recipe/run_test.py
run_test.py
py
683
python
en
code
336
github-code
21
[ { "api_name": "dask_sql.Context", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 14, "usage_type": "call" }, { "api_name": "dask.dataframe.from_pandas", "line_number": 15, "usage_type": "call" }, { "api_name": "dask.data...
9817142032
# -*- coding: utf-8 -*- import scrapy,json from lxml import etree from ..items import ScrapdownloadermiddleItem class TenPythonSpider(scrapy.Spider): name = 'ten_python' allowed_domains = ['tencent.com'] print(3) start_urls = [ "https://careers.tencent.com/tencentcareer/api/post/Query?timestam...
DingDang56/spider-spider
myset/scrapdownloadermiddle/scrapdownloadermiddle/spiders/ten_python.py
ten_python.py
py
2,490
python
en
code
0
github-code
21
[ { "api_name": "scrapy.Spider", "line_number": 7, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 20, "usage_type": "call" }, { "api_name": "items.ScrapdownloadermiddleItem", "line_number": 35, "usage_type": "call" }, { "api_name": "scrapy.R...
24069695376
import board import neopixel import cv2 import numpy as np import re import time x_pixel = 18 y_pixel = 10 pixel_pin = board.D18 num_pixels = (2*x_pixel+2*y_pixel) off = (0, 0, 0) ORDER = neopixel.GRB pixels = neopixel.NeoPixel(pixel_pin, num_pixels, brightness=0.3, auto_write=False, pixel_order=ORDER) pixels.fill(of...
StefanRothhaupt/Project-Ambilight
1-Code/ambilight.py
ambilight.py
py
3,836
python
en
code
0
github-code
21
[ { "api_name": "board.D18", "line_number": 9, "usage_type": "attribute" }, { "api_name": "neopixel.GRB", "line_number": 13, "usage_type": "attribute" }, { "api_name": "neopixel.NeoPixel", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.cvtColor", ...
15224679567
import importlib import logging import re import sys import types from unittest.mock import Mock, call, ANY import pytest import apprise from helpers import reload_plugin # Disable logging for a cleaner testing output logging.disable(logging.CRITICAL) # Skip tests when Python environment does not provide the `dbu...
caronc/apprise
test/test_plugin_glib.py
test_plugin_glib.py
py
16,273
python
en
code
8,936
github-code
21
[ { "api_name": "logging.disable", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.CRITICAL", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sys.modules", "line_number": 19, "usage_type": "attribute" }, { "api_name": "pytest.skip", ...
5751432909
import openpyxl, pprint from openpyxl.styles import Font, NamedStyle, Color from openpyxl.chart import ScatterChart, Series, Reference from openpyxl.chart.layout import Layout, ManualLayout """ {"sheet1":grid[][], "sheet2":grid[][]...} """ class ex_doc(): def __init__(self): self.sheets = [] class exc...
iorilan/py_tiny_apps_playground
excel/excel_helper.py
excel_helper.py
py
4,859
python
en
code
1
github-code
21
[ { "api_name": "openpyxl.load_workbook", "line_number": 16, "usage_type": "call" }, { "api_name": "openpyxl.load_workbook", "line_number": 32, "usage_type": "call" }, { "api_name": "openpyxl.Workbook", "line_number": 52, "usage_type": "call" }, { "api_name": "openp...
15336212346
# -*- coding:utf-8 -*- import json from websocket import create_connection class WsClient: def __init__(self, ip, port): address = 'ws://' + ip + ':' + port print(address) self.ws = create_connection(address) def send_msg(self, msg): self.ws.send(json.dumps(msg)) if __nam...
gkf442573575/learn
Python/websocket/01_client.py
01_client.py
py
443
python
en
code
0
github-code
21
[ { "api_name": "websocket.create_connection", "line_number": 13, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 16, "usage_type": "call" } ]
5946108209
from django.db.models.signals import post_save from django.dispatch import receiver from notifications.models import ReservationNotification from reservations.models import Reservation from datetime import datetime, timedelta @receiver(post_save, sender=Reservation) def create_reservation_notification(sender, instance...
jenydu/Restify
group_project/P2/restify/reservations/signals.py
signals.py
py
2,455
python
en
code
0
github-code
21
[ { "api_name": "notifications.models.ReservationNotification.objects.create", "line_number": 15, "usage_type": "call" }, { "api_name": "notifications.models.ReservationNotification.objects", "line_number": 15, "usage_type": "attribute" }, { "api_name": "notifications.models.Reserv...
8479165627
import config import threading import win32gui import time class Stopwatch(): def __init__(self): self.thread_timer = threading.Thread(target=self.update_timer) self.is_stopped = False self.is_false_window = False self.start_time = time.time() self.thread_timer.start() print("Start the stopwatch") def ...
olehskip/dinoBot
src/stopwatch.py
stopwatch.py
py
934
python
en
code
0
github-code
21
[ { "api_name": "threading.Thread", "line_number": 9, "usage_type": "call" }, { "api_name": "time.time", "line_number": 12, "usage_type": "call" }, { "api_name": "time.time", "line_number": 18, "usage_type": "call" }, { "api_name": "win32gui.GetWindowText", "lin...
28351954883
import pandas as pd #import plotly as py import plotly.graph_objs as go smawindow = 100 mainlineopacity = 0.3 df = pd.read_csv("zscoresv2.csv") x = df['Generation'] rollavg = df['Current Average'].rolling(window=int(smawindow/5)).mean() rollhigh = df['Current High'].rolling(window=int(smawindow/5)).mean(...
7Elev3n/Genetic-Algorithm-Burger-King
v0 - Non-integrated/zzplotme.py
zzplotme.py
py
1,669
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "plotly.graph_objs.Scatter", "line_number": 15, "usage_type": "call" }, { "api_name": "plotly.graph_objs", "line_number": 15, "usage_type": "name" }, { "api_name": "plotly.gra...
41923222596
import numpy as np import cv2 def pyramid(): img = cv2.imread('E:/Python_Study/OpenCV/images/model.jpg', cv2.IMREAD_GRAYSCALE) tmp = img.copy() win_titles = ['Level 1', 'Level 2', 'Level 3'] g_down = [] g_up = [] img_shape = [] g_down.append(tmp) img_shape.append(tmp.shape) for i...
yongil1222/Python_Study
OpenCV/Ex16-3.ImagePyramid3.py
Ex16-3.ImagePyramid3.py
py
939
python
en
code
0
github-code
21
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.IMREAD_GRAYSCALE", "line_number": 5, "usage_type": "attribute" }, { "api_name": "cv2.pyrDown", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.pyrUp", "line_...
220327533
from flask import Blueprint, request, render_template, jsonify, current_app import string import random from flask_mail import Message from exts import mail, cache from utils import restful bp = Blueprint('front', __name__, url_prefix='/') @bp.route('/') def hello_world(): # put application's code here ...
Leavendger/study_flaskbbs
zlbbs-front/apps/front/views.py
views.py
py
2,045
python
en
code
0
github-code
21
[ { "api_name": "flask.Blueprint", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 39, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 39, "usage_type": "attribute" }, { "api_name": "flask.r...
23738023759
"""Test the SedDepEroder component. Test the sed dep eroder by turning it over a few times. No attempt has been made to ensure the solution is stable. Takes a topo already output and runs it a few more times, to ensure repeatability. """ import os from six.moves import range import numpy as np from numpy.testing imp...
David-Loibl/landlab
landlab/components/stream_power/tests/test_sed_flux_dep.py
test_sed_flux_dep.py
py
1,927
python
en
code
null
github-code
21
[ { "api_name": "os.path.abspath", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path.join", "line...
71387864693
import os import json import requests from json import load from hashlib import md5 from utils.output import * # suppress requests insecure warning requests.packages.urllib3.disable_warnings(requests.packages.urllib3.exceptions.InsecureRequestWarning) def check_moodle(url, sess): # checking if valid url try: ...
cyberaz0r/badmoodle
lib/version.py
version.py
py
2,963
python
en
code
23
github-code
21
[ { "api_name": "requests.packages.urllib3.disable_warnings", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.packages", "line_number": 12, "usage_type": "attribute" }, { "api_name": "requests.exceptions", "line_number": 20, "usage_type": "attribute" },...
33896867853
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union import attr from ..models.item_vendor_details_by_marketplace_replenishment_category import ( ItemVendorDetailsByMarketplaceReplenishmentCategory, ) from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.item_vendor_details_cate...
milyord/sp-api
sp/catalog_items_2022_04_01/models/item_vendor_details_by_marketplace.py
item_vendor_details_by_marketplace.py
py
6,437
python
en
code
1
github-code
21
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.TypeVar", "line_number": 14, "usage_type": "call" }, { "api_name": "typing.Union", "line_number": 36, "usage_type": "name" }, { "api_name": "types.Unset", "l...
75008114292
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import glob import os from typing import List, Set, Optional from source.utils.frozen import Frozen class VideoFilesSearcher(Frozen): """ Класс поиска видеофайлов для указанных дат. Например, если заданы настройки video_files_searcher = V...
cintock/fastplay
source/video_files_searcher.py
video_files_searcher.py
py
10,882
python
ru
code
0
github-code
21
[ { "api_name": "source.utils.frozen.Frozen", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 76, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 76, "usage_type": "attribute" }, { "api_name": "typ...
7173038727
"""This module contains a collection of functions which help in manage network connections and interfaces. General Note on python socket operations: If you use a hostname in the host portion of IPv4/v6 socket address,the program may show a nondeterministic behavior, as Python uses the first address returned fr...
threefoldtech/js-ng
jumpscale/sals/nettools/__init__.py
__init__.py
py
26,980
python
en
code
5
github-code
21
[ { "api_name": "typing.Optional", "line_number": 34, "usage_type": "name" }, { "api_name": "socket.create_connection", "line_number": 51, "usage_type": "call" }, { "api_name": "socket.timeout", "line_number": 53, "usage_type": "attribute" }, { "api_name": "typing.O...
1799766412
import torch from torch.utils.data.dataset import random_split def create_train_and_test(model_data, split_percent=0.9): train_len = int(len(model_data) * split_percent) sub_train, sub_valid = random_split(model_data, [train_len, len(model_data) - train_len]) return sub_train, sub_valid def get_percent_p...
agpar/reddit_rep2
machine_learning/archive/train_utils.py
train_utils.py
py
1,516
python
en
code
0
github-code
21
[ { "api_name": "torch.utils.data.dataset.random_split", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.equal", "line_number": 37, "usage_type": "call" } ]
17707597986
from django import forms from .models import ReportProblemTable class ReportProblemForm(forms.ModelForm): class Meta: model = ReportProblemTable fields = [ 'user_id', 'problem_description', 'serial_number', 'status_indicator1', ...
edenSofir/Home_Test
newProj/reportProblem/froms.py
froms.py
py
723
python
en
code
0
github-code
21
[ { "api_name": "django.forms.ModelForm", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 4, "usage_type": "name" }, { "api_name": "models.ReportProblemTable", "line_number": 6, "usage_type": "name" } ]
43627316160
import torch import torch.nn as nn import math import torch.nn.functional as F from ..utils import Conv_BN_ReLU class FPN(nn.Module): def __init__(self, in_channels, reduce_channels, out_channels): super(FPN, self).__init__() self.reduce_layer1 = Conv_BN_ReLU(in_channels[0], reduce_channe...
omtcyang/Text-Pass-filter
models/neck/fpn.py
fpn.py
py
1,866
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "utils.Conv_BN_ReLU", "line_number": 12, "usage_type": "call" }, { "api_name": "utils.Conv_BN_ReLU", ...
19985304198
import csv import json stats = open('data/combined-stats.csv') with open('data/headers') as f: fieldnames = [line.strip() for line in f] reader = csv.DictReader(stats, fieldnames=fieldnames) granularity = 5 teams = {} # key is teams, value is 2D dictionary of shot locations and amount of attempts shots = filter(la...
taimur38/nba-model
shot_profile.py
shot_profile.py
py
1,072
python
en
code
0
github-code
21
[ { "api_name": "csv.DictReader", "line_number": 8, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 36, "usage_type": "call" } ]
40549466582
from ipaddress import IPv4Address from unittest.mock import MagicMock import pytest from monkeytypes import AgentPluginManifest, AgentPluginType, OperatingSystem from tests.common.fake_manifests import FAKE_MANIFEST_OBJECT, FAKE_NAME, FAKE_NAME2, URL from infection_monkey.i_puppet import TargetHost from infection_mon...
guardicore/monkey
monkey/tests/unit_tests/infection_monkey/puppet/test_plugin_compatibility_verifier.py
test_plugin_compatibility_verifier.py
py
5,561
python
en
code
6,367
github-code
21
[ { "api_name": "unittest.mock.MagicMock", "line_number": 17, "usage_type": "call" }, { "api_name": "infection_monkey.island_api_client.IIslandAPIClient", "line_number": 17, "usage_type": "name" }, { "api_name": "pytest.fixture", "line_number": 15, "usage_type": "attribute"...
42740302030
import cv2 import numpy as np import dlib # https://www.learnopencv.com/install-dlib-on-ubuntu/ import time import math # create rectangular mask def create_mask(h,w,p1,p2): # h, w = height and with of the image # p1, p2 = top left and bottom right points in (x, y) format # generate a image for the mask ...
phdomingues/A.L.M.A.
rosenv/catkin_ws/src/roboVision/src/nodes/image_functions.py
image_functions.py
py
4,532
python
en
code
2
github-code
21
[ { "api_name": "numpy.zeros", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 13, "usage_type": "attribute" }, { "api_name": "cv2.GaussianBlur", "line_number": 30, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "lin...
30550211947
# Read all product sales data and show it using a multiline plot # Display the number of units sold per month for each product using multiline plots. # (i.e., Separate Plotline for each product ). import pandas as pd import matplotlib.pyplot as plt import numpy as np df = pd.read_csv("company_sales_data.csv") df.plo...
Ayoeunice/python_training
matplotlib_exercise/exercise_3.py
exercise_3.py
py
647
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.ylim", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 11, "usage_type": "name" }, { "api_name": "matplotlib.py...
9926355864
import numpy as np import matplotlib.pyplot as plt import math import seaborn as sn import pandas as pd class NeuralNetwork(): """ BASIC NEURAL NETWORK WORKING """ def __init__(self, hn): self.Ni = 2 #Number of input nodes self.Nh = hn #Number of hidden nodes self.No = 1 #Numbe...
annasanchez27/bachelorthesis
xorbackprop.py
xorbackprop.py
py
7,496
python
en
code
0
github-code
21
[ { "api_name": "numpy.exp", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.random.normal", "line_num...
41640589675
from flask import render_template, url_for , flash , redirect, request, abort from flaskblog.forms import RegistrationForm , LoginForm , PostForm from flaskblog import app,db,bcrypt from flaskblog.models import User, Post from flask_login import login_user, current_user,logout_user ,login_required @app.route("/") @ap...
Aryamanz29/Web-Ideas
flask/BlogSite-Flask/flaskblog/routes.py
routes.py
py
4,269
python
en
code
37
github-code
21
[ { "api_name": "flask.request.args.get", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 11, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 11, "usage_type": "name" }, { "api_name": "flaskblo...
26143020858
import discord import os from discord import Message from keep_alive import keep_alive client = discord.Client() @bot.event async def on_ready(): print(f'{bot.user} has connected to Discord!') @bot.event async def on_message(message: Message): if message.author.bot: return if n...
jonhan8352/NoInvitationDiscordBot
noinvitationdiscordbot.py
noinvitationdiscordbot.py
py
716
python
en
code
0
github-code
21
[ { "api_name": "discord.Client", "line_number": 6, "usage_type": "call" }, { "api_name": "discord.Message", "line_number": 13, "usage_type": "name" }, { "api_name": "keep_alive.keep_alive", "line_number": 20, "usage_type": "call" }, { "api_name": "os.getenv", "...
39180434038
#!/usr/bin/env python3 # coding: utf-8 """ ------------------------------------------------------------------------------- parsers.py | script to parse .bib and .md files ------------------------------------------------------------------------------- Author : Simone Santoni, simone.santoni.1@city.ac.uk Syn...
simoneSantoni/DrSnow
workingPapers/santoni-sieweke-zhou-nes/companionCode/handleBibs/parsers.py
parsers.py
py
1,509
python
en
code
2
github-code
21
[ { "api_name": "bibtexparser.load", "line_number": 28, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 32, "usage_type": "call" }, { "api_name": "pandas.DataFrame.from_dict", "line_number": 35, "usage_type": "call" }, { "api_name": "pandas....
30924358671
import datetime as dt import re # from bitstream import BitStream import struct from datetime import datetime import matplotlib.dates as md import matplotlib.pyplot as plt import numpy as np import pandas as pd def convert(filename): f = open(filename, "r") a = np.fromfile(f, dtype=np.int16, count=-1, offse...
hienvuvg/STM32_SDcard_FATFS
Read_raw_txt.py
Read_raw_txt.py
py
1,150
python
en
code
0
github-code
21
[ { "api_name": "numpy.fromfile", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.int16", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.join", "line_...