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
37222262076
from .db import db from sqlalchemy.sql import func class Transaction(db.Model): __tablename__ = 'transactions' id = db.Column(db.Integer, primary_key=True) timestamp = db.Column(db.DateTime, server_default=func.now(), nullable=False) user_id = db.Column(db.Integer, db.ForeignKey('users.id'), nullable...
Lazytangent/Flask-React-Commerce
app/models/transaction.py
transaction.py
py
1,256
python
en
code
0
github-code
21
[ { "api_name": "db.db.Model", "line_number": 5, "usage_type": "attribute" }, { "api_name": "db.db", "line_number": 5, "usage_type": "name" }, { "api_name": "db.db.Column", "line_number": 8, "usage_type": "call" }, { "api_name": "db.db", "line_number": 8, "u...
30249020718
#!/usr/bin/python3 import os, sys import operator import yaml from MiscFct import * ############################################################################################ # Default values ############################################################################################ TypeDefault = 0 ConfigVersion =...
jfmcarreira/py-plot-it
Init.py
Init.py
py
8,101
python
en
code
0
github-code
21
[ { "api_name": "os.path.exists", "line_number": 138, "usage_type": "call" }, { "api_name": "os.path", "line_number": 138, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 140, "usage_type": "call" }, { "api_name": "os.path", "line_num...
3579693688
#This script degrades spectral resolution of synthetic spectra and put them on the observed wavelength grid from matplotlib import pyplot as plt import numpy as np import asciidata from scipy import ndimage, interpolate #read synthetic spectrum spec_synth = asciidata.open('J_band_mod.dat') wave_synth = spec_synth[0]...
duisiya/DEMO
degrade_spectra_demo.py
degrade_spectra_demo.py
py
2,008
python
en
code
0
github-code
21
[ { "api_name": "asciidata.open", "line_number": 10, "usage_type": "call" }, { "api_name": "asciidata.open", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.log", "line_number...
70466470772
# Code to import and run epc1d functions #from matplotlib.lines import _LineStyle from epc1d import * import matplotlib.pyplot as plt from scipy.signal import find_peaks import numpy as np def r_squared(data, fit): """ Calculate the R^2 value of a fit, f, to a data set, x """ if len(data) != len(fit): print("Da...
mehfoos/Nuclear-Fusion
CompuLab/epcRun_1.py
epcRun_1.py
py
5,878
python
en
code
0
github-code
21
[ { "api_name": "numpy.sum", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 41, ...
31172104976
# -*- coding: utf-8 -*- """ Created on Mon Aug 16 17:59:13 2021 @author: renzo """ # Clustering Jerárquico # Importar librerias import numpy as np import matplotlib.pyplot as plt import pandas as pd # Agregar datos dataset = pd.read_csv("Mall_Customers.csv") X = dataset.iloc[:, [3,4]].values # Usar dendograma para...
renxovr/curso-ml-az
4. Clustering/2. Hierarchical Clustering/hc.py
hc.py
py
1,361
python
es
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "scipy.cluster.hierarchy.dendrogram", "line_number": 21, "usage_type": "call" }, { "api_name": "scipy.cluster.hierarchy", "line_number": 21, "usage_type": "name" }, { "api_na...
8729800994
#Impot MiniDom to WORK with XML from xml.dom import minidom #Template to class strClassBegin = """unit SAS_Synchro{0}; interface {1} type TSynchro{0} = class private public {2} """ #Template to end of the class strClassEnd = """ end; implementation end.""" #Return first caracter of string in Uppe...
rodvieirasilva/xml-synchro-cteos-delphi
main.py
main.py
py
3,351
python
en
code
0
github-code
21
[ { "api_name": "xml.dom.minidom.parse", "line_number": 112, "usage_type": "call" }, { "api_name": "xml.dom.minidom", "line_number": 112, "usage_type": "name" } ]
21794991111
from django.shortcuts import render from rest_framework import generics, status from rest_framework.decorators import api_view from rest_framework.response import Response from django.contrib.auth.models import User from django.contrib.auth import authenticate, login from .serializers import UserSerializer, LoginSerial...
wildandr/petraServer
authmanager/views.py
views.py
py
2,517
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.generics.CreateAPIView", "line_number": 10, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 10, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.User.objects.all", "line_number": 11, "usag...
74618008053
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.emailMarketing, name='emailMarketing'), url(r'^fetchUsers$', views.fetchUsers, name='fetchUsers'), url(r'^enableDisableMarketing$', views.enableDisableMarketing, name='enableDisableMarketing'), url(r'^saveConfigureVeri...
usmannasir/cyberpanel
emailMarketing/urls.py
urls.py
py
2,103
python
en
code
1,302
github-code
21
[ { "api_name": "django.conf.urls.url", "line_number": 4, "usage_type": "call" }, { "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.co...
23640239563
import asyncio.subprocess import collections import datetime import functools import hashlib import io import logging import secrets import sqlite3 import textwrap import time import traceback import types import string import smtplib import re import ssl import discord import discord.abc import aiohttp from email.mime...
ChoateProgrammingUnion/CPUBot
bot.py
bot.py
py
36,073
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 27, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 28, "usage_type": "attribute" }, { "api_name": "logging.FileHandler", "line_number": 30, "usage_type": "call" }, { "api_name": "logging.WARN...
17499768410
import open3d as o3d import numpy as np import copy class ARAPGUI: def __init__(self,mesh,static_ids,static_pos): self.mesh_og = copy.deepcopy(mesh) self.mesh = mesh self.static_ids = static_ids self.static_pos = static_pos self.vis = o3d.visualization.VisualizerWithVertexSe...
PavanMantripragada/ARAP
scripts/interactive_editor.py
interactive_editor.py
py
4,017
python
en
code
0
github-code
21
[ { "api_name": "copy.deepcopy", "line_number": 7, "usage_type": "call" }, { "api_name": "open3d.visualization.VisualizerWithVertexSelection", "line_number": 11, "usage_type": "call" }, { "api_name": "open3d.visualization", "line_number": 11, "usage_type": "attribute" }, ...
33472724870
import sys import pika from time import sleep from datetime import datetime # Using Rabbit running locally # RABBITMQ_URI = 'amqp://guest:guest@localhost/' ''' Producer that read the input file and push line by line the records inside the message broker. The actual implementation is meant to use rubbitMQ as a servic...
matteoanelli/BigDataPlatform3
assignment-3/code/realtime_ingestion/customer1producer.py
customer1producer.py
py
1,054
python
en
code
1
github-code
21
[ { "api_name": "pika.URLParameters", "line_number": 20, "usage_type": "call" }, { "api_name": "pika.BlockingConnection", "line_number": 21, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 29, "usage_type": "call" } ]
19349627693
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, division, unicode_literals ## ## This file is part of MoaT, the Master of all Things. ## ## MoaT is Copyright © 2007-2016 by Matthias Urlichs <matthias@urlichs.de>, ## it is licensed under the GPLv3. See the file `README.rst` for details...
smurfix/moat-old
moat/task/base.py
base.py
py
5,364
python
en
code
1
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 36, "usage_type": "call" }, { "api_name": "etcd_tree.node.EtcInteger", "line_number": 47, "usage_type": "argument" }, { "api_name": "etcd_tree.node.EtcInteger", "line_number": 49, "usage_type": "argument" }, { "api...
10599445144
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Apr 9 18:27:43 2019 @author: smrak """ import os import yaml import h5py import numpy as np from datetime import datetime from argparse import ArgumentParser def makeGrid(ylim=[25,50],xlim=[-110,-80],res=0.5): """ Make a grid for an image with...
aldebaran1/pyTID
pytid/tid2grid_v2.py
tid2grid_v2.py
py
6,617
python
en
code
0
github-code
21
[ { "api_name": "numpy.mgrid", "line_number": 21, "usage_type": "attribute" }, { "api_name": "numpy.nan", "line_number": 22, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.nan", "line_num...
3669835497
import argparse import glob import logging import os import pickle import random import re import shutil from typing import Dict, List, Tuple import numpy as np import torch from torch.nn.utils.rnn import pad_sequence from torch.utils.data import DataLoader, Dataset, RandomSampler, SequentialSampler from torch.utils.d...
MDSKUL/MasterProject
stap6/train.py
train.py
py
25,217
python
en
code
35
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 42, "usage_type": "call" }, { "api_name": "transformers.MODEL_WITH_LM_HEAD_MAPPING.keys", "line_number": 45, "usage_type": "call" }, { "api_name": "transformers.MODEL_WITH_LM_HEAD_MAPPING", "line_number": 45, "usage_type":...
25940025392
## ## Automatic alignment for staining and destaining ## Christophe Avenel - 2021 ### # Script parameters: # @ String (visibility=MESSAGE, value="<html><b>The input folder should contain one subfolder per round, and one reference image in each subfolder.</b></html>") docmsg # @ File (label="Select input folder", styl...
TissUUmaps/TissUUmaps
examples/fiji_alignment_dot_extraction.py
fiji_alignment_dot_extraction.py
py
16,870
python
en
code
33
github-code
21
[ { "api_name": "ij.IJ.log", "line_number": 43, "usage_type": "call" }, { "api_name": "ij.IJ", "line_number": 43, "usage_type": "name" }, { "api_name": "os.path.isdir", "line_number": 66, "usage_type": "call" }, { "api_name": "os.path", "line_number": 66, "u...
18587660901
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest from astropy.cosmology._io.latex import _FORMAT_TABLE, write_latex from astropy.io.registry.base import IORegistryError from astropy.table import QTable, Table from .base import ReadWriteDirectTestBase, ReadWriteTestMixinBase class Write...
astropy/astropy
astropy/cosmology/_io/tests/test_latex.py
test_latex.py
py
3,627
python
en
code
4,015
github-code
21
[ { "api_name": "base.ReadWriteTestMixinBase", "line_number": 12, "usage_type": "name" }, { "api_name": "pytest.raises", "line_number": 26, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 29, "usage_type": "call" }, { "api_name": "pyt...
13415630355
from dataclasses import dataclass @dataclass class BatchScrapeDelay: delay_is_required: bool delay_is_random: bool delay_uniform: int delay_random_min: int delay_random_max: int def __str__(self): if not self.delay_is_required: return "No delay after each batch" if...
a-luna/vigorish
src/vigorish/config/types/batch_scrape_delay.py
batch_scrape_delay.py
py
2,353
python
en
code
2
github-code
21
[ { "api_name": "dataclasses.dataclass", "line_number": 4, "usage_type": "name" } ]
71381020213
### lib ### import torch import torch.nn as nn import torch.optim as optim import transformers from transformers import AutoTokenizer import datasets import numpy as np ### data ### dataset_id = 'bentrevett/multi30k' # English to German translation dataset. # Train 29,000 # Validation 1,014 # Test 1,000 en_tokenizer =...
YanJiaHuan/Toynetwork
MachineTranslation_Transformer.py
MachineTranslation_Transformer.py
py
5,601
python
en
code
1
github-code
21
[ { "api_name": "transformers.AutoTokenizer.from_pretrained", "line_number": 16, "usage_type": "call" }, { "api_name": "transformers.AutoTokenizer", "line_number": 16, "usage_type": "name" }, { "api_name": "transformers.AutoTokenizer.from_pretrained", "line_number": 17, "us...
7733306460
import os from unittest import TestCase import utils.utils as utils class TestUtils(TestCase): def test_get_intersection_dictionary_with_itself(self): source = {'a': 1, 'b': 2, 'c': 3} target = list(source.keys()) self.assertEqual(utils.get_intersection(source, source), target) def t...
tim-othy/crypto
tests/utils/test_utils.py
test_utils.py
py
1,417
python
en
code
1
github-code
21
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "utils.utils.get_intersection", "line_number": 11, "usage_type": "call" }, { "api_name": "utils.utils", "line_number": 11, "usage_type": "name" }, { "api_name": "os.path.joi...
16119986795
import os from flask import Flask, jsonify, request from flask_restx import Resource, Api from main import Keyword from flask_cors import CORS from flask_mysqldb import MySQL from dotenv import load_dotenv from wordCloud import TagCloud load_dotenv() app = Flask(__name__) api = Api(app) CORS(app) mysql = MySQL(app)...
hyeseungS/Kusitms_42maru4
flask-api/app.py
app.py
py
2,908
python
en
code
3
github-code
21
[ { "api_name": "dotenv.load_dotenv", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "flask_restx.Api", "line_number": 14, "usage_type": "call" }, { "api_name": "flask_cors.CORS", ...
25040677770
from moviepy.editor import AudioFileClip, VideoFileClip, ImageClip, CompositeVideoClip from yogoflow.config import BACKGROUND_TRACKS, YOGA_POSE_NAMES """ Class for generating styled videos with text overlay """ class StyledVideo: def __init__(self, file_path): self.clip = VideoFileClip(file_path) self.clip...
dharness/yogoflow
server/yogoflow/services/video_effects.py
video_effects.py
py
1,176
python
en
code
0
github-code
21
[ { "api_name": "moviepy.editor.VideoFileClip", "line_number": 11, "usage_type": "call" }, { "api_name": "yogoflow.config.YOGA_POSE_NAMES", "line_number": 15, "usage_type": "name" }, { "api_name": "moviepy.editor.ImageClip", "line_number": 17, "usage_type": "call" }, { ...
20366046887
from os import path import pygame from config import img_dir, font_dir, BLACK, WHITE, FPS, PLAYING, DONE, WIDTH, HEIGHT, PLAYAGAIN, INSTRUCTION import gamescreen def play_again(screen): # Música do menu pygame.mixer.music.load(path.join('audio', 'intro.wav')) pygame.mixer.music.set_volume(0.3) pyg...
rodme02/ProjetoFinal_DesSoft
playagain.py
playagain.py
py
2,601
python
en
code
0
github-code
21
[ { "api_name": "pygame.mixer.music.load", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "li...
21614761024
import os import cv2 import random import argparse import numpy as np from tqdm import tqdm parser = argparse.ArgumentParser(description='Data Preparation') parser.add_argument('--data-dir', default='', type=str, metavar='PATH', help='path to the image folders') def main(): args = parser.parse...
Dazz993/pytorch-CelebA
utils/data_preparation.py
data_preparation.py
py
1,835
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 32, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 39, "usage_type": "call" }, { "api_name": "random.sample", "line...
10511713480
# 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 # d...
CCI-MOC/python-flocxclient
flocxclient/tests/unit/osc/test_plugin.py
test_plugin.py
py
2,090
python
en
code
0
github-code
21
[ { "api_name": "testtools.TestCase", "line_number": 21, "usage_type": "attribute" }, { "api_name": "flocxclient.tests.unit.osc.fakes.FakeClientManager", "line_number": 25, "usage_type": "call" }, { "api_name": "flocxclient.tests.unit.osc.fakes", "line_number": 25, "usage_t...
20054297321
from os.path import splitext import numpy as np from glob import glob import torch from torch.utils.data import Dataset import logging import os import random from PIL import Image class MyDataset(Dataset): def __init__(self, dir_src ,dir_target ,out_channel, scale): self.dir_src=dir_src self.dir_t...
gvfjyy/imageDenoise-UNet-VGG
utils/dataset.py
dataset.py
py
3,047
python
en
code
15
github-code
21
[ { "api_name": "torch.utils.data.Dataset", "line_number": 11, "usage_type": "name" }, { "api_name": "os.listdir", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_...
30073377343
from __future__ import annotations import hashlib import time from typing import List from Classes.transaction_input import TransactionInput from Classes.transaction_output import TransactionOutput class Transaction(object): def __init__(self, inputs: List[TransactionInput], outputs: List[TransactionOutput]):...
BeauvR/blockchain-bse1
Classes/transaction.py
transaction.py
py
4,447
python
en
code
1
github-code
21
[ { "api_name": "typing.List", "line_number": 14, "usage_type": "name" }, { "api_name": "Classes.transaction_input.TransactionInput", "line_number": 14, "usage_type": "name" }, { "api_name": "Classes.transaction_output.TransactionOutput", "line_number": 14, "usage_type": "n...
6701640351
#!/usr/bin/env python # coding: utf-8 import xml.etree.cElementTree as ET def update_street(element): """ Updates the street type based on mapping of a tag element whose key is 'addr:street'. Input: cElementTree element Returns: cElementTree element (updated) This function make...
clandreth2423/Open-Street-Map
cleandata.py
cleandata.py
py
33,601
python
en
code
0
github-code
21
[ { "api_name": "xml.etree.cElementTree.Element", "line_number": 456, "usage_type": "call" }, { "api_name": "xml.etree.cElementTree", "line_number": 456, "usage_type": "name" }, { "api_name": "xml.etree.cElementTree.Element", "line_number": 459, "usage_type": "call" }, ...
22610114829
import logging , re, os from itertools import chain, filterfalse, starmap from collections import namedtuple from tqdm import tqdm BASE_DOWNLOAD_PATH = os.path.join(os.path.dirname(__file__), "downloads") HEADERS = { 'Content-Type': 'application/json', 'user-agent': 'Mozilla/5.0' } session = N...
Ahmed-Soli/linkedin-course-downloader
fetch_info.py
fetch_info.py
py
8,869
python
en
code
52
github-code
21
[ { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "collections.namedtuple", "...
32500938078
# Exploit Title : Jenkins mailer plugin < 1.20 - Cross-Site Request Forgery # Date : 2018-06-05 # Exploit Author : Kl3_GMjq6 # Vendor Homepage : https://jenkins.io/ # Software Link : [https://updates.jenkins.io/download/plugins/mailer/1.20/mailer.hpi] # Version: [Below Version 1.20 (1.1 ~ 1.20) ] # Ref: https://jenkins...
ryanmrestivo/red-team
_Resources/Exploit DB 2021-12-11/exploits/linux/webapps/44843.py
44843.py
py
6,897
python
en
code
91
github-code
21
[ { "api_name": "email.message.message.Message", "line_number": 21, "usage_type": "call" }, { "api_name": "email.message.message", "line_number": 21, "usage_type": "attribute" }, { "api_name": "email.message", "line_number": 21, "usage_type": "name" }, { "api_name":...
10106104348
from utils.config_loader import load_config_file import json import os import pytest def test_load_app_config_file(): config = { "app":{ "type":"domain", "name":"app_name", "id":"a2ce149c-ab61-499b-a0d0-14594b2e9ea3" }, "solution":{ "name":"so...
fernandocandrade/Plataforma-Domain
Platform.App/python-template/utils/tests/test_config_loader.py
test_config_loader.py
py
776
python
en
code
1
github-code
21
[ { "api_name": "json.dumps", "line_number": 19, "usage_type": "call" }, { "api_name": "utils.config_loader.load_config_file", "line_number": 21, "usage_type": "call" } ]
42081975636
import os import os.path import shutil import subprocess import sys import tempfile import time import re import stat from datetime import datetime from ms_interface.constant import Constant class AicErrException(Exception): """ The class for Op Gen Exception """ def __init__(self: any, error_info:...
Ascend/tools
msaicerr/ms_interface/utils.py
utils.py
py
8,535
python
en
code
11
github-code
21
[ { "api_name": "time.strftime", "line_number": 27, "usage_type": "call" }, { "api_name": "time.localtime", "line_number": 27, "usage_type": "call" }, { "api_name": "time.time", "line_number": 27, "usage_type": "call" }, { "api_name": "os.getpid", "line_number":...
73728984372
try: import sys import asyncio from aiohttp import ClientSession import sys from bs4 import BeautifulSoup import json import time from config import Config from database import DataBase from utils import get_pln_price except ImportError: print('Missing modules. Use:\n\tpip in...
Stalkies/oto
parser.py
parser.py
py
8,158
python
en
code
0
github-code
21
[ { "api_name": "sys.exit", "line_number": 14, "usage_type": "call" }, { "api_name": "aiohttp.ClientSession", "line_number": 49, "usage_type": "name" }, { "api_name": "bs4.BeautifulSoup", "line_number": 54, "usage_type": "call" }, { "api_name": "time.sleep", "li...
28455732393
from django.contrib.auth.models import AnonymousUser from django.core.asgi import get_asgi_application from django.urls import re_path from channels.middleware import BaseMiddleware from channels.db import database_sync_to_async from channels.routing import ProtocolTypeRouter, URLRouter from channels.auth import AuthM...
jp803333/ChatApp
chatappbackend/chatappbackend/asgi.py
asgi.py
py
1,471
python
en
code
0
github-code
21
[ { "api_name": "os.environ.setdefault", "line_number": 17, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 17, "usage_type": "attribute" }, { "api_name": "rest_framework.authtoken.models.Token.objects.get", "line_number": 23, "usage_type": "call" }, ...
38973166852
from django.urls import path, include from apps.home.views import _views, chef_div , chef_eta ,chef_equipe urlpatterns = [ path('', _views.index, name='home'), path('etablisement/' ,include([ path('dashboard/' , chef_eta.dash_etablisemnt , name='dashboard_etablisement'), path('divi...
merouanebj/django-algerian-researche-indicator
apps/home/urls.py
urls.py
py
1,185
python
en
code
null
github-code
21
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "apps.home.views._views.index", "line_number": 6, "usage_type": "attribute" }, { "api_name": "apps.home.views._views", "line_number": 6, "usage_type": "name" }, { "api_name":...
26931005253
import warnings warnings.filterwarnings("ignore") import os import random from datetime import datetime import torch import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from utils import load_data, print_classification_report, plot_history, plot_cm, plot_adj from models import ...
amar-enkhbat/thesis-2022
main.py
main.py
py
13,042
python
en
code
0
github-code
21
[ { "api_name": "warnings.filterwarnings", "line_number": 2, "usage_type": "call" }, { "api_name": "torch.no_grad", "line_number": 22, "usage_type": "call" }, { "api_name": "params.PARAMS", "line_number": 26, "usage_type": "name" }, { "api_name": "params.PARAMS", ...
10464791644
# an application to get stock prices and graph them """ To run this application copy launch terminal and enter: streamlit run streamlit_app.py If it fails to launch, make sure your terminal is pointing at the folder containing this file. """ import streamlit as st import datetime as dt import pandas_datareader as pd...
mjmacarty/CS230-SU2021
program_files/streamlit_app.py
streamlit_app.py
py
1,050
python
en
code
1
github-code
21
[ { "api_name": "datetime.date.today", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 15, "usage_type": "attribute" }, { "api_name": "datetime.timedelta", "line_number": 16, "usage_type": "call" }, { "api_name": "streamlit.s...
32278066280
import hflow import torch import argparse if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("-c", "--config", type=str, required=True, help="Path to config-based") parser.add_argument("-dp", "--data_path", type=str, required=True, help="Path to hdf5 data-container") pa...
timoneh/hflow
scripts/train.py
train.py
py
2,589
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "hflow.ModelSettings.from_file", "line_number": 20, "usage_type": "call" }, { "api_name": "hflow.ModelSettings", "line_number": 20, "usage_type": "attribute" }, { "api...
35389734548
from datetime import datetime #Check if legal shit is passed using try-catch def node_resources(message): try: for i in message: timestamp = datetime.fromtimestamp(int(i['timestamp'])).strftime("%Y-%m-%d %I:%M:%S") cpu_percent = i['CPU%'] ram_percent = i['RAM%'] ...
SW7-aau/remote-server
mock_nodes.py
mock_nodes.py
py
1,027
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.fromtimestamp", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "name" }, { "api_name": "datetime.datetime.fromtimestamp", "line_number": 21, "usage_type": "call" }, { "a...
74847107571
import uuid from datetime import datetime from django.forms import model_to_dict from data.models.customer import Customer, CustomerUserGroup # from data.models.customer_user_group import CustomerUserGroup from data.models.user import User from data.utils.constant import AccessLevel, Status from data.utils.exceptions i...
chrismedinapy/backend
data/logic/customer.py
customer.py
py
3,490
python
en
code
0
github-code
21
[ { "api_name": "uuid.uuid4", "line_number": 18, "usage_type": "call" }, { "api_name": "data.utils.constant.Status.ACTIVE", "line_number": 21, "usage_type": "attribute" }, { "api_name": "data.utils.constant.Status", "line_number": 21, "usage_type": "name" }, { "api_...
40303086883
from typing import Iterator from my.offline.listens import history as of_history from .model import FeedItem def history() -> Iterator[FeedItem]: for listen in of_history(): yield FeedItem( id=f"offline_listen_{int(listen.when.timestamp())}", ftype="listen", when=list...
seanbreckenridge/my_feed
src/my_feed/sources/offline_listens.py
offline_listens.py
py
441
python
en
code
8
github-code
21
[ { "api_name": "my.offline.listens.history", "line_number": 9, "usage_type": "call" }, { "api_name": "model.FeedItem", "line_number": 10, "usage_type": "call" }, { "api_name": "typing.Iterator", "line_number": 8, "usage_type": "name" }, { "api_name": "model.FeedIte...
16786055007
''' methods: - select papers from valid journals - select papers citing papers from valid journals - calculates IF - count number of papers per journal ''' import dbgz, json import WOSRaw as wos import xnetwork as xnet from pathlib import Path from tqdm.auto import tqdm from timeit import default_timer as timer impo...
carolmb/landscape_of_mat_appl
scripts_and_notebooks/2020_s01_select_data.py
2020_s01_select_data.py
py
7,433
python
en
code
0
github-code
21
[ { "api_name": "pathlib.Path", "line_number": 24, "usage_type": "call" }, { "api_name": "dbgz.DBGZReader", "line_number": 47, "usage_type": "call" }, { "api_name": "tqdm.auto.tqdm", "line_number": 53, "usage_type": "call" }, { "api_name": "WOSRaw.utilities.getSourc...
7912000551
#!/usr/bin/env python import scapy.all as scapy import argparse def scan(ip): arp_request = scapy.ARP(pdst = ip) broadcast = scapy.Ether(dst = "ff:ff:ff:ff:ff:ff") arp_request_broadcast = broadcast/arp_request answered_list = scapy.srp(arp_request_broadcast, timeout=1, verbose=False)[0] client_lis...
lovish1803/HackingScripts_Python
psersonalisedNetworkScanner.py
psersonalisedNetworkScanner.py
py
1,116
python
en
code
0
github-code
21
[ { "api_name": "scapy.all.ARP", "line_number": 6, "usage_type": "call" }, { "api_name": "scapy.all", "line_number": 6, "usage_type": "name" }, { "api_name": "scapy.all.Ether", "line_number": 7, "usage_type": "call" }, { "api_name": "scapy.all", "line_number": 7...
70274715572
# -*- coding: utf-8 -*- """ """ import matplotlib.pyplot as plt from numpy import log, polyfit, sqrt, std, subtract from datetime import datetime import pandas as pd import numpy as np pd.core.common.is_list_like = pd.api.types.is_list_like #datareader problem probably fixed in next version of datareader from pandas_d...
Ashton-Sidhu/Regression-Channel-Algo
D 4.4.b REGRESSION CHANNEL ALGO PROGRAM.py
D 4.4.b REGRESSION CHANNEL ALGO PROGRAM.py
py
6,213
python
en
code
1
github-code
21
[ { "api_name": "pandas.core", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pandas.api", "line_number": 10, "usage_type": "attribute" }, { "api_name": "fix_yahoo_finance.pdr_override", "line_number": 15, "usage_type": "call" }, { "api_name": "datet...
24034206115
#!/usr/bin/env python3 import argparse import os import re import subprocess import sys import time from functools import wraps # This script is used to determine the current version of Memgraph. The script # determines the current version using `git` automatically. The user can also # manually specify a version overr...
memgraph/memgraph
release/get_version.py
get_version.py
py
10,786
python
en
code
1,859
github-code
21
[ { "api_name": "time.sleep", "line_number": 105, "usage_type": "call" }, { "api_name": "functools.wraps", "line_number": 99, "usage_type": "call" }, { "api_name": "subprocess.run", "line_number": 113, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "li...
24118056105
# photos\urls.py from django.urls import path, include from petstagram.photos import views urlpatterns = ( path("add/", views.add_photo, name="add-photo"), path("<int:pk>/", include([ path("", views.photo_details, name="details-photo"), path("edit/", views.photo_edit, name="...
Orminis/petstagram
petstagram/photos/urls.py
urls.py
py
349
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "petstagram.photos.views.add_photo", "line_number": 7, "usage_type": "attribute" }, { "api_name": "petstagram.photos.views", "line_number": 7, "usage_type": "name" }, { "api_...
73691843893
''' util.py ------- has some utility functions for training and testing ''' import numpy as np import torch device = torch.device("cuda" if torch.cuda.is_available() else "cpu") def tensorize_exp(obs, action, next_obs, reward): ''' converts a piece of experience into a torch tensor ''' belief, pose =...
cdrckrgt/cs229-project
src/util.py
util.py
py
3,755
python
en
code
1
github-code
21
[ { "api_name": "torch.device", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.tensor", ...
17347751215
from flask import Flask, request, render_template import requests from zeep_client import * import json import folium from gql import gql, Client from gql.transport.aiohttp import AIOHTTPTransport # Flask constructor app = Flask(__name__) @app.route("/", methods=['GET', 'POST']) def start(): listeVoitures = query...
Kassim28/voitureelec
Client/WebServer.py
WebServer.py
py
10,100
python
fr
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 18, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 18, "usage_type": "name" }, { "api_name": "flask.render_temp...
27908112783
import pandas as pd from openpyxl import load_workbook import gspread from oauth2client.service_account import ServiceAccountCredentials from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By from selenium.webdriver.support import expect...
AndreBastosB/KPI-sFZN
Recorrencias.py
Recorrencias.py
py
6,069
python
en
code
0
github-code
21
[ { "api_name": "oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name", "line_number": 18, "usage_type": "call" }, { "api_name": "oauth2client.service_account.ServiceAccountCredentials", "line_number": 18, "usage_type": "name" }, { "api_name": "gspread.auth...
37899227476
#!/usr/bin/env python import os import json from datetime import datetime current_dir = os.path.dirname(__file__) cache_json = os.path.join(current_dir, "imgur-cache.json") imgur_tags = os.path.join(current_dir, "../data/imgur-tags.yml") with open(cache_json, "r") as fp: data = json.load(fp) minimal_data = [] ...
altbdoor/thes1tuation-memes
script/sort-imgur-tags.py
sort-imgur-tags.py
py
1,286
python
en
code
0
github-code
21
[ { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8...
569150595
#!/usr/bin/env python import bitcoin import hashlib import random def ecdsa_sign_k(z, d, k): r, y = bitcoin.fast_multiply(bitcoin.G, k) s = bitcoin.inv(k, bitcoin.N) * (z + r*d) % bitcoin.N v, r, s = 27+((y % 2) ^ (0 if s * 2 < bitcoin.N else 1)), r, s if s * 2 < bitcoin.N else bitcoin.N - s return v,...
mvrc42/bitp0wn
signatures/r_exploit_ecdsa.py
r_exploit_ecdsa.py
py
1,297
python
en
code
91
github-code
21
[ { "api_name": "bitcoin.fast_multiply", "line_number": 8, "usage_type": "call" }, { "api_name": "bitcoin.G", "line_number": 8, "usage_type": "attribute" }, { "api_name": "bitcoin.inv", "line_number": 9, "usage_type": "call" }, { "api_name": "bitcoin.N", "line_n...
24234110780
from common import PETSc, norm, dx, DumbCheckpoint, sin, sinh, inner, grad, FILE_CREATE, exp, cos from common import FunctionSpace, SpatialCoordinate, Function, Projector, NonlinearVariationalProblem, NonlinearVariationalSolver from common import TestFunction, DirichletBC, pi from common import create_box_mesh, create...
celdred/themis
examples/h1scalarhelmholtz/h1helmholtz.py
h1helmholtz.py
py
6,650
python
en
code
2
github-code
21
[ { "api_name": "common.PETSc.Options", "line_number": 8, "usage_type": "call" }, { "api_name": "common.PETSc", "line_number": 8, "usage_type": "name" }, { "api_name": "common.PETSc.Sys.Print", "line_number": 30, "usage_type": "call" }, { "api_name": "common.PETSc.S...
13515214062
import ast import re import warnings from abc import ABC, abstractmethod from collections.abc import Iterator, Sequence from typing import cast, ClassVar, Literal, overload, TYPE_CHECKING, Type, TypeVar from robot.conf import Language from robot.running.arguments import UserKeywordArgumentParser from robot.utils impor...
robotframework/robotframework
src/robot/parsing/model/statements.py
statements.py
py
47,598
python
en
code
8,521
github-code
21
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.TypeVar", "line_number": 20, "usage_type": "call" }, { "api_name": "ast.AST", "line_number": 25, "usage_type": "attribute" }, { "api_name": "abc.ABC", "line_...
29137714645
from flask import Flask, request, render_template from flask_debugtoolbar import DebugToolbarExtension from stories import story app = Flask(__name__) app.config['SECRET_KEY'] = "oh-so-secret" debug = DebugToolbarExtension(app) @app.route('/') def homepage(): """Show a form with prompts for all the words neede...
keante032/SB-19.2.12
app.py
app.py
py
601
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask_debugtoolbar.DebugToolbarExtension", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 16, "usage_type": "call" }, { "api_name...
40695945065
# # -*- coding:utf-8 -*- from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select import datetime import datetime import os import time import sys import pandas as pd import random im...
18708111002/Tools
autoFileQie/chromeAuto.py
chromeAuto.py
py
10,881
python
en
code
1
github-code
21
[ { "api_name": "sys.setdefaultencoding", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 25, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 26, "usage_type": "call" }, { "api_name": "sys.argv", ...
21286987304
from selenium import webdriver from selenium.webdriver.common.by import By def recaptcha(check): driver = webdriver.Chrome() driver.get('') try: iframes = driver.find_elements(By.TAG_NAME, 'iframes') for frame in iframes: driver.switch_to.default_content() ...
SamoraCletus/Python-Automation
email/recaptcha.py
recaptcha.py
py
646
python
en
code
0
github-code
21
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 6, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 6, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.TAG_NAME", "line_number": 9, "usage_type": "attribute" }, ...
15046800448
from bs4 import BeautifulSoup import scraperwiki, time html = scraperwiki.scrape("http://slon.ru") soup = BeautifulSoup(html, 'lxml') number = soup.find("span", attrs={"class": "join-us-button__number"}) users=int(number.text.replace(" ", "")) date=time.strftime("%D") scraperwiki.sqlite.save(unique_keys=['date'], dat...
Stanpol/slon_ru_paid_users
scraper.py
scraper.py
py
414
python
en
code
0
github-code
21
[ { "api_name": "scraperwiki.scrape", "line_number": 3, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 4, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 9, "usage_type": "call" }, { "api_name": "scraperwiki.sqlite.sa...
7990615891
from django.http import JsonResponse from django.shortcuts import render, redirect from django.contrib.auth.models import User, auth from .models import * from django.contrib import messages from django.views.decorators.csrf import csrf_exempt # Create your views here. def login(request): return render(request, ...
FarlanFadillah/Chat-App
MainApp/views.py
views.py
py
1,759
python
en
code
0
github-code
21
[ { "api_name": "django.shortcuts.render", "line_number": 12, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 19, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 26, "usage_type": "call" }, { "api_nam...
35708413460
from prefect import task, Flow from prefect.executors import DaskExecutor from prefect.storage import Docker import random from time import sleep import yaml with open('../config/secrets.yml', 'r') as file: secrets = yaml.safe_load(file) REGISTRY_URL = secrets['development']['REGISTRY_URL'] PROJECT_NAME = secret...
StevenTimeTW/mlops-prefect-dask-gke
demo-prefect-flow/dask-k8s.py
dask-k8s.py
py
1,075
python
en
code
0
github-code
21
[ { "api_name": "yaml.safe_load", "line_number": 10, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 18, "usage_type": "call" }, { "api_name": "random.random", "line_number": 18, "usage_type": "call" }, { "api_name": "prefect.task", "line_numb...
16315202695
from django.conf.urls import url from . import views app_name = 'polls' urlpatterns = [ url(r'^time/plus/(\d{1,2})', views.hours_ahead, name='hours_ahead'), url(r'^time/', views.current_datetime, name='current_datetime'), url(r'^$', views.IndexView.as_view(), name='index'), url(r'^(?P<pk>[0-9]+)/$', v...
wu-wenxiang/Training-Django-Public
08-Static/01-Add-Static/mysite/polls/urls.py
urls.py
py
518
python
en
code
2
github-code
21
[ { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.co...
2152487198
import pandas as pd from sklearn.model_selection import train_test_split from sklearn.feature_extraction.text import CountVectorizer from sklearn.naive_bayes import MultinomialNB import pickle data = pd.read_csv('https://raw.githubusercontent.com/4GeeksAcademy/naive-bayes-project-tutorial/main/playstore_reviews_datase...
sepeca15/Naive-Bayes-Project
src/app.py
app.py
py
857
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.CountVectorizer", "line_number": 16, "usage_type"...
37425061092
import base64 import ctypes import os import re def getEnvironmentVariable(name): """ All credits to: Martin Miller (http://stackoverflow.com/users/355230/martineau) http://stackoverflow.com/questions/12118162/how-can-i-get-the-dropbox-folder-location-programmatically-in-python """ """ read win...
jackjackk/enviropy
enviropy.py
enviropy.py
py
2,624
python
en
code
0
github-code
21
[ { "api_name": "ctypes.windll.kernel32.GetEnvironmentVariableW", "line_number": 15, "usage_type": "call" }, { "api_name": "ctypes.windll", "line_number": 15, "usage_type": "attribute" }, { "api_name": "ctypes.create_unicode_buffer", "line_number": 19, "usage_type": "call" ...
28120466755
import numpy as np import pandas as pd from scipy.sparse import hstack from sklearn.feature_extraction import DictVectorizer from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.linear_model import Ridge #Обучающая выборка data_train = pd.read_csv('salary-train.csv') data_train_lower = [] for i in ...
wyzekid/ML_coursera
4 week/linear_regression.py
linear_regression.py
py
1,955
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.TfidfVectorizer", "line_number": 16, "usage_type": "call" }, { "api_na...
24376038042
class TensorOpsMixin(object): # operator overload for (+) where self is the left operand def __add__(self, other): from . import ops return ops.plus(self, other) # operator overload for (+) where self is the right operand def __radd__(self, other): from . import ops ret...
kafemoka/CNTK
bindings/python/cntk/tensor.py
tensor.py
py
6,570
python
en
code
null
github-code
21
[ { "api_name": "utils.eval", "line_number": 165, "usage_type": "call" } ]
33223127933
from time import sleep, time from random import uniform from pyModbusTCP.server import ModbusServer, DataBank host = "127.0.0.1" port = 502 server = ModbusServer(host, port, no_block=True) spec = ["corolla_black", "corolla_white", "chr_balck", "chr_white"] try: print("server is starting....") server.start() ...
ozanakyel/ModBus_Communication
modbus_server.py
modbus_server.py
py
2,357
python
en
code
0
github-code
21
[ { "api_name": "pyModbusTCP.server.ModbusServer", "line_number": 7, "usage_type": "call" }, { "api_name": "pyModbusTCP.server.DataBank.set_words", "line_number": 17, "usage_type": "call" }, { "api_name": "pyModbusTCP.server.DataBank", "line_number": 17, "usage_type": "name...
75136495733
import pandas as pd import duckdb import uuid from dagster import ( asset, AssetIn ) @asset( key="pond_sessions", ins={"sessions_df": AssetIn("sessions_df")}, io_manager_key="db_io" ) def fill_pond_sessions(sessions_df) -> pd.DataFrame: sessions_cols_ordered = ['session_id','...
thedatagata/duck_lake
duck_lake/assets/fill_duck_lake/__init__.py
__init__.py
py
1,732
python
en
code
1
github-code
21
[ { "api_name": "dagster.asset", "line_number": 9, "usage_type": "call" }, { "api_name": "dagster.AssetIn", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 14, "usage_type": "attribute" }, { "api_name": "duckdb.connect", ...
46880949264
from typing import Tuple from functools import reduce from puzzle import PuzzleContext def apply_1(acc: Tuple[int, int], el: Tuple[str, int]) -> Tuple[int, int]: op, d = el deltas = { "down": (0, d), "up": (0, -d), "forward": (d, 0) } return tuple(map(sum, zip(acc, deltas[op])))...
vstrimaitis/aoc-2021
python/02/sol.py
sol.py
py
921
python
en
code
1
github-code
21
[ { "api_name": "typing.Tuple", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 23, "usage_type": "name" }, { "api_name": "puzzle.PuzzleContext", "lin...
40581682117
# coding: utf-8 from django.contrib.auth.models import User from django.conf import settings from django.db import models from django.utils import timezone from eventmay.utils import get_score, get_new_code class WechatSettings(models.Model): """微信公众平台相关设置""" key = models.CharField(u'配置名称', max_length=512) ...
ttc9082/dingqi
wechat/models.py
models.py
py
5,512
python
en
code
0
github-code
21
[ { "api_name": "django.db.models.Model", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 10, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 12, "usage_type": "call" }, { "api_name"...
45896183304
from pydantic import BaseModel, validator from typing import Literal from ipaddress import IPv4Address, IPv4Network class NetworkData(BaseModel): ipv4_mgmt_network: list[IPv4Network] snmp_community: str class Device(BaseModel): hostname: str vendor: Literal["cisco", "juniper"] router_id: IPv4Add...
saidvandeklundert/unit-testing-configurations
src/models.py
models.py
py
864
python
en
code
0
github-code
21
[ { "api_name": "pydantic.BaseModel", "line_number": 6, "usage_type": "name" }, { "api_name": "ipaddress.IPv4Network", "line_number": 7, "usage_type": "name" }, { "api_name": "pydantic.BaseModel", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Lite...
74430067894
#!/usr/bin/env python3 import requests import sys import random import re def usage(): print(""" Usage: python3 CVE-2022-22947.py <URL> <CMD> Example : python3 CVE-2022-22947.py http://127.0.0.1:8080 id python3 CVE-2022-22947.py http://127.0.0.1:8080 "cat /etc/passwd" """) def randStr(): s = ra...
Arrnitage/CVE-2022-22947_exp
CVE-2022-22947.py
CVE-2022-22947.py
py
1,693
python
en
code
7
github-code
21
[ { "api_name": "random.sample", "line_number": 20, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 42, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 47, "usage_type": "call" }, { "api_name": "requests.get", "line_nu...
21330713254
import cv2 import numpy as numpy import os def Labeling(imgs): str_plate = input() start_id = (int)(input()) path = "D:/DoAn_LTHTN/train_DoAn/NewLabel" #os.chdir(path) for i in range(len(str_plate)): img_fileName = (str)(10000+start_id) + ".png" start_id = start_id +1 ...
trannhan0810/DoAnNhung
Labeling.py
Labeling.py
py
534
python
en
code
0
github-code
21
[ { "api_name": "os.path.exists", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.imwrite", "line_number":...
38311507722
import os import json import time import pickle import torch import torch.nn as nn import numpy as np from scipy.stats import pearsonr from sklearn.metrics import accuracy_score, roc_auc_score, mean_absolute_error from GPCR.utils.logging import MetricLogger, SmoothedValue from GPCR.model.losses import get_loss_func fr...
yuxin212/GPCR-public
GPCR/utils/engine.py
engine.py
py
8,560
python
en
code
0
github-code
21
[ { "api_name": "GPCR.model.losses.get_loss_func", "line_number": 25, "usage_type": "call" }, { "api_name": "GPCR.utils.logging.MetricLogger", "line_number": 46, "usage_type": "call" }, { "api_name": "GPCR.utils.logging.SmoothedValue", "line_number": 47, "usage_type": "call...
5395718154
import sys import os import argparse import glob import xml.etree.ElementTree as ET # import self package library start dirname = (os.path.dirname(os.path.realpath(__file__))).split("/") dirname[-1] = "lib" lib_path = "/".join((x for x in dirname)) sys.path.append(lib_path) from utility import load_config # import sel...
AcgEuSmile/Tensorflow_object_detection_api
src/node/categories_statistics.py
categories_statistics.py
py
1,402
python
en
code
1
github-code
21
[ { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path.append", "lin...
40663401445
from time import sleep import serial from tello import Tello import tellopy #help(tellopy) turn = 0 tello = Tello() #tello.send_command("takeoff") # MAKE SURE THE BAUDRATE MATCHES WITH THE ARDUINO (Serial.begin(115200);) # ser = serial.Serial("/dev/ttyACM0",115200) #Linux ser = serial.Serial("COM5", 9600) # Windo...
TamLe2001/Tello-Drone
Program_Iteration.py
Program_Iteration.py
py
1,891
python
en
code
0
github-code
21
[ { "api_name": "tello.Tello", "line_number": 10, "usage_type": "call" }, { "api_name": "serial.Serial", "line_number": 16, "usage_type": "call" }, { "api_name": "tellopy.Tello", "line_number": 18, "usage_type": "call" } ]
129617964
from django.shortcuts import redirect, render from carts.models import CartItem, Cart from .forms import OrderForm from .models import Order, OrderProduct, Payment import datetime from product.models import Product from django.core.mail import EmailMessage from django.template.loader import render_to_string import u...
nou-ros/pyLab
pyWebFramework/06-django-lab/01-django-app/06-emerce/orders/views.py
views.py
py
6,888
python
en
code
0
github-code
21
[ { "api_name": "uuid.uuid5", "line_number": 29, "usage_type": "call" }, { "api_name": "uuid.NAMESPACE_DNS", "line_number": 29, "usage_type": "attribute" }, { "api_name": "models.Order.objects.get", "line_number": 32, "usage_type": "call" }, { "api_name": "models.Or...
35329992253
''' Chomp AI Player Author: Lei Mao Website: https://github.com/leimao/ Date: 2017/3/23 Content: Play Chomp with AI in PyGame Gui. Acknowledgement: http://programarcadegames.com/ Usage: "python chomp_gui.py x m n". 'x' designates who goes first in the game. it can be either 'Human' or 'AI'. 'm' and 'n' are the length a...
leimao/Chomp-AI
chomp_gui.py
chomp_gui.py
py
5,866
python
en
code
4
github-code
21
[ { "api_name": "pygame.draw.rect", "line_number": 46, "usage_type": "call" }, { "api_name": "pygame.draw", "line_number": 46, "usage_type": "attribute" }, { "api_name": "pygame.draw.rect", "line_number": 50, "usage_type": "call" }, { "api_name": "pygame.draw", ...
73346585651
import pandas as pd from sklearn.model_selection import train_test_split import lightgbm as lgb from sklearn.metrics import f1_score, roc_auc_score import time # ----------载入数据------------ data_all = pd.read_csv('data_all.csv', index_col=0) # ----------划分数据------------ train_x = data_all.drop(['is_leave_mattress', 'is...
silence/Bachelor-Graduation-Project
train.py
train.py
py
5,896
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 18, "usage_type": "call" }, { "api_name": "lightgbm.Dataset", "line_number": 20, "usage_type": "call" }, { "api_name...
9266278279
# # Import Multiplication from your library # from medium_multi.multi import Multiplication # # Instantiate a Multiplication object # multiplication = Multiplication(2) # # Call the multiply method # print(multiplication.multiply(5)) # #Steps to publish the library # #create the dist file # #python setup.py sdist b...
arr773/testlib
synthetic_rx/main.py
main.py
py
839
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 20, "usage_type": "call" }, { "api_name": "rx.stats.reportgeneration", "line_number": 22, "usage_type": "call" } ]
41295156195
""" Pairs with difference K - GeeksForGeeks Problem Link: https://practice.geeksforgeeks.org/problems/pairs-with-difference-k/0 Author: Shyam Kumar Date: 15-09-2019 """ from itertools import combinations def pairs_with_difference(n,k,arr): 'This function uses combinations method to find all th...
svshyam91/geeksforgeeks
pairs_with_difference_k.py
pairs_with_difference_k.py
py
727
python
en
code
0
github-code
21
[ { "api_name": "itertools.combinations", "line_number": 16, "usage_type": "call" } ]
34973223104
""" DB_Interface.py Regulates and proceduralizes the addition and manipulation of data to be sent to MongoDB and retrieves data where necessary. """ from pymongo import MongoClient import numpy as np import pandas as pd class DB_Interface(): def __init__(self, uri, database): """ Required to acc...
erinnicolelyne/454Chatbot
Data_Storage/DB_Interface.py
DB_Interface.py
py
2,365
python
en
code
1
github-code
21
[ { "api_name": "pymongo.MongoClient", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 63, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 67, "usage_type": "call" }, { "api_name": "numpy.array", "line_n...
9728439282
import os import graphene from lmcommon.logging import LMLogger from lmcommon.labbook import LabBook from lmcommon.workflows import BranchManager from lmcommon.activity import ActivityStore, ActivityDetailRecord, ActivityDetailType, ActivityRecord, ActivityType from lmsrvcore.auth.user import get_logged_in_username, ...
xiaohanghang/labmanager-service-labbook
lmsrvlabbook/api/mutations/branching.py
branching.py
py
5,534
python
en
code
0
github-code
21
[ { "api_name": "lmcommon.logging.LMLogger.get_logger", "line_number": 12, "usage_type": "call" }, { "api_name": "lmcommon.logging.LMLogger", "line_number": 12, "usage_type": "name" }, { "api_name": "graphene.relay", "line_number": 15, "usage_type": "attribute" }, { ...
9949858386
# -*- coding: UTF-8 -*- #Paradigmas Tecnologicos II - Robotica 2022 #Ing Nestor Adrian Balich #este material es GNU import os import keyboard import time g_estado = 0 g_controlador = "" g_clock_inicio = 0 #creamos una funcion para inicializar el sistema def setup(): global g_estado g_estado = 0 pass #creamos u...
NestorBalich/curso-basico-de-python-para-robotica
examples py/maquina_de_estados/maquina_keypress.py
maquina_keypress.py
py
1,638
python
es
code
0
github-code
21
[ { "api_name": "os.system", "line_number": 29, "usage_type": "call" }, { "api_name": "keyboard.read_key", "line_number": 57, "usage_type": "call" } ]
44182233570
from datetime import datetime from pickletools import optimize from random import random from typing import final import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import cross_validate from sklearn.neural_network import MLPClassifier from sklearn.pipeline import make_pipeline from sklearn...
davidantaki/ecece5644_machine_learning
hw4/hw4q1.py
hw4q1.py
py
13,643
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.pyplot.rc", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 15, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rc", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotli...
69816411894
from aleph_ner.pipeline import AlephDumpReader, Tokenizer, Annotator, Reporter import tempfile import pytest from nltk.tree import Tree sample_doc = '''{"text": "Defendant John Doe was captured by U.S Immigration Services."}''' # XXX: why is this scoped module? @pytest.fixture(scope='module') def with_sample_doc(requ...
brapse/aleph_ner
tests/test_pipeline.py
test_pipeline.py
py
1,374
python
en
code
0
github-code
21
[ { "api_name": "tempfile.NamedTemporaryFile", "line_number": 11, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 9, "usage_type": "call" }, { "api_name": "aleph_ner.pipeline.AlephDumpReader", "line_number": 20, "usage_type": "call" }, { "api_...
8429152973
from django.shortcuts import render from django.http import HttpResponse from .models import Gallery, Service, Slider, Staff, Testimonial, Blog from django.core.paginator import Paginator # Create your views here. def home(request): slider = Slider.objects.all() service = Service.objects.all() gallery = Ga...
sudaneee/django-fashion
website/views.py
views.py
py
1,007
python
en
code
0
github-code
21
[ { "api_name": "models.Slider.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "models.Slider.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "models.Slider", "line_number": 8, "usage_type": "name" }, { "api_name": "model...
21843793004
import torch import numpy as np from collections import defaultdict from typing import Sequence, Tuple, Dict, Union def compile_log_likes( logtrans: Union[np.ndarray, torch.Tensor], logemits: Union[np.ndarray, torch.Tensor], terminal_indices: Sequence[int], ) -> Dict[Tu...
mathias-madsen/grammar-induction
parsing.py
parsing.py
py
1,211
python
en
code
0
github-code
21
[ { "api_name": "typing.Union", "line_number": 8, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.Tensor", "line_number": 8, "usage_type": "attribute" }, { "api_name": "typing.Union", "li...
42710572236
import datetime import backtrader as bt import backtrader_plotting from backtrader_plotting.schemes import Tradimo from testcommon import getdatadir class MyStrategy(bt.Strategy): def __init__(self): self.macd = bt.indicators.MACD( period_me1=5, period_me2=8, period_si...
happydasch/btplotting
tests/test_lineactions.py
test_lineactions.py
py
1,546
python
en
code
276
github-code
21
[ { "api_name": "backtrader.Strategy", "line_number": 9, "usage_type": "attribute" }, { "api_name": "backtrader.indicators.MACD", "line_number": 11, "usage_type": "call" }, { "api_name": "backtrader.indicators", "line_number": 11, "usage_type": "attribute" }, { "api...
16104815199
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Nov 15 16:34:35 2019 @author: jooehn """ import numpy as np import matplotlib.pyplot as plt import datetime import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib import colors from scattersim import Scatter from plotfuncs import * im...
Jooehn/Stars-Eating-Planets
Scattersim/bvsqstar_scatter.py
bvsqstar_scatter.py
py
4,403
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.pyplot.close", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 19, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.array", ...
21846746712
from .models import List from django import forms from django_summernote.widgets import SummernoteWidget # Form to Add a new bucket List item class AddBucketlistForm(forms.ModelForm): class Meta: model = List fields = ('title', 'user_name') widgets = { 'title': forms.TextInpu...
Code-Institute-Submissions/AngMaher-PP4-Where-Next
bucketlist/forms.py
forms.py
py
993
python
en
code
0
github-code
21
[ { "api_name": "django.forms.ModelForm", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 7, "usage_type": "name" }, { "api_name": "models.List", "line_number": 10, "usage_type": "name" }, { "api_name": "django.forms.TextI...
30424451841
from flask import Flask, render_template, request import sqlite3 app = Flask(__name__) # Koneksi ke database conn = sqlite3.connect('database.db') cur = conn.cursor() # Membuat tabel jika belum ada cur.execute('''CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY AUTOINCREMENT, ...
zefnathC/workshop-python
workshop/app.py
app.py
py
650
python
en
code
1
github-code
21
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 22, "usage_type": "call" } ]
24525478210
from model.status import Status from database.db import MySqlConnection, DBHelper from cachetools import cached, TTLCache from datetime import timedelta, datetime cache = TTLCache(maxsize=100, ttl=timedelta(minutes=10), timer=datetime.now) class StatusController: @classmethod @cached(cache) def get_name...
AndresGarzonJ/property_microservices
consultation_microservice/controller/status_controller.py
status_controller.py
py
1,066
python
en
code
0
github-code
21
[ { "api_name": "cachetools.TTLCache", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 7, "usage_type": "attribute" }, { "api_name": "dateti...
18976328416
#Prajjwal Chittori #Delhi Technological University(2k18/co/249) #8700694107 #prajjwalchittori_2k18co249@dtu.ac.in from typing import List class Solution: mod=1000000007 def numberofWays(self, money:List[int],N): #we can solve this by dynamic programming by using the following reccurence relation...
pjdurden/VenueMonk
number of ways 2000.py
number of ways 2000.py
py
1,145
python
en
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 8, "usage_type": "name" } ]
71324361333
#imports from turtle import forward import torch import torch.nn as nn from torch.functional import F #Structure of Siamese class Subsampling(nn.Module): '''Subsampling operation, it is done by convolving over stride with the same as kernel size such that there is no overlapping parts''' def __init__(sel...
Coll1ns-cult/NAVE-Sketch-Retriveal
Siamese.py
Siamese.py
py
1,177
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": "torch.nn.Conv2d", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
72288530614
from django.shortcuts import render from django.shortcuts import get_object_or_404 from rest_framework import viewsets from rest_framework.response import Response from rest_framework import status from datetime import datetime import pytz # models from .models import ContratacaoPlano from apps.customers.models import...
7renan/brasil_prev_api
apps/plans/views.py
views.py
py
2,220
python
en
code
1
github-code
21
[ { "api_name": "pytz.utc", "line_number": 22, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 25, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 25, "usage_type": "name" }, { "a...
38527269846
# A_벽돌깨기_서울2반_이민웅 from itertools import combinations, product dxy = [(0, 1), (0, -1), (1, 0), (-1, 0)] def block_boom(x, y, mat): boom = [(x, y, mat[x][y])] while boom: lx, ly, value = boom.pop() mat[lx][ly] = 0 for d in dxy: nx = lx ny = ly # 몇 칸만큼 ...
MinWoongL/Algorithm_Study
SWEA/Algorithm/IM, A_problem/A_brick_out.py
A_brick_out.py
py
2,187
python
en
code
0
github-code
21
[ { "api_name": "itertools.product", "line_number": 55, "usage_type": "call" } ]
4176731112
import csv import json # nacita vsetky europske letiska a ulozi do dictionary id:city def load_eu_airports(): # Slovakia and neighbours country_set = {'Slovakia', 'Czech Republic', 'Austria', 'Poland', 'Hungary', 'Ukraine'} # Slovakia and neighbours + West # country_set = {'Slovakia', 'Czech Republic'...
martinlosak/DataVisualization
data/visualization.py
visualization.py
py
3,101
python
en
code
1
github-code
21
[ { "api_name": "csv.DictReader", "line_number": 14, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 30, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 33, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_n...
38954543979
from flask import render_template, flash, redirect, url_for, request, jsonify, abort from flask_login import current_user, login_required from datetime import datetime from project import db, app from project.models import User, Workout, Exercises, Exercise, Set, Message, Notification from project.main import bp from p...
kguelseven/calisthenics_progression
project/main/routes.py
routes.py
py
10,445
python
en
code
1
github-code
21
[ { "api_name": "flask_login.current_user.is_authenticated", "line_number": 14, "usage_type": "attribute" }, { "api_name": "flask_login.current_user", "line_number": 14, "usage_type": "name" }, { "api_name": "flask_login.current_user.last_seen", "line_number": 15, "usage_ty...
30945421546
""" __author__ = 'Rankin' __mtime__ = '2019-04-19' # code is far away from bugs with the god animal protecting I love animals. They taste delicious. ┏┓ ┏┓ ┏┛┻━━━┛┻┓ ┃ ☃ ┃ ┃ ┳┛ ┗┳ ┃ ┃ ┻ ┃ ┗━┓ ┏━┛ ...
cooture/myBlogSourse
deploy.py
deploy.py
py
1,733
python
en
code
1
github-code
21
[ { "api_name": "paramiko.SSHClient", "line_number": 27, "usage_type": "call" }, { "api_name": "paramiko.AutoAddPolicy", "line_number": 28, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 46, "usage_type": "attribute" }, { "api_name": "os.system", ...
24703830592
#!/usr/bin/env python from flask import Flask from flask_limiter import Limiter from flask_limiter.util import get_remote_address from flask_cors import CORS def create_app(config_filename): """ Creates an app reading the config file """ global app app = Flask(__name__) cors = CORS(app) ...
nabinkhadka/magicvpndownload
create_app.py
create_app.py
py
607
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 15, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 16, "usage_type": "call" }, { "api_name": "views.frontend.frontend", "line_number": 19, "usage_type": "argument" }, { "api_name": "flask_limiter...
14664766823
import seaborn as sns import matplotlib.pyplot as plt import pandas as pd sns.set_context(context="talk") plt.switch_backend('agg') results = pd.read_csv("analysis.csv") plt.rcParams["font.family"] = "Times New Roman" fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(20, 10)) sns.set(style="whitegrid", font="Times...
shiningliang/Multi-level-Causality-Detection-Network
utils/figure_analyze.py
figure_analyze.py
py
992
python
en
code
4
github-code
21
[ { "api_name": "seaborn.set_context", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.switch_backend", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "api_name": "p...
11113068360
# METHOD ONE #pip install google.cloud.storage """ destination_blob_name - what name should be called to the file uploaded eg: test.txt can be named as t.txt where destination_blob_name is t.txt also the destination can also be set ie if we wanted to store in a specific folder in the bucket eg : the/test/folder/t.txt ...
Abey12525/PhiNet
Data_bucket_upload.py
Data_bucket_upload.py
py
1,741
python
en
code
0
github-code
21
[ { "api_name": "google.cloud.storage.Client.from_service_account_json", "line_number": 14, "usage_type": "call" }, { "api_name": "google.cloud.storage.Client", "line_number": 14, "usage_type": "attribute" }, { "api_name": "google.cloud.storage", "line_number": 14, "usage_t...