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
74362477174
import json import sys import math #Comma separated Ticker, Date, Open, High, Low, Close, Volume. from os import walk from filesInPath import filesInPath def getDataFromFile(fileName): f = open("percentData/" + fileName + ".json", "r") return json.load(f) def normalize(value): return 1/(1 + math....
Lucifer1662/StockPricePredict
normalizeJson.py
normalizeJson.py
py
1,126
python
en
code
0
github-code
21
[ { "api_name": "json.load", "line_number": 14, "usage_type": "call" }, { "api_name": "math.exp", "line_number": 17, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 38, "usage_type": "call" }, { "api_name": "filesInPath.filesInPath", "line_num...
8194404910
"""В данной игре необходимо играть за рыцаря, который путешествует по многоэтажному подземелью, борется с врагами и собирает сокровища. """ """Сделано дополнительно: * Перемещение героя зажатием клавиш * Союзник и эффект IDDQD добавлен * Миникарта реализована (красная точка - герой, объекты не выведены специально ("т...
Tzumx/Dungeon_-game-
Main.py
Main.py
py
7,229
python
ru
code
1
github-code
21
[ { "api_name": "pygame.init", "line_number": 27, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 28, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 28, "usage_type": "attribute" }, { "api_name": "pygame.displa...
15658164905
#!/bin/python import sys import socket from datetime import datetime if len(sys.argv) == 2: # Define que el comando debe de recibir dos argumentos. target = socket.gethostbyname(sys.argv[1]) #Define que el argumento con #indice 1 es nuetro objetivo, puede host name...
srodriguezmx/portscanner
scanner.py
scanner.py
py
1,686
python
es
code
0
github-code
21
[ { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "socket.gethostbyname", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now",...
4540561772
#!/usr/bin/env python3.9 import asyncio from flask import Flask, escape, request, send_from_directory, redirect import json import logging from multiprocessing import Process import os import re import requests import signal import subprocess import sys import time from urllib.parse import urlparse import websocket im...
tmathmeyer/chromium-src-tools
devdev.py
devdev.py
py
10,674
python
en
code
0
github-code
21
[ { "api_name": "werkzeug.serving.WSGIRequestHandler.protocol_version", "line_number": 25, "usage_type": "attribute" }, { "api_name": "werkzeug.serving.WSGIRequestHandler", "line_number": 25, "usage_type": "name" }, { "api_name": "flask.Flask", "line_number": 26, "usage_typ...
3896191014
import argparse from transformers import glue_processors as processors from transformers import BertConfig, BertForSequenceClassification, BertTokenizer MODEL_CLASSES = {"bert": (BertConfig, BertForSequenceClassification, BertTokenizer)} def debug_QNLI(args): args.do_lower_case = True return args def base_a...
VITA-Group/essential_sparsity
assets/bert_sparseland/argument.py
argument.py
py
4,231
python
en
code
6
github-code
21
[ { "api_name": "transformers.BertConfig", "line_number": 6, "usage_type": "name" }, { "api_name": "transformers.BertForSequenceClassification", "line_number": 6, "usage_type": "name" }, { "api_name": "transformers.BertTokenizer", "line_number": 6, "usage_type": "name" },...
8143265237
from pathlib import Path import numpy as np import pandas as pd import sys from pyskindose.corrections import calculate_k_bs from pyskindose.corrections import calculate_k_med from pyskindose.corrections import calculate_k_isq from pyskindose.db_connect import db_connect P = Path(__file__).parent.parent.parent sys.pa...
Kalag-Jar/PySkinDose
tests/unittests/test_corrections.py
test_corrections.py
py
3,482
python
en
code
2
github-code
21
[ { "api_name": "pathlib.Path", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path.insert", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pyskindose.corrections.cal...
26428954405
import sys # sys.stdin = open("sample_input.txt", "r") input = sys.stdin.readline from collections import deque # from heapq import heappush, heappop # from collections import defaultdict # from itertools import permutations dr = [-1, 0, 1, 0] dc = [0, 1, 0, -1] def f(sr, sc): qu = deque() visited = [[[-1] * ...
seho27060/aug-algo-study
0829/17836_won.py
17836_won.py
py
1,321
python
en
code
2
github-code
21
[ { "api_name": "sys.stdin", "line_number": 3, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 13, "usage_type": "call" } ]
2672257158
def count_occurrences(element_list): d=dict() for i in set(element_list): d[i]=element_list.count(i) # Use count function to count element i and put it as value corresponding to its key i in dictionary d return d print("The dictionary containing the count of each unique element is:") print(count_occ...
Riazul7/Assignment-Project
Assignment-6/Assignment-6_Answers.py
Assignment-6_Answers.py
py
9,359
python
en
code
0
github-code
21
[ { "api_name": "pprint.pprint", "line_number": 109, "usage_type": "call" }, { "api_name": "flatten_dict.flatten", "line_number": 109, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 118, "usage_type": "call" }, { "api_name": "collect...
25337172350
from PyQt5.QtWidgets import QSizePolicy from matplotlib import pyplot as plt from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas class GraphicsCanvas(FigureCanvas): # холст для помещения графика def __init__(self, fig, parent=None): self.fig = fig FigureCanvas.__init_...
dzbarts/Financial-Analyser
GUI/canvas.py
canvas.py
py
773
python
ru
code
1
github-code
21
[ { "api_name": "matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg", "line_number": 6, "usage_type": "name" }, { "api_name": "matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.__init__", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.backends.backend_qt5a...
16631527956
import random import numba lowers = "abcdefghijklmnopqrstuvwxyz" uppers = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" numbers = "0123456789" lorem_ipsum_sentences = [ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'Quisque vitae varius ex, eu volutpat orci.', 'Aenean ullamcorper orci et vulputate fermentum...
ImGajeed76/useless_stuff
useless/useless_string.py
useless_string.py
py
3,162
python
en
code
0
github-code
21
[ { "api_name": "random.randint", "line_number": 28, "usage_type": "call" }, { "api_name": "numba.jit", "line_number": 24, "usage_type": "call" }, { "api_name": "numba.jit", "line_number": 33, "usage_type": "call" }, { "api_name": "numba.jit", "line_number": 40,...
16055184782
# -*- coding: utf-8 -*- from flask_restful import reqparse, Resource from flask import jsonify from my_models import Notes, Cars, Users, session_git from datetime import datetime import time import datetime from flask import request, abort from functools import wraps from sqlalchemy.orm import class_mapper def requir...
rrLero/chubin
add_car/notes.py
notes.py
py
3,206
python
en
code
0
github-code
21
[ { "api_name": "flask_restful.reqparse.RequestParser", "line_number": 16, "usage_type": "call" }, { "api_name": "flask_restful.reqparse", "line_number": 16, "usage_type": "name" }, { "api_name": "flask.abort", "line_number": 21, "usage_type": "call" }, { "api_name"...
19930035463
# -*- coding: utf-8 -*- ''' 训练摔倒检测模型,mini模型 用法: python /home/reed/Desktop/code/oldcare/trainingfalldetection.py ''' # import the necessary packages from datasets import SimpleDatasetLoader from preprocessing import AspectAwarePreprocessor from preprocessing import ImageToArrayPreprocessor from conv import MiniVGGNet f...
wmn-231314/OldCare
oldCare-cv/train/trainingfalldetection.py
trainingfalldetection.py
py
3,096
python
en
code
5
github-code
21
[ { "api_name": "preprocessing.AspectAwarePreprocessor", "line_number": 40, "usage_type": "call" }, { "api_name": "preprocessing.ImageToArrayPreprocessor", "line_number": 41, "usage_type": "call" }, { "api_name": "imutils.paths.list_images", "line_number": 44, "usage_type":...
346122614
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html import csv import time import datetime from scrapy import signals # from scrapy.contrib.exporter import CsvItemExporter imp...
m-hairan/crawling-api-spider
chainxy/pipelines.py
pipelines.py
py
2,154
python
en
code
0
github-code
21
[ { "api_name": "scrapy.signals.spider_opened", "line_number": 43, "usage_type": "attribute" }, { "api_name": "scrapy.signals", "line_number": 43, "usage_type": "name" }, { "api_name": "scrapy.signals.spider_closed", "line_number": 45, "usage_type": "attribute" }, { ...
26995081051
#!/usr/bin/python from oled import SDD1306OLED from PIL import Image from PIL import ImageDraw from PIL import ImageFont from PIL import ImageOps import time import os.path # Change these values to match the GPIO pins used # to connect the display to your Raspberry Pi dc_pin = 24 # data command pin reset_pin = 25 ...
AidanHolmes/sdd1306oled
example.py
example.py
py
1,358
python
en
code
0
github-code
21
[ { "api_name": "oled.SDD1306OLED", "line_number": 16, "usage_type": "call" }, { "api_name": "oled.initialise", "line_number": 17, "usage_type": "call" }, { "api_name": "oled.clearDisplay", "line_number": 18, "usage_type": "call" }, { "api_name": "PIL.Image.open", ...
26279013985
#!/usr/bin/python3 """ This is the main file where the program runs from. """ from flask import Flask, redirect, render_template, url_for # DB Functions that can do CRUD operations. from db import Pet, Owner, DatabaseConnection # Forms that can be used for the operations. from forms import PetRegistrationForm, Owne...
dat-adi/mock_store
v2/main.py
main.py
py
3,186
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 18, "usage_type": "call" }, { "api_name": "db.DatabaseConnection", "line_number": 20, "usage_type": "name" }, { "api_name": "flask.render_template", "line_number": 26, "usage_type": "call" }, { "api_name": "flask.render_...
35005002766
#!/usr/bin/python3 # -*- coding: utf-8 -*- import sys from urllib.request import urlopen import json import os from os.path import join, isfile import subprocess from shutil import copy, move import stat import codecs def get_download_url(latest_manifest, latest_version): for version in latest_manifest['versions'...
chamer81/docker-minecraft
minecraft/getLatestServer.py
getLatestServer.py
py
1,728
python
en
code
0
github-code
21
[ { "api_name": "json.load", "line_number": 18, "usage_type": "call" }, { "api_name": "urllib.request.urlopen", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 24, "usage_type": "call" }, { "api_name": "urllib.request.urlope...
13360105891
from typing import List, Optional import torch import torch.nn.functional as F from torch import Tensor, nn from refined.doc_preprocessing.preprocessor import Preprocessor from refined.model_components.description_encoder import DescriptionEncoder class EDLayer(nn.Module): def __init__( self, pr...
amazon-science/ReFinED
src/refined/model_components/ed_layer_2.py
ed_layer_2.py
py
6,336
python
en
code
126
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 11, "usage_type": "name" }, { "api_name": "refined.doc_preprocessing.preprocessor.Preprocessor", "line_number": 14, "usage_type": "name" }, { ...
36689510262
from flask import render_template, Blueprint, request, jsonify, redirect from model import redis_cli home_bp = Blueprint('home', __name__) @home_bp.route('/') def index(): if request.args: search_content = str(request.args['search_content']).lower() search_item_ids = redis_cli.smembers(f'{search_...
qinghuawu/ozpricevote
PycharmProjects/OZBargainVote/blueprints/home.py
home.py
py
3,219
python
en
code
0
github-code
21
[ { "api_name": "flask.Blueprint", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 9, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 9, "usage_type": "name" }, { "api_name": "flask.request.args...
3705284496
#!/usr/bin/env python # coding: utf-8 # In[1]: import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from sklearn.model_selection import ShuffleSplit from sklearn.model_selection import KFold from sklearn import preprocessing import math import sys import statistics # In[2]: ...
LegenDu/MachineLearning-BasicAlgorithms
DecisionTree/RegressionTree.py
RegressionTree.py
py
5,997
python
en
code
0
github-code
21
[ { "api_name": "numpy.array", "line_number": 65, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 66, "usage_type": "call" }, { "api_name": "sys.maxsize", "line_number": 102, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_numb...
1868404457
import pymongo client = pymongo.MongoClient("mongodb+srv://root:root051@cluster0.dxerf.mongodb.net/?retryWrites=true&w=majority") db = client.test print(db) data = { "name" : "avinash", "email id" : "avinashkr051@gmail.com", "phone Number": +918895987013, "designation": "developer", "learning" : "D...
avinash051/mongoDB_learning
monogoDbTest.py
monogoDbTest.py
py
428
python
en
code
0
github-code
21
[ { "api_name": "pymongo.MongoClient", "line_number": 2, "usage_type": "call" } ]
29470343813
import os import csv import cv2 import numpy as np from keras import optimizers from keras.models import Sequential, Model from keras.layers import Cropping2D, Flatten, Dense, Lambda, Convolution2D, Dropout from sklearn.model_selection import train_test_split from sklearn.utils import shuffle from keras.callbacks impor...
zieitokk/CarND-Behavior-Cloning-Project
model.py
model.py
py
5,935
python
en
code
1
github-code
21
[ { "api_name": "csv.reader", "line_number": 27, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 32, "usage_type": "call" }, { "api_name": "sklearn.utils.shuffle", "line_number": 38, "usage_type": "call" }, { "api_nam...
17331092135
from enum import Enum from pathlib import Path from shutil import rmtree from time import time from typing import Any, Dict, List, Optional, Tuple, Type, Union import vedro from pyppeteer.browser import Browser from pyppeteer.launcher import Launcher from pyppeteer.page import Page from vedro.core import Dispatcher, P...
tsv1/vedro-pyppeteer
vedro_pyppeteer/_vedro_pyppeteer.py
_vedro_pyppeteer.py
py
5,108
python
en
code
0
github-code
21
[ { "api_name": "_browser_context.BrowserContext", "line_number": 27, "usage_type": "call" }, { "api_name": "typing.Optional", "line_number": 31, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 31, "usage_type": "name" }, { "api_name": "typing.An...
3789694005
import streamlit as st import plotly import plotly.express as px import statsmodels.api as sm import pandas as pd import json def app(): #st.set_page_config(layout="wide") st.title("YEET") query_id = "11a317b4-dd02-41de-97ae-bc038ef27272" df = pd.read_json(f"https://api.flipsidecrypto....
massnomis/herokustreamlitflipsidetrio
massnomis/apps/gpusers.py
gpusers.py
py
2,782
python
en
code
0
github-code
21
[ { "api_name": "streamlit.title", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_json", "line_number": 15, "usage_type": "call" }, { "api_name": "streamlit.sidebar.write", "line_number": 21, "usage_type": "call" }, { "api_name": "streamlit.si...
5422776687
import hatshufflepy import datetime import sys if sys.argv[0]: votes_number = int(sys.argv[1]) else: votes_number = 100 start = datetime.datetime.now() crs_file = "crs.json" public_file = "pk" hatshufflepy.hat_shuffle_create_crs(votes_number, crs_file, public_file) end = datetime.datetime.now() - start pri...
StefanosChaliasos/hatshufflepy
demos/crs.py
crs.py
py
328
python
en
code
0
github-code
21
[ { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", ...
38523382885
import torch import torch.nn as nn class RNNOp(nn.Module): def __init__(self, nhid, dropout=0.): super(RNNOp, self).__init__() self.op = nn.Sequential( nn.Linear(2 * nhid, nhid), nn.Tanh(), nn.Dropout(dropout), ) def forward(self, left, right): ...
shawntan/stack-binary-recursive-nn
recursive.py
recursive.py
py
6,755
python
en
code
5
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 4, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
26969598855
from collections import defaultdict, deque, namedtuple import functools import math import re Direction = namedtuple("Direction", 'dir x y') UP = Direction('up', 0, -1) LEFT = Direction('left', -1, 0) DOWN = Direction('down', 0, 1) RIGHT = Direction('right', 1, 0) class Tree(object): def __init__(self, value): ...
hckhilliam/programming
AdventOfCode/2022/08.py
08.py
py
3,587
python
en
code
0
github-code
21
[ { "api_name": "collections.namedtuple", "line_number": 7, "usage_type": "call" }, { "api_name": "math.prod", "line_number": 135, "usage_type": "call" } ]
24551743466
from sys import argv from json import dump from os import system from os.path import dirname, realpath def create_new_worker(worker): try: name, index = worker.split('@') except ValueError: name = worker.removesuffix('+').removesuffix('-') index = -1 set_to = True if worker.end...
BaumGmbH/python-projects
Heroku Dyno Manager/bin/conver_bat.py
conver_bat.py
py
1,013
python
en
code
0
github-code
21
[ { "api_name": "sys.argv", "line_number": 30, "usage_type": "argument" }, { "api_name": "sys.argv", "line_number": 34, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path.realpath", "line_nu...
18943271007
from datetime import date, datetime, time end_time = datetime(2021,1,1,20) blocksites = ['www.facebook.com','facebook.com'] hosts_path = r"C:\Windows\System32\drivers\etc\hosts" redirect ="127.0.0.1" def block(): if datetime.now() < end_time: print("Block sites") with open(hosts_path...
RandyHanjaya3939/Python-small-project
siteblocker.py
siteblocker.py
py
925
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime", "line_number": 3, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "name" } ]
44008585920
from flask import abort, Blueprint, jsonify, make_response, request from app import db from app.auth import * from app.env import * from app.helper import * from app.models.user import User from app.models.portfolio import Portfolio from app.models.stock import Stock from app.models.transaction import Transaction im...
nickclason/Senior-Design
src/backend/app/api/portfolio_api.py
portfolio_api.py
py
11,987
python
en
code
1
github-code
21
[ { "api_name": "flask.Blueprint", "line_number": 28, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 34, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 34, "usage_type": "name" }, { "api_name": "flask.request...
42821456636
from setup_db import SessionLocal from fastapi.security import OAuth2PasswordBearer import jwt from app.constants import JWT_KEY, JWT_METHOD from fastapi import HTTPException, status, Depends from app.service.rtokens import RTokenService # Dependency def get_db(): db = SessionLocal() try: yield db ...
ipotemkin/movies_on_fastapi
app/dependency.py
dependency.py
py
1,429
python
en
code
0
github-code
21
[ { "api_name": "setup_db.SessionLocal", "line_number": 11, "usage_type": "call" }, { "api_name": "fastapi.security.OAuth2PasswordBearer", "line_number": 18, "usage_type": "call" }, { "api_name": "jwt.decode", "line_number": 23, "usage_type": "call" }, { "api_name":...
18382411211
import os import sys import pytest from wazuh_testing import global_parameters from wazuh_testing.office365 import callback_detect_enabled_err, callback_detect_only_future_events_err, \ callback_detect_interval_err, callback_detect_curl_max_size_err, callback_detect_tenant_id_err, \ callback_detect_client_id_e...
wazuh/wazuh-qa
tests/integration/test_office365/test_configuration/test_invalid.py
test_invalid.py
py
9,169
python
en
code
29
github-code
21
[ { "api_name": "pytest.mark.tier", "line_number": 17, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 17, "usage_type": "attribute" }, { "api_name": "wazuh_testing.tools.monitoring.FileMonitor", "line_number": 21, "usage_type": "call" }, { "api_...
8175738829
import geopandas as gpd import networkx as nx import matplotlib.pyplot as plt import numpy as np import shapely.geometry as geom import h5py as h5 import tqdm __all__ = ['Segment', 'KSegment', 'Roadnetwork', 'kseg_flattening', 'get_seg_id','k_segments', 'k_segments_strict_bfs', 'k_segments_semi_strict_bfs', 'k_segment...
JungHoonJung/complecity
taxidata/core/network/ksegment.py
ksegment.py
py
23,376
python
en
code
1
github-code
21
[ { "api_name": "numpy.empty", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 29, "usage_type": "attribute" }, { "api_name": "numpy.empty", "line_nu...
74447050931
import pylustrator pylustrator.start() import os from copy import deepcopy import numpy as np import matplotlib.pyplot as plt import tensorflow as tf import tensorflow.keras as keras import tensorflow_addons as tfa from tf_spiking import DenseLIF, DenseLIFNoSpike, IntensityToPoissonSpiking from tf_spiking.helper impor...
andistoll/coincidence_detection_and_integration_behavior_in_SNNs
plots/plot_measures_vs_decay.py
plot_measures_vs_decay.py
py
15,634
python
en
code
0
github-code
21
[ { "api_name": "pylustrator.start", "line_number": 2, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.where", "line_num...
19924644788
from fastapi import FastAPI, Depends from fastapi.middleware.cors import CORSMiddleware from app.services.dependencies import get_token_header from app.user_stocks import router as user_stocks_router from app.finance import router as stocks_router app = FastAPI() origins = [ "http://localhost:4200", ] app.add_m...
StephaneConq/crousorama-back-v2
main.py
main.py
py
1,070
python
en
code
0
github-code
21
[ { "api_name": "app.services.dependencies", "line_number": 8, "usage_type": "name" }, { "api_name": "fastapi.FastAPI", "line_number": 8, "usage_type": "call" }, { "api_name": "app.services.dependencies.add_middleware", "line_number": 14, "usage_type": "call" }, { "...
9146463165
# nn for dq learning import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import torchvision.transforms as T # if gpu is to be used device = torch.device("cuda" if torch.cuda.is_available() else "cpu") class LinearNN(nn.Module): def __init__(self, outputs): sup...
k4ntz/MOC
src/dqn/dqn_networks.py
dqn_networks.py
py
3,325
python
en
code
6
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.nn.Module"...
12497546628
from django.shortcuts import render, get_object_or_404 from django.http import HttpResponseRedirect, Http404 from django.urls import reverse from django.contrib.auth.decorators import login_required from .models import Topic, Entry from .forms import TopicForm, EntryForm from django.db.models import Q # methods def ...
thinkingquietly/gratitudejournal
journals/views.py
views.py
py
3,531
python
en
code
0
github-code
21
[ { "api_name": "django.http.Http404", "line_number": 15, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 21, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 26, "usage_type": "call" }, { "api_name": "m...
29148240520
from shapely.geometry import shape import pandas as pd import fiona import rtree def intersection_shape_idx(filename1, filename2): result = pd.DataFrame({'nome': [], 'Class_Name': [], 'geometry': [], 'int_area_m': [], ...
diogocaribe/vector
intersection.py
intersection.py
py
2,622
python
en
code
0
github-code
21
[ { "api_name": "pandas.DataFrame", "line_number": 9, "usage_type": "call" }, { "api_name": "fiona.open", "line_number": 15, "usage_type": "call" }, { "api_name": "fiona.open", "line_number": 17, "usage_type": "call" }, { "api_name": "rtree.index.Index", "line_n...
5977164172
import os import torch from transformers import MBart50Tokenizer, MBartForConditionalGeneration from transformers.adapters import AdapterConfig from .vgamt import VGAMT from logging import getLogger logger = getLogger() xlm_model = "xlm-mlm-100-1280" mbart_model = "facebook/mbart-large-50" mbart_langs = {'cs': 'cs_...
MatthieuFP/VGAMT
src/model/model.py
model.py
py
3,085
python
en
code
7
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "transformers.MBartForConditionalGeneration.from_pretrained", "line_number": 18, "usage_type": "call" }, { "api_name": "transformers.MBartForConditionalGeneration", "line_number": 18, ...
363639893
# -*- coding: utf-8 -*- """ # @file name : cross_entropy.py # @author : zz0320 # @date : 2022-4-21 # @brief : 浮点数形式下的CE Loss """ import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import matplotlib.pyplot as plt class CrossEntropyLossFloat(nn.Module): """ 浮点类...
zz0320/Portrait_Seg_Flask
losses/cross_entropy.py
cross_entropy.py
py
1,881
python
en
code
1
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 15, "usage_type": "name" }, { "api_name": "torch.nn.functional.log_softmax", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.n...
44925192656
import qrcode import image qrc=qrcode.QRCode( version=10, box_size=10, border=4 ) data=input() qrc.add_data(data) qrc.make(fit=True) img=qrc.make_image(fill="black",back_color="white") img.save("test.png")
SatyamSarmah/QR-Code-Detector
QR Code Generator.py
QR Code Generator.py
py
234
python
ja
code
0
github-code
21
[ { "api_name": "qrcode.QRCode", "line_number": 3, "usage_type": "call" } ]
25518862935
import matplotlib.pyplot as plt import numpy as np from sklearn.metrics import confusion_matrix import os from six.moves import cPickle as pickle from tqdm import tqdm from Phonological import Phonological Phon=Phonological() def test_labels(directory): file_list = os.listdir(directory) file_list.sort() ...
jcvasquezc/phonet
phonet/train/utils.py
utils.py
py
4,079
python
en
code
32
github-code
21
[ { "api_name": "Phonological.Phonological", "line_number": 10, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 14, "usage_type": "call" }, { "api_name": "six.moves.cPickle.load", "line_number": 17, "usage_type": "call" }, { "api_name": "six.moves...
37959332745
import requests proxies = { "http": "http://180.148.128.125:80", "https": "http://180.148.128.125:80", } def telegram_bot_sendtext(bot_message, bot_chatID="-874978660"): try: bot_token = "" bot_message = bot_message.replace("_", "\\_") command = ( "https://api.telegram...
dangcaptkd2/text_summarize
utils/telegram_notify.py
telegram_notify.py
py
919
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 30, "usage_type": "call" } ]
70623328374
import logging class VisualizationComponents(): # https://plot.ly/python/v3/fft-filters/ # http://scipy-lectures.org/intro/scipy/auto_examples/plot_fftpack.html # https://dsp.stackexchange.com/questions/724/low-pass-filter-and-fft-for-beginners-with-python def __init__(self, cfg): self.cfg = ...
vamseeachanta/aceengineercode
common/visualization_components.py
visualization_components.py
py
10,381
python
en
code
0
github-code
21
[ { "api_name": "logging.info", "line_number": 25, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 30, "usage_type": "call" }, { "api_name": "common.database.Database", "line_number": 44, "usage_type": "call" }, { "api_name": "common.data.SaveData",...
4439210645
import os import json import shutil def create_result_dir(path, args=None, overwrite=True): if overwrite and os.path.exists(path): shutil.rmtree(path) assert not os.path.exists(path), "Out path exists, choose different dir" os.makedirs(path) if args is not None: with open(os.path.join(...
AtomScott/Crosslingual-audio-emotion-recognition-with-RAVDESS-and-XperDES
tools/utils.py
utils.py
py
405
python
en
code
0
github-code
21
[ { "api_name": "os.path.exists", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "shutil.rmtree", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.exists", "line_num...
262173172
import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from sklearn import svm from sklearn.preprocessing import MinMaxScaler from sklearn.metrics import confusion_matrix from sklearn.tree import DecisionTreeClassifier from sklearn.neighbors import KNeighborsClassifier from sklearn....
Stautis/detecting-inosine-master-thesis
experiment1/classification/homopolymer_classifier.py
homopolymer_classifier.py
py
3,944
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 20, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 26, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.MinMaxScaler", "line_number": 28, "usage_type": "call" }...
39420457440
from functools import partial import pytermgui as ptg import routes import session from src.api.auth.service import getOneUser from src.api.file_crypto.service import getAllFiles from src.components import ConfirmModal from src.components.layouts.AppShell import AppShell # from src.components.modules.foot...
DuckyMomo20012/file-crypto
src/pages/dashboard/index.py
index.py
py
5,495
python
en
code
3
github-code
21
[ { "api_name": "src.api.auth.service.getOneUser", "line_number": 22, "usage_type": "call" }, { "api_name": "session.user", "line_number": 22, "usage_type": "attribute" }, { "api_name": "src.api.file_crypto.service.getAllFiles", "line_number": 24, "usage_type": "call" }, ...
18658886717
# -*- coding: utf-8 -*- """ Created on Thu Apr 9 14:15:10 2020 Week 1 Remember to check sizes of variables if you're having trouble with doing some- thing that you found online @author: John Stout """ #------------------------------------------------------------------------------ # Extracting & Visu...
JohnStout/CodingClub
Week 1/Output/Week1Python_JS.py
Week1Python_JS.py
py
3,076
python
en
code
0
github-code
21
[ { "api_name": "os.chdir", "line_number": 24, "usage_type": "call" }, { "api_name": "scipy.io.loadmat", "line_number": 27, "usage_type": "call" }, { "api_name": "scipy.io", "line_number": 27, "usage_type": "name" }, { "api_name": "scipy.io.loadmat", "line_numbe...
6899377044
import cv2 import numpy as np def nothing(x): pass ''' cv2.namedWindow("Tracking") cv2.createTrackbar("LH", "Tracking", 0, 255, nothing) cv2.createTrackbar("LS", "Tracking", 0, 255, nothing) cv2.createTrackbar("LV", "Tracking", 0, 255, nothing) cv2.createTrackbar("UH", "Tracking", 255, 255, nothing) c...
ronggurmahendra/THT
Draft3.py
Draft3.py
py
2,236
python
en
code
0
github-code
21
[ { "api_name": "cv2.imread", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 23, "usage_type": "call" }, { "api_name": "cv2.INTER_AREA", "line_number": 23, "usage_type": "attribute" }, { "api_name": "cv2.cvtColor", "line_nu...
6226225979
import time import torch from transformers import BertTokenizer, AlbertTokenizer from ner.bert_for_ner import BertCrfForNer from ner.albert_for_ner import AlBertCrfForNer class NER_predict(): def __init__(self): self.device = "cuda" if torch.cuda.is_available() else 'cpu' self.label2idx = {"O": 0,...
wangweichang0820/TCM_KBQA
ner/demo_eval.py
demo_eval.py
py
3,202
python
en
code
2
github-code
21
[ { "api_name": "torch.cuda.is_available", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 10, "usage_type": "attribute" }, { "api_name": "transformers.BertTokenizer.from_pretrained", "line_number": 18, "usage_type": "call" }, { ...
24061011972
import random import matplotlib.pyplot as plt import numpy as np # ## Limits # | Control | type | Limit | # |------------------|-------|-----------------------------------------| # | Pitch | float | Between -1.0 and 1.0 | # | Yaw | ...
snlpatel001213/AirControl
Python/src/airctrl/sample_generator.py
sample_generator.py
py
4,259
python
en
code
5
github-code
21
[ { "api_name": "numpy.array", "line_number": 30, "usage_type": "call" }, { "api_name": "random.choices", "line_number": 39, "usage_type": "call" }, { "api_name": "random.random", "line_number": 45, "usage_type": "call" }, { "api_name": "random.choices", "line_n...
34373172787
import os from pathlib import Path from django.utils.translation import gettext_lazy as _ from dotenv import load_dotenv #Load environment variables load_dotenv() EMAIL_USE_TLS=os.getenv('EMAIL_USE_TLS') EMAIL_HOST=os.getenv('EMAIL_HOST') EMAIL_PORT=os.getenv('EMAIL_PORT') EMAIL_HOST_USER=os.getenv('EMAIL_HOST_US...
gros-pataplouf/portfolio
portfolio/portfolio_core/settings_dev.py
settings_dev.py
py
6,047
python
en
code
0
github-code
21
[ { "api_name": "dotenv.load_dotenv", "line_number": 9, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 12, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 13, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": ...
25339972643
""" Serializer for Publisher Api's """ from rest_framework import serializers from core.models import Publisher import os from django.core.files.uploadedfile import UploadedFile class PublisherSerializer(serializers.ModelSerializer): """Serializer for the publisher model.""" class Meta: ...
samKenpachi011/bwhistory-app-api
app/publisher/serializers.py
serializers.py
py
1,950
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 11, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 11, "usage_type": "name" }, { "api_name": "core.models.Publisher", "line_number": 14, "usage_type": "name...
21072007799
from __future__ import division import random random.seed() import numpy as np import torch from .thinplatespline.batch import TPS from .thinplatespline.utils import (TOTEN, TOPIL, grid_points_2d, noisy_grid, grid_to_img) class JointRandomTPS_TEN(object): def __init__(self, margin_rate=0.25, num_anchor=(4, 4),...
lmm077/SWEM
datasets/data_transform/vos_transforms.py
vos_transforms.py
py
3,227
python
en
code
24
github-code
21
[ { "api_name": "random.seed", "line_number": 4, "usage_type": "call" }, { "api_name": "thinplatespline.utils.grid_points_2d", "line_number": 22, "usage_type": "call" }, { "api_name": "thinplatespline.utils.noisy_grid", "line_number": 23, "usage_type": "call" }, { "...
31628934401
#! /usr/bin/python3 # Minecraft Cave-Spider XP Bot # Coded by Nullbyte (Warren Hood) # Created: 11:15PM Fri, 21 December 2018 # Updated: 12:39PM Sat, 22 December 2018 import pyautogui as pg import time # All intervals/durations below are in seconds # INTERVALS AND DURATIONS WALK_DURATION = 2 #Time to move horizon...
WarrenHood/MCXPBot
mcxpbot.py
mcxpbot.py
py
4,076
python
en
code
0
github-code
21
[ { "api_name": "pyautogui.press", "line_number": 31, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 32, "usage_type": "call" }, { "api_name": "pyautogui.keyDown", "line_number": 33, "usage_type": "call" }, { "api_name": "time.sleep", "line_n...
71776527094
import warnings from collections import OrderedDict import flwr as fl import torch from tqdm import tqdm from model import SimpleCNN from cifar_data import load_data # Define Flower client class FlowerClient(fl.client.NumPyClient): def __init__(self, net): self.net = net def get_parameters(self, conf...
algorythmist/federated-learning
flower/client.py
client.py
py
2,447
python
en
code
0
github-code
21
[ { "api_name": "flwr.client", "line_number": 10, "usage_type": "attribute" }, { "api_name": "collections.OrderedDict", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.tensor", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.nn.CrossE...
1429057602
import os from pathlib import Path from typing import List import numpy as np import pandas as pd import csv import eccpy def aaa(df_or_series): """ Function for use in debugging. Saves pandas Series or Dataframes to a user-defined csv file. """ # convert any series to dataframe if isinstance(d...
teese/eccpy
eccpy/tools.py
tools.py
py
25,007
python
en
code
39
github-code
21
[ { "api_name": "pandas.Series", "line_number": 17, "usage_type": "attribute" }, { "api_name": "csv.QUOTE_NONNUMERIC", "line_number": 20, "usage_type": "attribute" }, { "api_name": "numpy.min", "line_number": 148, "usage_type": "call" }, { "api_name": "numpy.max", ...
15289938791
""" A class to handle the QMC samples of the DLA parameters: theta = (z_dla, logNHI) = (redshift of DLA, column density of DLA) """ import numpy as np import scipy.stats as stats from scipy.integrate import quad import h5py from .set_parameters import Parameters from .model_priors import PriorCatalog class DLASamples...
jibanCat/gpy_dla_detection
gpy_dla_detection/dla_samples.py
dla_samples.py
py
4,005
python
en
code
2
github-code
21
[ { "api_name": "set_parameters.Parameters", "line_number": 22, "usage_type": "name" }, { "api_name": "model_priors.PriorCatalog", "line_number": 22, "usage_type": "name" }, { "api_name": "set_parameters.Parameters", "line_number": 61, "usage_type": "name" }, { "api...
5980357376
from multiprocessing import Process, Queue from datetime import datetime keep_processing = True def loop_a(q): try: while keep_processing: q.put([datetime.now().strftime('%Y-%m-%d %H:%M:%S'), 'hello']) except KeyboardInterrupt: return "KeyboardInterrupt loop_a" def loop_b(q): t...
imyoungyang/video-streaming
others/multi-processes-upload.py
multi-processes-upload.py
py
765
python
en
code
24
github-code
21
[ { "api_name": "datetime.datetime.now", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "name" }, { "api_name": "multiprocessing.Queue", "line_number": 20, "usage_type": "call" }, { "api_name": "multiproc...
29859907016
import os from collections import defaultdict import numpy as np import matplotlib matplotlib.use('pdf') import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from matplotlib import rcParams ### Text ### rcParams['font.family'] = 'serif' rcParams['font.serif'] = ['Minion Pro'] rcParams['font.size'] = ...
chrisjbillington/thesis
figures/software/repo_stats/generate_plots.py
generate_plots.py
py
5,057
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.use", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.rcParams", "line_number": 11, "usage_type": "name" }, { "api_name": "matplotlib.rcParams", "line_number": 12, "usage_type": "name" }, { "api_name": "matplotlib.rcPa...
19939445075
# -*- coding: utf-8 -*- from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand import os import sys with open('README.rst') as f: readme = f.read() with open('LICENSE') as f: license = f.read() with open('tools/pip-requires') as f: pip_requires = f.read().spl...
cgmcintyr/pycadvisor
setup.py
setup.py
py
1,467
python
en
code
1
github-code
21
[ { "api_name": "setuptools.command.test.test", "line_number": 20, "usage_type": "name" }, { "api_name": "setuptools.command.test.test.initialize_options", "line_number": 23, "usage_type": "call" }, { "api_name": "setuptools.command.test.test", "line_number": 23, "usage_typ...
15315157629
import argparse import collections import io import os import sys import time import ijson from ijson import compat _benchmarks = collections.OrderedDict() def benchmark(f): _benchmarks[f.__name__] = f return f @benchmark def long_list(n): return b'[' + b','.join([b'1' for _ in range(n)]) + b']' @bench...
ajmyers/Sublime-TM1
include/ijson/benchmark.py
benchmark.py
py
8,357
python
en
code
10
github-code
21
[ { "api_name": "collections.OrderedDict", "line_number": 12, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 70, "usage_type": "call" }, { "api_name": "ijson.get_backend", "line_number": 73, "usage_type": "call" }, { "api_name": "col...
34457168035
from __future__ import unicode_literals from django.shortcuts import render, redirect from django.http import HttpResponse from student.models import * from .forms import * from alumni.urls import * from django.contrib.auth.decorators import login_required from .filters import studentfilter # Create your vie...
hariyanganesh/Alumini
alumni/student/views.py
views.py
py
1,803
python
en
code
0
github-code
21
[ { "api_name": "django.shortcuts.render", "line_number": 23, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 26, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 30, "usage_type": "call" }, { "api_nam...
15134413927
# coding: utf-8 import sys sys.path.append('..') import numpy as np import matplotlib.pyplot as plt from common.optimizer import SGD from dataset import ptb from rnn import TimeRNN from common.time_layers import TimeAffine, TimeEmbedding, TimeSoftmaxWithLoss class SimpleRNNlm: def __init__(self, vocab_size, wordvec...
miyamotononno/dl_from_scratch
DLfromS2/chapter5/simple_rnnlm.py
simple_rnnlm.py
py
3,406
python
en
code
0
github-code
21
[ { "api_name": "sys.path.append", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "numpy.random", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "line_...
41569888491
import copy import json import logging import os import traceback import cluster_state import csu_http import dao import database_state import dbapi import general_task_mgr import ha_mgr import helpers import long_term_task import node_state import pg_db_lib import pg_helpers import polar_lib import rpc_utils import t...
csudata/clup
lib/ui_req_handler_ha.py
ui_req_handler_ha.py
py
71,134
python
en
code
1
github-code
21
[ { "api_name": "csu_http.MANDATORY", "line_number": 26, "usage_type": "attribute" }, { "api_name": "csu_http.INT", "line_number": 26, "usage_type": "attribute" }, { "api_name": "csu_http.MANDATORY", "line_number": 27, "usage_type": "attribute" }, { "api_name": "csu...
41798780686
import random from abc import ABC, abstractmethod from dataclasses import dataclass, field from typing import List, Tuple import numpy as np from srl.base.define import EnvObservationTypes, RLTypes from srl.base.rl.algorithms.discrete_action import DiscreteActionWorker from srl.base.rl.base import RLParameter from sr...
pocokhc/simple_distributed_rl
srl/algorithms/rainbow/rainbow.py
rainbow.py
py
17,839
python
en
code
25
github-code
21
[ { "api_name": "srl.base.rl.config.RLConfig", "line_number": 58, "usage_type": "name" }, { "api_name": "srl.rl.memories.priority_experience_replay.PriorityExperienceReplayConfig", "line_number": 58, "usage_type": "name" }, { "api_name": "srl.rl.models.image_block.ImageBlockConfig"...
73247424374
import base64 import io import xlwt from odoo import _, fields, models from odoo.tools import format_date class StockPickingReport(models.TransientModel): """Stock Picking Report.""" _name = "stock.picking.xls.report" _description = "Stock Picking XLSX reports" name = fields.Char(default="Genric R...
JayVora-SerpentCS/fleet_management
fleet_operations/report/parts_received.py
parts_received.py
py
6,898
python
en
code
20
github-code
21
[ { "api_name": "odoo.models.TransientModel", "line_number": 10, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 10, "usage_type": "name" }, { "api_name": "odoo.fields.Char", "line_number": 16, "usage_type": "call" }, { "api_name": "odoo.fie...
74546425332
import time import warnings from tensorboardX import SummaryWriter from torch import optim from torch.backends import cudnn from C2R import C2R from data_utils import * from models.C2PNet import * from option import model_name, log_dir warnings.filterwarnings('ignore') print('log_dir :', log_dir) print('model_name:...
YuZheng9/C2PNet
main.py
main.py
py
6,903
python
en
code
82
github-code
21
[ { "api_name": "warnings.filterwarnings", "line_number": 13, "usage_type": "call" }, { "api_name": "option.log_dir", "line_number": 15, "usage_type": "argument" }, { "api_name": "option.model_name", "line_number": 16, "usage_type": "argument" }, { "api_name": "time...
30622766629
import os, json, math from PyQt4 import QtCore, QtGui from qgis import core as QgsCore, gui as QgsGui, utils as QgsUtils from apiqtcatalog import API_Catalog from legendlayercatalog import ( DialogCatalogSetting, LegendCatalogLayer ) from legendlayerraster import LegendRasterGeom from messagebarcancel import MessageB...
lmotta/utils_catalog
catalogimage.py
catalogimage.py
py
24,349
python
en
code
0
github-code
21
[ { "api_name": "PyQt4.QtCore.QObject", "line_number": 13, "usage_type": "attribute" }, { "api_name": "PyQt4.QtCore", "line_number": 13, "usage_type": "name" }, { "api_name": "PyQt4.QtCore.pyqtSignal", "line_number": 14, "usage_type": "call" }, { "api_name": "PyQt4....
70611351092
import RPi.GPIO as GPIO import numpy as np import cv2 from time import sleep # initialize GPIO.setwarnings(False) GPIO.setmode(GPIO.BOARD) GPIO.setup(0o3, GPIO.OUT) GPIO.setup(0o5, GPIO.OUT) cam = cv2.VideoCapture(0) #starts cam capturing cv2.namedWindow("test") img_counter = 0 #picture_name counter # setup frequency...
wild-radio/embarcados
both.py
both.py
py
1,606
python
en
code
0
github-code
21
[ { "api_name": "RPi.GPIO.setwarnings", "line_number": 7, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 7, "usage_type": "name" }, { "api_name": "RPi.GPIO.setmode", "line_number": 8, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_numb...
8641286545
# -- coding: utf-8 -- # @Time : 2022/4/14 11:15 # @Author : codeking # @File : 多元线性拟合.py import pandas from sklearn import linear_model # -javaagent:C:\\All_Softwares\\Develop_Tools\\JetBrains\\IntelliJ_IDEA_2021.3.3\\ja-netfilter\\ja-netfilter.jar if __name__ == '__main__': df = pandas.read_csv('cars.csv') X ...
codeking01/python_project
Src/Python_project/Python_Task/Task/2022_April/多元线性拟合.py
多元线性拟合.py
py
956
python
zh
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 15, "usage_type": "call" }, { "api_name": "sklearn.linear_model", "line_number": 15, "usage_type": "name" } ]
3686717944
import pygame import sys import random import unicodedata from grafos import grafo from win_arbol import arbol class barajas(): #Se crea la clase nodo class _Nodo: #Se hace el metodo incializador de la clase nodo def __init__(self, valor): self.valor = valor self.nodo_s...
Jassy0205/TAD_2.0
menu_principal.py
menu_principal.py
py
43,985
python
es
code
0
github-code
21
[ { "api_name": "pygame.init", "line_number": 27, "usage_type": "call" }, { "api_name": "pygame.Rect", "line_number": 53, "usage_type": "call" }, { "api_name": "pygame.Rect", "line_number": 54, "usage_type": "call" }, { "api_name": "pygame.Rect", "line_number": ...
20788086364
# -*- coding: utf-8 -*- # @File : crawl_proxy_ip.py # @Author: LaoJu # @Date : 2019/2/12 # @Desc : import requests import re from scrapy.selector import Selector import MySQLdb conn = MySQLdb.connect(host="118.24.117.85", user="root", passwd="616632", db="article_spider", charset="utf8") cursor = conn.cursor() d...
LaoJu/ArticleSpider
tools/crawl_proxy_ip.py
crawl_proxy_ip.py
py
3,777
python
en
code
0
github-code
21
[ { "api_name": "MySQLdb.connect", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 22, "usage_type": "call" }, { "api_name": "re.match", "line_number": 28, "usage_type": "call" }, { "api_name": "re.match", "line_number": 3...
21421376929
"""История пользовательских запросов о курсах доллара""" from aiogram import Router from aiogram.types import Message, CallbackQuery, InlineKeyboardMarkup from aiogram.filters import Command, StateFilter from aiogram.fsm.state import default_state from database import UserCrud from filters import IsPaginatorBtn, IsUs...
YuryRass/DollarRateBot
handlers/user_history.py
user_history.py
py
1,805
python
en
code
0
github-code
21
[ { "api_name": "aiogram.Router", "line_number": 14, "usage_type": "name" }, { "api_name": "aiogram.types.Message", "line_number": 17, "usage_type": "name" }, { "api_name": "aiogram.types.CallbackQuery", "line_number": 17, "usage_type": "name" }, { "api_name": "data...
37849422036
#!/usr/bin/python3.6 import random from termcolor import cprint import nmap import os def genip(): a = random.randint(1, 255) b = random.randint(1, 255) c = random.randint(1, 255) d = random.randint(1, 255) ip = str(a) + '.' + str(b) + '.' + str(c) + '.' + str(d) return ip def ifhostup(host): ...
sanctuss/pentest-tools
randomftp-anon.py
randomftp-anon.py
py
1,142
python
en
code
0
github-code
21
[ { "api_name": "random.randint", "line_number": 8, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 9, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 10, "usage_type": "call" }, { "api_name": "random.randint", "line...
1458698627
""" Script to read LEPLAC bathymetry file and convert to MOHID standards Data source: https://www.marinha.mil.br/dhn/sites/www.marinha.mil.br.dhn/files/DTM_BR_LEPLAC_FEV23_1000m_LatLongProf.zip Author: Douglas F Rodrigues """ import pandas as pd import geopandas as gpd from shapely import geometry # Define file name ...
dougfraga/modelling-tools
read_leplac_bat.py
read_leplac_bat.py
py
1,924
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "geopandas.GeoDataFrame", "line_number": 19, "usage_type": "call" }, { "api_name": "geopandas.points_from_xy", "line_number": 19, "usage_type": "call" }, { "api_name": "shape...
41019519790
import numpy as np import matplotlib.pyplot as plt import sys altitude = np.loadtxt("Telemetry/altitude.txt") desiredVelocity = np.loadtxt("Telemetry/targetVel.txt") velocity = np.loadtxt("Telemetry/velocity.txt") #simulationtime = np.loadtxt("Telemetry/simtime.txt") #fig, ax = plt.subplots() #ax.plot(altitude, desir...
TG49/Mars-Lander
Lander/Lander/Visualise Telemetry.py
Visualise Telemetry.py
py
837
python
en
code
0
github-code
21
[ { "api_name": "numpy.loadtxt", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", ...
31355641166
from setuptools import setup, find_packages with open("README.md", "r") as fh: long_description = fh.read() setup( name='gpt4pandas', version='0.2', packages=find_packages(), license='Apache License 2.0', description='A tool that uses the GPT4ALL language model and the Pandas library to answer...
ParisNeo/gpt4pandas
setup.py
setup.py
py
665
python
en
code
23
github-code
21
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 9, "usage_type": "call" } ]
19443444047
#! /usr/bin/python3 # -*- coding-utf-8 -*- """ This script transform a md into a plain html in the context of a documentation for Kit&Pack. """ import argparse from lib.geoReader import geoReader print("---------------------------- geo --") print("-- by antoine.delhomme@espci.org --") print("------------------------...
a2ohm/geo-1
geo.py
geo.py
py
767
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "lib.geoReader.geoReader", "line_number": 31, "usage_type": "call" } ]
7328894630
import numpy as np import matplotlib.pyplot as plt import matplotlib.collections as mc def gen_data(depth, n_dim, depth_labels = None): def helper(depth, sigma, offset, path): if depth == 0: x = np.random.normal(offset, sigma, offset.shape) y = 0 if depth_labels is not ...
aleveren/ucsd-research
hier-clust/notebooks/gen_data_util.py
gen_data_util.py
py
1,719
python
en
code
0
github-code
21
[ { "api_name": "numpy.random.normal", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.random.normal",...
26969442835
from collections import defaultdict, deque import functools import math import re def part1(data): lines = parse_data(data) points = defaultdict(int) for p1, p2 in lines: x1, y1 = p1 x2, y2 = p2 if x1 == x2: for y in range(min(y1, y2), max(y1, y2) + 1): ...
hckhilliam/programming
AdventOfCode/2021/05.py
05.py
py
1,432
python
en
code
0
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 9, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 25, "usage_type": "call" } ]
14962646664
# In this challenge, your goal is to send a GET request to /pentesterlab with the Accept-Language set to key-please import requests url = 'http://ptl-94af91fc-97ce22a2.libcurl.so/pentesterlab' # Here I create a custom header as the payload. payload = {'Accept-Language': 'key-please'} # Set the 'headers' value as th...
morellanthony/PL-http-badge
http_05.py
http_05.py
py
398
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" } ]
1553230523
import pandas as pd import numpy as np from utils.functions_ZZ_extraction import load_ZZ_output def load_clustering_results(path): output = pd.read_pickle(path) return output['dfParam'], output['pca_result'] def reassign_bout_cluster(id, df_bout_all, df_clustering): start, end = df_bout_all.BoutStart[id...
wyartlab/Carbo-Tano_Lapoix_2023
SCAPE/utils/boutClustering.py
boutClustering.py
py
3,058
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_pickle", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.nan", "line_number": 20, "usage_type": "attribute" }, { "api_name": "numpy.arange", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.DataFrame", ...
34223832054
# https://github.com/pengzhenghao/use-ray-with-slurm/blob/main/launch.py # Usage: python using_sbatch_and_ray.py --num-cpus 2 --command "python ray_light.py" --priority -1 import argparse import subprocess import sys import time from pathlib import Path template_file = Path(__file__) / 'template.sh' NUM_CPUS = "{{...
tishina26/test_task_ML_cnn_ray_cluster
using_sbatch_and_ray.py
using_sbatch_and_ray.py
py
2,098
python
en
code
0
github-code
21
[ { "api_name": "pathlib.Path", "line_number": 12, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 41, "usage_type": "call" }, { "api_name": "time.localtime", ...
17647621659
import pyaes import rsa key = "This_key_is__a__complete_mystery" #ask for the path of the file to be encrypted path = input("Type the path to the file to be encrypted: ") #read the file with open(path, 'r') as content_file: content = content_file.read() #set encode the key key = key.encode('utf-8') aes = pyaes.A...
katherinespiess/bcc_2019_2_SisSeg
exercicios_8/AesEncrypt.py
AesEncrypt.py
py
1,008
python
en
code
0
github-code
21
[ { "api_name": "pyaes.AESModeOfOperationCTR", "line_number": 13, "usage_type": "call" }, { "api_name": "rsa.PublicKey.load_pkcs1", "line_number": 30, "usage_type": "call" }, { "api_name": "rsa.PublicKey", "line_number": 30, "usage_type": "attribute" }, { "api_name"...
14405179132
"""Helpers for switch_manager integration.""" import json, pathlib, os, shutil from homeassistant.core import HomeAssistant from homeassistant.util.yaml.loader import _find_files, load_yaml from .const import ( LOGGER, DOMAIN, BLUEPRINTS_FOLDER, CONF_BLUEPRINTS, CONF_MANAGED_SWITCHES ) from homea...
Sian-Lee-SA/Home-Assistant-Switch-Manager
custom_components/switch_manager/helpers.py
helpers.py
py
3,537
python
en
code
140
github-code
21
[ { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 15, "usage_type": "call" }, { "api_name": "json.load", "line_n...
16378068082
from random import choice from string import ascii_lowercase as letters from django import forms from django.contrib import admin from django.core.exceptions import ValidationError from .models import Variant class VariantForm(forms.ModelForm): class Meta: model = Variant fields = ('problems', '...
Luganskaya-Svetlana/Physalis
physalisproject/variants/admin.py
admin.py
py
4,650
python
ru
code
3
github-code
21
[ { "api_name": "django.forms.ModelForm", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 11, "usage_type": "name" }, { "api_name": "models.Variant", "line_number": 13, "usage_type": "name" }, { "api_name": "django.core.e...
15608391927
"""ETL. Модуль main. Приложение по регулярному просеиванию данных в БД PostgreSQL для выявления измененных, с целью обновления этих данных в БД в ElasticSearch (ES) ES содержит эту же информацию для обеспечения (предоставления) функции полнотекстового поиска. """ import configparser import logging import os from cont...
NimblePython/Async_API_sprint_1
postgres_to_es/main.py
main.py
py
3,251
python
ru
code
0
github-code
21
[ { "api_name": "dotenv.load_dotenv", "line_number": 19, "usage_type": "call" }, { "api_name": "dotenv.find_dotenv", "line_number": 19, "usage_type": "call" }, { "api_name": "backoff_dec.backoff", "line_number": 33, "usage_type": "call" }, { "api_name": "psycopg2.co...
21113600664
#!/usr/bin/python3 import sys from itertools import permutations, tee def pairwise(iterable): # pairwise('ABCDEFG') --> AB BC CD DE EF FG a, b = tee(iterable) next(b, None) return zip(a, b) ds = {} cities = set() for l in sys.stdin: [frm, zz, to, zz, dist] = l.strip().split(' ') ds[frm, to] ...
jjpp/aoc
2015/09/shortest.py
shortest.py
py
677
python
en
code
0
github-code
21
[ { "api_name": "itertools.tee", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 15, "usage_type": "attribute" }, { "api_name": "itertools.permutations", "line_number": 26, "usage_type": "call" } ]
28699833756
import requests import logging from django.http import JsonResponse from django.core.exceptions import ImproperlyConfigured from sparrow_django_common.utils.validation_data import VerificationConfiguration from sparrow_django_common.utils.consul_service import ConsulService from sparrow_django_common.utils.get_settin...
hanguangbaihuo/sparrow_django_common
sparrow_django_common/middleware/permission_middleware.py
permission_middleware.py
py
3,504
python
en
code
2
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "sparrow_django_common.base_middlware.base_middleware.MiddlewareMixin", "line_number": 15, "usage_type": "name" }, { "api_name": "sparrow_django_common.utils.validation_data.VerificationCo...
20677484238
import numpy as np import random import matplotlib.pyplot as plt from keras.models import Sequential, Model from keras.layers import Input, Dense, Dropout, Lambda from sklearn.metrics import confusion_matrix from sklearn.model_selection import train_test_split from metrics import * from data_encode import * # Functi...
mehmetalixk/topify
code/siamese_network.py
siamese_network.py
py
5,199
python
en
code
0
github-code
21
[ { "api_name": "random.randrange", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 30, "usage_type": "call" }, { "api_name": "keras.models.Sequential", "line_number": 35, "usage_type": "call" }, { "api_name": "keras.layers.Den...
10347919212
import logging import os import sys from torch import nn from fairseq import utils from fairseq.models import ( FairseqEncoderModel, FairseqEncoder, register_model, register_model_architecture, ) from fairseq.modules.quant_noise import quant_noise as apply_quant_noise_ try: from transformers impo...
li-aolong/TemplateGEC
fairseq-0.12.2/fairseq/models/huggingface/hf_bert.py
hf_bert.py
py
10,205
python
en
code
18
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "fairseq.models.FairseqEncoderModel", "line_number": 29, "usage_type": "name" }, { "api_name": "torch.nn.ModuleDict", "line_number": 45, "usage_type": "call" }, { "api_name...
18423694727
from selenium import webdriver import time chrome_options = webdriver.ChromeOptions() chrome_options.add_argument('--headless') chrome_options.add_argument('--no-sandbox') chrome_options.add_argument('--disable-dev-shm-usage') options = webdriver.ChromeOptions() def 키워드크롤링(): driver = webdriver.Chrome('chromedri...
ojc1234/pythonproject
keywordcloring.py
keywordcloring.py
py
918
python
ko
code
0
github-code
21
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 3, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 3, "usage_type": "name" }, { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 10, "usage_type": "call" }, { ...
73365754614
from django.http import HttpRequest, HttpResponse from django.shortcuts import render from django.templatetags.static import static # Create your views here. def stack_view(request: HttpRequest) -> HttpResponse: context = { "cards": { "django": { "type": "Web Framework", ...
baseplate-admin/CoreProject
backend/django_core/apps/pages/views/stack.py
stack.py
py
1,031
python
en
code
99
github-code
21
[ { "api_name": "django.http.HttpRequest", "line_number": 8, "usage_type": "name" }, { "api_name": "django.templatetags.static.static", "line_number": 14, "usage_type": "call" }, { "api_name": "django.templatetags.static.static", "line_number": 20, "usage_type": "call" },...
17544901317
import weather import requests BASE_URL = "http://weather-api.eba-jgjmjs6p.eu-west-2.elasticbeanstalk.com/api" candidate_number = 89 def test_get_weather_for_city_check_status_code_equals_200(): city = 'bath' url = BASE_URL + '/weather/'+str(candidate_number)+'/'+city.lower()+'/' response = requests.get(ur...
Thoma1999/WeatherChallenge
test_weather.py
test_weather.py
py
1,198
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "weather.make_get_request", "line_number": 23, "usage_type": "call" }, { "api_name": "weather.make_get_re...
72549508213
import json import unittest from celery import group from celerysetup import app from worker import word_count from collector import reduce_word_count, top_ten class TestCelery(unittest.TestCase): def setUp(self): app.conf.CELERY_ALWAYS_EAGER = True def test_single_word(self): result = word_...
fboxwala/interview201510
test_celery.py
test_celery.py
py
922
python
en
code
0
github-code
21
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "celerysetup.app.conf", "line_number": 12, "usage_type": "attribute" }, { "api_name": "celerysetup.app", "line_number": 12, "usage_type": "name" }, { "api_name": "work...
38009423325
import pytest from django.urls import reverse pytestmark = [pytest.mark.django_db] def test_project_list_api(api, project): url = reverse('projects') response = api.get(url) data = response.data assert response.status_code == 200 assert len(response.data) > 0 def test_simple_t...
pykulytsky/kollox
backend/kollox/todo/tests/test_base_api.py
test_base_api.py
py
1,230
python
en
code
0
github-code
21
[ { "api_name": "pytest.mark", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.urls.reverse", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.reverse", "line_number": 18, "usage_type": "call" }, { "api_name": "django.urls.re...
10034991514
#! /usr/bin/python3 import configparser import logging import os config = dict() parser = None def _create(configfile): with open(configfile,"w+") as _: pass def _save(configfile = "trading.conf"): with open(configfile, 'w+') as conf: parser.write(conf) return True return False d...
jiraky/cryptopia-api-python
configuration.py
configuration.py
py
2,031
python
en
code
0
github-code
21
[ { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_...
22720891633
from __future__ import annotations from typing import * # NoQA import collections import hashlib import io import itertools import os import edgedb from edb.common import binwrapper from . import consts class DumpBlockInfo(NamedTuple): schema_object_id: bytes schema_deps: List[bytes] type_desc: bytes...
gm19900510/edgedb
edb/cli/dump/restore.py
restore.py
py
5,601
python
en
code
null
github-code
21
[ { "api_name": "os.PathLike", "line_number": 42, "usage_type": "attribute" }, { "api_name": "edb.common.binwrapper.BinWrapper", "line_number": 46, "usage_type": "call" }, { "api_name": "edb.common.binwrapper", "line_number": 46, "usage_type": "name" }, { "api_name"...
24197978872
#!/usr/bin/env python3 from os.path import expanduser import cv2 import numpy as np import tf from cv_bridge import CvBridge from nav_msgs.msg import Odometry from sensor_msgs.msg import Image, CameraInfo import pybullet as pb import pybullet_data import rospy from soccer_common.transformation import Transformation...
Vuwij/freehicle
freehicle_control/src/main.py
main.py
py
4,900
python
en
code
1
github-code
21
[ { "api_name": "rospy.init_node", "line_number": 19, "usage_type": "call" }, { "api_name": "rospy.Publisher", "line_number": 20, "usage_type": "call" }, { "api_name": "sensor_msgs.msg.Image", "line_number": 20, "usage_type": "argument" }, { "api_name": "rospy.Publi...
11124823493
import random import numpy as np import matplotlib.pyplot as pl # Local imports from ..model_components.phonological_level import MotorPhonemePrograms from . import testutils from ..model_components._parameters_lists import ParList, Target, WorkingParList, State from ..model_components.vocal_tract import VocalTract c...
Naeghil/HSFC
src/test/test_motion.py
test_motion.py
py
7,095
python
en
code
0
github-code
21
[ { "api_name": "numpy.array", "line_number": 50, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 51, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 53, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...