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
17434046001
import matplotlib.pyplot as plt import cv2 import numpy as np def main(): path="./image2.jpg" image=plt.imread(path) red_chanel=image[:,:,0] green_chanel=image[:,:,1] blue_chanel=image[:,:,2] height,width=image.shape[:2] grayscale=np.zeros((height,width),np.int...
SajeebChakraborty/Digital_Image_Processing_Lab
Basic_convertion.py
Basic_convertion.py
py
2,390
python
en
code
2
github-code
97
[ { "api_name": "matplotlib.pyplot.imread", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name": "numpy.zeros", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.int8", ...
259671060
import wave import threading from time import sleep import pyaudio import numpy as np #import eyeD3 import sys CHUNK = 1024 if len(sys.argv) < 2: print("Plays a wave file.\n\nUsage: %s filename.wav" % sys.argv[0]) sys.exit(-1) wf = wave.open(sys.argv[1], 'rb') p = pyaudio.PyAudio() stream = p.open(format=p...
MaxiDoet/rpi-radio
audio/audio.py
audio.py
py
785
python
en
code
0
github-code
97
[ { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 13, "usage_type": "call" }, { "api_name": "wave.open", "line_number": 1...
20040852372
from mmseg.datasets.pipelines.transforms import * from mmseg.datasets.builder import PIPELINES from scipy.ndimage.morphology import distance_transform_edt import cv2 import numpy as np from collections import OrderedDict """ This file contains the implementation of various data augmentation pipelines for the DoubleIma...
aiearth-damo/deeplearning
aiearth/deeplearning/datasets/mmseg/changedet/pipelines/double_img_transforms.py
double_img_transforms.py
py
61,234
python
en
code
33
github-code
97
[ { "api_name": "numpy.array", "line_number": 93, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 93, "usage_type": "attribute" }, { "api_name": "mmseg.datasets.builder.PIPELINES.register_module", "line_number": 26, "usage_type": "call" }, { "a...
36209909670
import os from slack_bolt import App from slack_bolt.adapter.socket_mode import SocketModeHandler from dotenv import load_dotenv import openai import sqlalchemy import sqlalchemy.ext.declarative import sqlalchemy.orm import datetime # 環境変数を読み込む load_dotenv() openai.api_key=os.environ.get("OPENAI_API_KEY") # ボットトークンとソ...
alcoffee/gpt-slack-bot
src/main.py
main.py
py
5,102
python
ja
code
0
github-code
97
[ { "api_name": "dotenv.load_dotenv", "line_number": 13, "usage_type": "call" }, { "api_name": "openai.api_key", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 14, "usage_type": "call" }, { "api_name": "os.environ", ...
24561085244
from django.contrib.auth.decorators import login_required from django.contrib.auth.models import Group from django.shortcuts import redirect @login_required def upgrade_me(request): user = request.user premium_group = Group.objects.get(name='authors') if not request.user.groups.filter(name='authors').exis...
4elovek-nevadimka/HW_05_NewsPortal
NewsPaper/sign/views.py
views.py
py
654
python
en
code
0
github-code
97
[ { "api_name": "django.contrib.auth.models.Group.objects.get", "line_number": 9, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.Group.objects", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.contrib.auth.models.Group", "line_number": 9,...
16513302039
import pandas as pd import matplotlib.pyplot as plt import numpy as np from tensorflow.keras.preprocessing.image import ImageDataGenerator from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Dropout, Activation, Flatten, BatchNormalization from tensorflow.keras.layers import ...
kira9303/Internship_models
cars_price_prediction/cars_price_model.py
cars_price_model.py
py
10,248
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 41, "usage_type": "call" }, { "api_name": "numpy.unique", "line_num...
71597303359
if not __debug__: raise RuntimeError( 'DataLad cannot run in "optimized" mode, i.e. python -O') import atexit import os # this is not to be modified. for querying use get_apimode() __api = 'python' def get_apimode(): """Returns the API mode label for the current session. The API mode label indi...
datalad/datalad
datalad/__init__.py
__init__.py
py
4,801
python
en
code
464
github-code
97
[ { "api_name": "os.environ", "line_number": 65, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 69, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 69, "usage_type": "attribute" }, { "api_name": "random.seed", "lin...
21758067637
from math import sqrt from numpy import asarray import operator import sys from warnings import warn # relax module imports. from lib.errors import RelaxError, RelaxImplementError, RelaxNoSpectraError from lib.io import sort_filenames, write_data from lib.text.sectioning import section, subsection from lib.spectrum.pe...
nmr-relax/relax
pipe_control/spectrum.py
spectrum.py
py
38,994
python
en
code
10
github-code
97
[ { "api_name": "pipe_control.mol_res_spin.spin_loop", "line_number": 23, "usage_type": "call" }, { "api_name": "lib.errors.RelaxError", "line_number": 34, "usage_type": "call" }, { "api_name": "pipe_control.mol_res_spin.spin_loop", "line_number": 97, "usage_type": "call" ...
14843783049
# -*- coding:utf-8 -*- import logging from flask import ( render_template, request, url_for, redirect, abort, current_app ) from sqlalchemy import extract, func, desc from flask_login import current_user from ..models import Blog, User, Tag, Comment from . import main from .. import db @main.route('/') def inde...
chris5641/EZBlog
app/main/views.py
views.py
py
2,783
python
en
code
0
github-code
97
[ { "api_name": "flask.request.args.get", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 17, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 17, "usage_type": "name" }, { "api_name": "models.B...
19889916472
from keras.layers.convolutional import Conv2D from keras.legacy import interfaces import keras.backend as K from keras.engine.base_layer import InputSpec from cnns.nnlib.utils.general_utils import ConvType from cnns.tensorflow.utils import tensor_shape from cnns.nnlib.utils.general_utils import next_power2 import tenso...
adam-dziedzic/bandlimited-cnns
cnns/tensorflow/conv2D_fft.py
conv2D_fft.py
py
13,179
python
en
code
17
github-code
97
[ { "api_name": "tensorflow.transpose", "line_number": 15, "usage_type": "call" }, { "api_name": "tensorflow.transpose", "line_number": 17, "usage_type": "call" }, { "api_name": "cnns.nnlib.utils.general_utils.next_power2", "line_number": 36, "usage_type": "call" }, { ...
11654798893
# -*- coding: utf-8 -*- """ Compare the set3 sims @author: Tom Williams """ import os import matplotlib import matplotlib.pyplot as plt import numpy as np from vars import phangs_folder, output_folder, plot_folder matplotlib.rcParams['mathtext.fontset'] = 'stix' matplotlib.rcParams['font.family'] = 'STIXGeneral' m...
thomaswilliamsastro/phangs_pattern_speeds
sims/plot_sims_set3.py
plot_sims_set3.py
py
2,257
python
en
code
1
github-code
97
[ { "api_name": "matplotlib.rcParams", "line_number": 16, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 17, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 18, "usage_type": "attribute" }, { "api_na...
41944524342
# You are free to use, modify, copy, distribute the code. # Please give a clap on medium, star on github, or share the article if you # like. # Created by Jonas, github.com/jkoendev # Double pendulum on a cart (dpc) simulation code # # This file runs the simulation using python initial value problem solver. # You need...
jkoendev/double-pendulum-on-cart
python/simplified/dpc_simple_simulate.py
dpc_simple_simulate.py
py
3,078
python
en
code
11
github-code
97
[ { "api_name": "numpy.array", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 19, "usage_type": "attribute" }, { "api_name": "numpy.random.uniform", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.random", "li...
43047238691
import logging from typing import Dict, List from yarl import URL logger = logging.getLogger(__name__) def get_manifest( image_url: URL, image_hash: str, protocols: List[str], outbound_urls: List[str] ) -> Dict: manifest = { "version": "0.1.0", "createdAt": "2023-06-26T00:00:00.000000Z", ...
golemfactory/ray-on-golem
ray_on_golem/server/services/golem/manifest.py
manifest.py
py
1,200
python
en
code
1
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "yarl.URL", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number"...
11120193591
# coding=utf-8 import time from six import StringIO from stash.tests.stashtest import StashTestCase class ThreadsTests(StashTestCase): setup_commands = ['BIN_PATH=$STASH_ROOT/tests/system/data:$BIN_PATH'] def test_101(self): """ background thread clears properly """ self.st...
ywangd/stash
tests/system/test_threads.py
test_threads.py
py
1,872
python
en
code
1,864
github-code
97
[ { "api_name": "stash.tests.stashtest.StashTestCase", "line_number": 9, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 18, "usage_type": "call" }, { "api_name": "six.StringIO", "line_number": 28, "usage_type": "call" }, { "api_name": "time.sleep...
41535924100
from pyspark.sql import SparkSession # 创建一个连接 spark = SparkSession.Builder().appName('sql_yang').master('local[*]').enableHiveSupport().getOrCreate() spark.sparkContext.setLogLevel("ERROR") # spark.sql执行的就直接是DataFrame类型了 df1 = spark.sql("show tables") spark.sql("set hive.exec.dynamic.partition.mode = nonstrict") spa...
yanglinlong6/importexceldata
sparkData/sparkTest02.py
sparkTest02.py
py
1,027
python
en
code
0
github-code
97
[ { "api_name": "pyspark.sql.SparkSession.Builder", "line_number": 4, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 4, "usage_type": "name" } ]
8574194747
#!/usr/bin/env python # -*- encoding:utf-8 -*- import redis import sqlite3 import time import commands #productList = [ # "hundred", # "hb", # "reward", # "notice", # "public", # "linkface", # "api", # ...
zhiwu88/CodisOP
CodisCenter/check.py
check.py
py
1,359
python
en
code
2
github-code
97
[ { "api_name": "sqlite3.connect", "line_number": 32, "usage_type": "call" }, { "api_name": "redis.Redis", "line_number": 42, "usage_type": "call" }, { "api_name": "commands.getoutput", "line_number": 45, "usage_type": "call" }, { "api_name": "time.strftime", "l...
37357477163
from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_bower import Bower import os, sqlite3 db = SQLAlchemy() bower = Bower() def create_app(config=None): app = Flask(__name__) if config is not None: app.config.from_object(config) db.init_app(app) app.engine = db.create...
quinnajames/feature_requester
feature_requester/__init__.py
__init__.py
py
853
python
en
code
0
github-code
97
[ { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_bower.Bower", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_bower.B...
10651127525
from flask import Flask, request from flask_restful import Resource, Api import irohaSDK import irohaBUY import binascii import os from iroha import IrohaCrypto app = Flask(__name__) api = Api(app) @app.route('/') def hello_world(): return 'Hello, World!' class ValidateUser(Resource): def post(self): ...
rietesh/MusicChain
flask/rest_api.py
rest_api.py
py
3,030
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_restful.Api", "line_number": 10, "usage_type": "call" }, { "api_name": "flask_restful.Resource", "line_number": 18, "usage_type": "name" }, { "api_name": "flask.request.for...
42927108752
import time, re, sys, os, tempfile, subprocess, threading, queue, json from typing import Callable, Generator, Optional, Dict, Any, List, Union from . import manager, domain, utils import zmq import ast class DialogueSystem: def __init__(self, domain_file: Optional[str]=None): self.config = domain.DomainC...
NorskRegnesentral/GraphDial
graphdial/system.py
system.py
py
3,176
python
en
code
1
github-code
97
[ { "api_name": "typing.Optional", "line_number": 9, "usage_type": "name" }, { "api_name": "threading.Thread", "line_number": 13, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 15, "usage_type": "call" }, { "api_name": "queue.Queue", "l...
31072569192
''' Author: Elite_zhangjunjie CreateDate: LastEditors: Elite_zhangjunjie LastEditTime: 2022-05-10 13:35:46 Description: 基于list实现的Pose类,主要实现打印和调试中角度和弧度的显示,以及求逆和乘 ''' import math from typing import Any, SupportsIndex, overload from others.ElitePoseCali import pose_inv, pose_mul class Pose(list): MAX_BITS = 6 ...
JunJie-zhang-o/eliterobot
others/pose.py
pose.py
py
2,361
python
en
code
9
github-code
97
[ { "api_name": "typing.overload", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.overload", "line_number": 25, "usage_type": "name" }, { "api_name": "math.radians", "line_number": 43, "usage_type": "call" }, { "api_name": "math.degrees", "line...
4092918367
from flask import Flask, render_template, request, jsonify, redirect, url_for from flask_sqlalchemy import SQLAlchemy from flask_bootstrap import Bootstrap app = Flask(__name__) app.secret_key = 'K705k705' app.app_context().push() app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///vins.db' app.config['SQLALCHEMY_TRACK...
tsiarmila/vin_generator
main.py
main.py
py
4,013
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 10, "usage_type": "call" }, { "api_name": "flask_bootstrap.Bootstrap", "line_number": 11, "usage_type": "call" }, { "api_name": "flas...
32988446366
import time import torch import torch.nn.functional as F from torch import tensor from torch.optim import Adam from utils.ppr_utils import select_from_csr device = torch.device("cuda" if torch.cuda.is_available() else "cpu") def index_to_mask(index, size): mask = torch.zeros(size, dtype=torch.bool, device=inde...
juliechoi12/pprgat
train_evaluate.py
train_evaluate.py
py
6,152
python
en
code
4
github-code
97
[ { "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.zeros", ...
21398578679
#!/usr/bin/env python # -*- coding: utf-8 -*- import webapp2 class MainPage(webapp2.RequestHandler): def get(self): self.response.headers['Content-Type'] = 'text/html; charset=UTF-8' self.response.write('こんにちは!') app = webapp2.WSGIApplication([ ('/', MainPage), ], debug=True)
step17/hw6-sol
python/main.py
main.py
py
317
python
en
code
3
github-code
97
[ { "api_name": "webapp2.RequestHandler", "line_number": 7, "usage_type": "attribute" }, { "api_name": "webapp2.WSGIApplication", "line_number": 12, "usage_type": "call" } ]
773692318
from typing import Dict, List, Tuple from pyramid.authorization import Allow from pyramid.view import view_config from snovault import collection, load_schema from snovault.types.access_key import ( AccessKey as SnovaultAccessKey, access_key_add as sno_access_key_add, access_key_reset_secret as sno_access_...
smaht-dac/smaht-portal
src/encoded/types/access_key.py
access_key.py
py
2,273
python
en
code
2
github-code
97
[ { "api_name": "base.Item", "line_number": 29, "usage_type": "name" }, { "api_name": "snovault.types.access_key.AccessKey", "line_number": 29, "usage_type": "name" }, { "api_name": "snovault.load_schema", "line_number": 33, "usage_type": "call" }, { "api_name": "py...
25667649027
# -*- coding: utf-8 -*- __author__ = 'baitaluk' import requests import cairosvg from influxdb import InfluxDBClient from pymemcache.client.base import Client from config.config import * options = getoptions() class MSvgRadarCacher: """ Retrieve SVG content for asns from asrank-v2 api and add the...
michaelbait/TempProject
data-input/asrank_utils/mc_util/ASSvgRadarCacher.py
ASSvgRadarCacher.py
py
3,705
python
en
code
0
github-code
97
[ { "api_name": "influxdb.InfluxDBClient", "line_number": 39, "usage_type": "call" }, { "api_name": "pymemcache.client.base.Client", "line_number": 48, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 77, "usage_type": "call" }, { "api_name": "re...
18483756628
# Dictionary of sncosmo CCSN model names and their corresponding SN sub-type ccSubClassDict = { 'ii':{ 'snana-2007ms':'IIP', # sdss017458 (Ic in SNANA) 'snana-2004hx':'IIP', # sdss000018 PSNID 'snana-2005gi':'IIP', # sdss003818 PSNID ...
srodney/medband
medband_classtest.py
medband_classtest.py
py
41,429
python
en
code
0
github-code
97
[ { "api_name": "numpy.array", "line_number": 104, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 105, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 106, "usage_type": "call" }, { "api_name": "numpy.where", "line_number...
71189277439
from flask import request, render_template, redirect from app.pagination_util.pagination import Pagination, get_page_args, get_page_args_for_reviews from app.database.db_utils import * from app.app import app from app.utils import get_products, get_page_reviews # INDEX @app.route("/", methods=["GET"]) def index():...
DeAndreFuentes/Flaskinventorymaster
inventory_manager/app/routes/routes.py
routes.py
py
4,953
python
en
code
0
github-code
97
[ { "api_name": "flask.render_template", "line_number": 14, "usage_type": "call" }, { "api_name": "app.app.app.route", "line_number": 12, "usage_type": "call" }, { "api_name": "app.app.app", "line_number": 12, "usage_type": "name" }, { "api_name": "flask.request.for...
71478534398
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Read raw text dumps from http://data.statmt.org/ngrams/raw/ and prints url and number of bytes """ import sys from collections import defaultdict buf = defaultdict(int) domain = None for line in sys.stdin: d, lang, n = line.split() n = int(n) if domain !...
christianbuck/mtma_bitext
baseline/accumulate_lang_stats.py
accumulate_lang_stats.py
py
554
python
en
code
7
github-code
97
[ { "api_name": "collections.defaultdict", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sys.stdout.write", "line_number": 20, "usage_type": "call" }, { "api_name": "sys.stdout", ...
18641465871
import subprocess import tkinter as tk from tkinter import filedialog, Entry, Label import shutil from tkinter import * from PIL import Image, ImageTk # Create the main root window root = tk.Tk() root.geometry("800x600") # Set the size of the interface to 800x600 root.title("File Selector") # Set the title of the wi...
Xavi007/Tracking-Person-Using-Intelligent-Surveillance-CCTV-
GUI.py
GUI.py
py
5,809
python
en
code
1
github-code
97
[ { "api_name": "tkinter.Tk", "line_number": 9, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 26, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 26, "usage_type": "name" }, { "api_name": "PIL.Image.ANTIALIAS", "line_nu...
23490150563
import utils import config import pandas as pd import re import os import sys import argparse import logging from sklearn.model_selection import train_test_split from torch.utils.data import DataLoader import torch import esm def get_embeds(df, dataset): ''' input: dataframe (e.g. ../example/dataset/train.cs...
wlin16/VariPred
VariPred/main.py
main.py
py
7,123
python
en
code
7
github-code
97
[ { "api_name": "esm.pretrained.esm1b_t33_650M_UR50S", "line_number": 23, "usage_type": "call" }, { "api_name": "esm.pretrained", "line_number": 23, "usage_type": "attribute" }, { "api_name": "utils.df_process", "line_number": 30, "usage_type": "call" }, { "api_name...
70039910079
#Para usar graficos, precisei baixar a biblioteca matplotlib. Para isso basta executar no CMD #pip install -U matplotlib import pandas as pd import matplotlib.pyplot as plt import os for f in os.listdir("C:\workspace\Analise de dados com Python e Pandas\Arquivos"): print(f) df1 = pd.read_excel("C:\workspace\Anali...
AdrianaAndrade2203/Analise-de-dados-com-Python-e-Pandas
Aula4_Pandas_Visualizacao_de_Dados.py
Aula4_Pandas_Visualizacao_de_Dados.py
py
3,649
python
pt
code
0
github-code
97
[ { "api_name": "os.listdir", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.read_excel", ...
32464566257
"""The (robust) aggregations of our paper. """ import logging import math import os import socket from typing import Callable, Optional, Tuple import numba import numpy as np import torch import torch.nn.functional as F from torch.utils.checkpoint import checkpoint from torch.utils.cpp_extension import load import to...
sigeisler/robustness_of_gnns_at_scale
rgnn_at_scale/aggregation.py
aggregation.py
py
22,700
python
en
code
23
github-code
97
[ { "api_name": "os.path.join", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "socket.gethostname", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.__version__", ...
23507533381
from rich.console import Group from rich.panel import Panel from rich.table import Table from app.model.schema import TxDataDetail class TxDetailInfo: def __init__(self, tx_detail: TxDataDetail) -> None: self.tx_detail = tx_detail def __str__(self) -> str: return str(self.tx_detail) def...
BoostryJP/ibet-Prime
cmd/explorer/src/gui/rendarable/tx_detail_info.py
tx_detail_info.py
py
2,069
python
en
code
11
github-code
97
[ { "api_name": "app.model.schema.TxDataDetail", "line_number": 9, "usage_type": "name" }, { "api_name": "rich.table.Table", "line_number": 16, "usage_type": "call" }, { "api_name": "rich.table.Table", "line_number": 30, "usage_type": "call" }, { "api_name": "rich.t...
13684694376
import argparse import re parser = argparse.ArgumentParser() ## Required parameters parser.add_argument("--raw", default='metrics/ref-raw.txt', type=str, help="The raw corpus.") parser.add_argument("--clean", default='metrics/tst-clean.t...
shengtaihuang/nlp2021
acmlm/rawgen2clean.py
rawgen2clean.py
py
908
python
en
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 4, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 25, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 26, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 27, ...
72634208320
import random import numpy as np import torch from torchvision import transforms as T from torchvision.transforms import functional as F from torch import Tensor from typing import List, Tuple, Any, Optional def pad_if_smaller(img, size, fill=0): min_size = min([img.shape[1], img.shape[2]]) if min_size < si...
ethz-asl/railway-anomaly-detection
patch_classification/transforms.py
transforms.py
py
8,472
python
en
code
4
github-code
97
[ { "api_name": "torchvision.transforms.functional.pad", "line_number": 18, "usage_type": "call" }, { "api_name": "torchvision.transforms.functional", "line_number": 18, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 40, "usage_type": "call" }, {...
973753049
import os import cv2 import sys import time import json import pprint import random import pickle import pandas as pd import numpy as np from pathlib import Path from keras.layers import Input from keras.models import Model from tqdm import tqdm from . import rpn from faster_rcnn.rpn import * from faster_rcnn.util...
Swedish-Rock-Art-Research-Archives/rock-art-radnet
faster_rcnn/RADNet.py
RADNet.py
py
19,847
python
en
code
3
github-code
97
[ { "api_name": "cv2.resize", "line_number": 72, "usage_type": "call" }, { "api_name": "cv2.INTER_CUBIC", "line_number": 72, "usage_type": "attribute" }, { "api_name": "numpy.float32", "line_number": 84, "usage_type": "attribute" }, { "api_name": "numpy.expand_dims"...
20086076611
import pandas as pd from sklearn.model_selection import TimeSeriesSplit import glob ##https://www.relataly.com/stock-market-prediction-with-multivariate-time-series-in-python/1815/#h-univariate-vs-multivariate-time-series ##df = pd.read_csv("reddit_classified_split.csv") file_list = glob.glob("stock_dfs/*.csv") st...
spencerstok/final_project_ml
ML.py
ML.py
py
2,140
python
en
code
0
github-code
97
[ { "api_name": "glob.glob", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.model_selection.TimeSeriesSplit", "line_number": 38, "usage_type": "call" } ]
9281021760
from email import message_from_string from email.Header import Header from urllib import quote from AccessControl import ModuleSecurityInfo from Acquisition import aq_get from DateTime import DateTime from Products.CMFCore.utils import getToolByName from Products.CMFPlone.utils import safe_unicode from Products.Five.b...
intranett/intranett
src/intranett.policy/intranett/policy/browser/invitation.py
invitation.py
py
2,242
python
en
code
11
github-code
97
[ { "api_name": "zope.publisher.browser.BrowserView", "line_number": 14, "usage_type": "name" }, { "api_name": "Products.Five.browser.pagetemplatefile.ViewPageTemplateFile", "line_number": 16, "usage_type": "call" }, { "api_name": "Products.CMFCore.utils.getToolByName", "line_n...
22979795691
# -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt5 (Qt v5.15.2) # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore qt_resource_data = b"\ \x00\x02\x42\x40\ \xff\ \xd8\xff\xe1\x0e\x3b\x45\x78\x69\x66\x00\x00\x4d\x4d\x00\x2a\x00\ ...
niroth81/target_controller
resources_rc.py
resources_rc.py
py
1,129,221
python
ja
code
0
github-code
97
[ { "api_name": "PyQt5.QtCore.qVersion", "line_number": 16878, "usage_type": "call" }, { "api_name": "PyQt5.QtCore", "line_number": 16878, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.qRegisterResourceData", "line_number": 16887, "usage_type": "call" }, { "ap...
42635243711
from selenium.webdriver.common.by import By class BasePageLocators(object): ETSY_LOGO = (By.XPATH, "//span[contains(@class, 'etsy-icon') and @id='logo']") class SearchPageLocators(object): SEARCH_TEXTBOX = (By.XPATH, "//input[@data-id='search-query' and @name='search_query']") SEARCH_BUTTON = (By.XPATH, "...
JohnMart/selenium_python
common/locators.py
locators.py
py
568
python
en
code
0
github-code
97
[ { "api_name": "selenium.webdriver.common.by.By.XPATH", "line_number": 4, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.common.by.By", "line_number": 4, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.XPATH", "line_number": 7, "usage...
8588801411
#!/bin/env python import os import logging import shrub logging.basicConfig(level=logging.INFO) ################# XXX update these env accordingly XXX ############# target_name = 'cpu' network = 'mobilenet' useLayout = 'NCHW' # useLayout = 'NHWC' dtype = 'float32' useCores = 4 bigLITTLE = 1 ######################...
zhenhuaw-me/shrub
misc/tvm-workflow.py
tvm-workflow.py
py
906
python
en
code
1
github-code
97
[ { "api_name": "logging.basicConfig", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 7, "usage_type": "attribute" }, { "api_name": "shrub.tvm.TargetProvider", "line_number": 22, "usage_type": "call" }, { "api_name": "shrub.tv...
26328799964
"""Handle parsing and providing pipette information.""" import re from typing import Dict, Tuple import struct from opentrons_shared_data.errors.exceptions import ( InvalidInstrumentData, PythonException, ) from opentrons_hardware.firmware_bindings.constants import PipetteName from opentrons_hardware.instrument...
Opentrons/opentrons
hardware/opentrons_hardware/instruments/pipettes/serials.py
serials.py
py
3,601
python
en
code
363
github-code
97
[ { "api_name": "re.compile", "line_number": 25, "usage_type": "call" }, { "api_name": "typing.Dict", "line_number": 27, "usage_type": "name" }, { "api_name": "opentrons_hardware.firmware_bindings.constants.PipetteName", "line_number": 27, "usage_type": "name" }, { ...
74145845440
"""Filters collection for gleitzsch.""" import sys import random import numpy as np from skimage import exposure from skimage import transform as tf from skimage import filters from skimage import color from skimage.draw import polygon # from modules.blur_detection import detect_blur def eprint(line, end="\n"): "...
kirilenkobm/gleitzsch
modules/filters.py
filters.py
py
13,002
python
en
code
4
github-code
97
[ { "api_name": "sys.stderr.write", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.percentile", "line_number": 25, "usage_type": "call" }, { "api_name": "skimage.exposure.re...
38860361338
import os import time import wandb import torch import envpool import numpy as np import torch.optim as optim from util.env_wrappers import VecAdapter from stable_baselines3.common.vec_env import VecMonitor from stable_baselines3.common.evaluation import evaluate_policy def lerp(start, end, weight): return start ...
warner-benjamin/reinforcement_scratch
util/helpers.py
helpers.py
py
2,800
python
en
code
0
github-code
97
[ { "api_name": "os.sched_getaffinity", "line_number": 19, "usage_type": "call" }, { "api_name": "os.cpu_count", "line_number": 21, "usage_type": "call" }, { "api_name": "envpool.make", "line_number": 29, "usage_type": "call" }, { "api_name": "util.env_wrappers.VecA...
2896083573
import evdev from evdev import InputDevice, categorize, ecodes class File(object): def __init__(self, path): self.path = path def listen(self): with open(self.path, 'r') as fp: for line in fp.readlines(): yield line.strip() # Provided as an example taken from my own keyboard attached t...
snacker-tracker/scanner
snacker_tracker/scanner/input.py
input.py
py
2,727
python
en
code
0
github-code
97
[ { "api_name": "evdev.InputDevice", "line_number": 41, "usage_type": "call" }, { "api_name": "evdev.ecodes.EV_KEY", "line_number": 49, "usage_type": "attribute" }, { "api_name": "evdev.ecodes", "line_number": 49, "usage_type": "name" }, { "api_name": "evdev.categor...
31502057325
import numpy as np import tensorflow as tf import matplotlib.pyplot as plt import matplotlib.patches as patches def image_to_np_array(image): (im_width, im_height) = image.size return np.array(image.getdata()).reshape((im_height, im_width, 3)).astype(np.uint8) def load_model_to_session(sess, pb_model_path)...
sddongxh/tensorflow-object-detection-api-minimal-example
utils.py
utils.py
py
2,841
python
en
code
0
github-code
97
[ { "api_name": "numpy.array", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 10, "usage_type": "attribute" }, { "api_name": "tensorflow.gfile.GFile", "line_number": 15, "usage_type": "call" }, { "api_name": "tensorflow.gfile"...
28686480007
"""Provide functions to modify model components.""" from ast import NodeTransformer from itertools import chain from typing import TYPE_CHECKING, Dict from ..core.gene import ast2str from .delete import get_compiled_gene_reaction_rules if TYPE_CHECKING: from cobra import Gene, Model # Set of tuples of operator...
ekaradag-py/TitanicTest
Collage/env/Lib/site-packages/cobra/manipulation/modify.py
modify.py
py
5,335
python
en
code
0
github-code
97
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 11, "usage_type": "name" }, { "api_name": "ast.NodeTransformer", "line_number": 58, "usage_type": "name" }, { "api_name": "itertools.chain", "line_number": 88, "usage_type": "call" }, { "api_name": "delete.get_c...
29124976991
import json import re import pytz import discord import requests import utils.global_variables as gv from loguru import logger from bs4 import BeautifulSoup from datetime import datetime from discord.ext.commands import Bot from discord.ext import tasks, commands class ThreadTasks(commands.Cog): def __init__(self...
Sayary-NULL/CoffeeOwlBot
script/ThreadTasks.py
ThreadTasks.py
py
4,389
python
en
code
0
github-code
97
[ { "api_name": "discord.ext.commands.Cog", "line_number": 14, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 14, "usage_type": "name" }, { "api_name": "discord.ext.commands.Bot", "line_number": 17, "usage_type": "name" }, { "api_n...
29516751241
import logging import os import sys from collections import namedtuple import dill import numpy as np import tensorflow as tf from dgm4nlp.annealing import AnnealingSchedule from dgm4nlp.nlputils import AERSufficientStatistics from dgm4nlp.nlputils import Multitext from dgm4nlp.nlputils import class_distribution from...
uva-slpl/embedalign
embedalign/trainer.py
trainer.py
py
19,453
python
en
code
4
github-code
97
[ { "api_name": "embedalign.model.EmbedAlignModel", "line_number": 31, "usage_type": "name" }, { "api_name": "tensorflow.train.RMSPropOptimizer", "line_number": 41, "usage_type": "call" }, { "api_name": "tensorflow.train", "line_number": 41, "usage_type": "attribute" }, ...
74989263040
from typing import List import time class Solution: def arrayStringsAreEqual(self, word1: List[str], word2: List[str]) -> bool: def listToString(s): # initialize an empty string str1 = "" # traverse in the string for ele in s: str1 += ele ...
Fawazk/Python-problems
leetcode-problems/Array/leetcode.com-problems-check-if-two-string-arrays-are-equivalent.py
leetcode.com-problems-check-if-two-string-arrays-are-equivalent.py
py
1,076
python
en
code
1
github-code
97
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "time.time", "line_number": 31, "usage_type": "call" }, { "api_name": "time.time", "line_number": 42, "usage_type": "call" } ]
25458361727
from django.urls import path from blogs import views app_name = 'blogs' urlpatterns = [ path('', views.home_page), path('post/<slug:slug>', views.PostView.as_view(), name='post'), path('featured/', views.FeaturedListView.as_view(), name='featured'), path('category/<slug:slug>', views.CategoryListVie...
CodeSwallow/django-blog
blogs/urls.py
urls.py
py
424
python
en
code
1
github-code
97
[ { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "blogs.views.home_page", "line_number": 9, "usage_type": "attribute" }, { "api_name": "blogs.views", "line_number": 9, "usage_type": "name" }, { "api_name": "django.urls.path...
40451367214
from easydict import EasyDict as edict from mindspore.train.model import Model from mindspore.train import amp from mindspore.train.amp import _config_level from mindspore.common import dtype as mstype from mindspore.nn.wrap.cell_wrapper import _VirtualDatasetCell from mindspore.parallel._utils import _get_parallel_mo...
mindspore-ai/mindarmour
mindarmour/privacy/diff_privacy/train/model.py
model.py
py
31,682
python
en
code
88
github-code
97
[ { "api_name": "mindarmour.utils.logger.LogUtil.get_instance", "line_number": 37, "usage_type": "call" }, { "api_name": "mindarmour.utils.logger.LogUtil", "line_number": 37, "usage_type": "name" }, { "api_name": "mindspore.ops.composite.MultitypeFuncGraph", "line_number": 40, ...
70790857600
import cv2 import numpy as np from matplotlib import pyplot as plt import pandas as pd import PIL.Image as pilimg image = cv2.imread('../data/vision2/test_dirty_mnist_2nd/50001.png', cv2.IMREAD_GRAYSCALE) pix = np.array(image) # 이미지 전처리 ------------------------------------- #254보다 작고 0이아니면 0으로 만들어주기 x_df2 = np.w...
bughunt88/AI_Study
vision2/dacon_img_show1.py
dacon_img_show1.py
py
1,094
python
ko
code
4
github-code
97
[ { "api_name": "cv2.imread", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.IMREAD_GRAYSCALE", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.where", "l...
7887192928
from flask import Flask, jsonify, request from constants import GEOCODING_API_ENDPOINT, FORECAST_API_ENDPOINT, API_KEY from mock import DIRECT_GEOCODING, FORECAST import requests app = Flask(__name__) @app.route('/city/coordinates/<city_name>', methods=['GET']) def get_coordinates(city_name): url = f"{GEOCODING...
suramdivya22/weather-forecast
server/main.py
main.py
py
1,394
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "constants.GEOCODING_API_ENDPOINT", "line_number": 12, "usage_type": "name" }, { "api_name": "constants.API_KEY", "line_number": 12, "usage_type": "name" }, { "api_name": "request...
41865599698
import matplotlib.pyplot as plt a = input("Escribe el numero de personas que usan vehiculo: \n") A = int(a) while A < 0: print("¡Ha escrito un número negativo! Inténtelo de nuevo") a = input("Escribe el numero de personas que usan vehiculo: \n") A = int(a) b = input("Escribe el numero de person...
rulgamer03/Python-Projects
Grafica circular.py
Grafica circular.py
py
1,559
python
es
code
1
github-code
97
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 43, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 43, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.title", "line_number": 48, "usage_type": "call" }, { "api_name": "...
10386377775
#!/usr/bin/python3 """Onion Omega2 port of RPi powerbank using bq25895 https://github.com/tjohn327/raspberry_pi_ups/blob/master/src/powerpi.py """ from OmegaExpansion import onionI2C import time import sys import logging print("Loaded I2C Libraries") class PowerOmega: PORT = 0 ADDRESS = 0x6A #I2C addres...
whatnick/Onion_Feather
software/bq25895.py
bq25895.py
py
6,839
python
en
code
1
github-code
97
[ { "api_name": "OmegaExpansion.onionI2C.OnionI2C", "line_number": 57, "usage_type": "call" }, { "api_name": "OmegaExpansion.onionI2C", "line_number": 57, "usage_type": "name" }, { "api_name": "logging.info", "line_number": 63, "usage_type": "call" }, { "api_name": ...
30127865396
import pytest import numpy as np import torch from flambe.dataset import TabularDataset from flambe.field import Field, TextField, LabelField @pytest.fixture def train_dataset(): """Dummy dataset from file""" return TabularDataset.from_path('tests/data/dummy_tabular/train.csv', sep=',') @pytest.fixture def ...
codeaudit/flambe
tests/unit/dataset/test_tabular.py
test_tabular.py
py
12,637
python
en
code
null
github-code
97
[ { "api_name": "flambe.dataset.TabularDataset.from_path", "line_number": 11, "usage_type": "call" }, { "api_name": "flambe.dataset.TabularDataset", "line_number": 11, "usage_type": "name" }, { "api_name": "pytest.fixture", "line_number": 8, "usage_type": "attribute" }, ...
22643400385
# SVM法で分離直線を求める import numpy as np from matplotlib import pyplot as plt #データを用意 xx = np.array([ [1, 2], [2, 4], [3, 4], [2, 1], [4, 2], [4, 3], ]) y = np.array([-1, -1, -1, 1, 1, 1]) # 最適方向ベクトルを計算する nn = 6 coef = np.empty([nn, nn]) for i in range(nn-1): for j in range(nn): if i==j: coef[i,j] =...
IwaoFujino/DMandML
DMandML/ch8ex1.py
ch8ex1.py
py
1,562
python
en
code
1
github-code
97
[ { "api_name": "numpy.array", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 22,...
8078026905
from data.nvPrivate import * # from utils.augmentations import SSDAugmentation from layers.modules.multibox_loss_blaze import BlazeMultiBoxLoss # from ssd import build_ssd from blazeface import build_blazeface from data.config import celeba import os import sys import time import torch from torch.autograd import Varia...
nszjh/ssd_blazeface.pytorch
train.py
train.py
py
12,156
python
en
code
4
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 60, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 60, "usage_type": "attribute" }, { "api_name": "torch...
10544912881
from collections import deque N,M,K = map(int,input().split()) li = [list(input()) for _ in range(N)] x1,y1,x2,y2 = map(int,input().split()) x1,y1,x2,y2 = x1-1, y1-1, x2-1, y2-1 que = deque() que.append((x1,y1)) # i, j check = [[-1] * M for _ in range(N)] check[x1][y1] = 0 di,dj=(1,-1,0,0),(0,0,1,-1) while que: ...
soulchicken/AlgorithmSolved
백준/플래티넘3/16930_달리기.py
16930_달리기.py
py
864
python
en
code
0
github-code
97
[ { "api_name": "collections.deque", "line_number": 7, "usage_type": "call" } ]
23951114382
# -*- coding: utf-8 -*- import os,json import numpy as np import pandas as pd import torch import argparse from torch.utils.data import Dataset, DataLoader # Importing the T5 modules from huggingface/transformers from transformers import T5Tokenizer , AutoConfig from transformers.generation import utils from rich.table...
alibaba/EasyNLP
examples/mta/train.py
train.py
py
12,044
python
en
code
1,835
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 25, "usage_type": "call" }, { "api_name": "rich.console.Console", "line_number": 73, "usage_type": "call" }, { "api_name": "rich.console.Console", "line_number": 79, "usage_type": "call" }, { "api_name": "ric...
37831552008
import sys import numpy as np import pytest from astropy import units as u from astropy.io.ascii import read from astropy.table import setdiff from diskchef.physics.parametrized import powerlawpiece, PieceWisePowerLaw, PowerLawPhysics @pytest.mark.parametrize( "input", [ [1 * u.au, 1 * u.s, 1, 1], ...
rfranceschi/diskchef
diskchef/tests/physics/test_parametrized.py
test_parametrized.py
py
1,280
python
en
code
0
github-code
97
[ { "api_name": "pytest.raises", "line_number": 23, "usage_type": "call" }, { "api_name": "astropy.units.core", "line_number": 23, "usage_type": "attribute" }, { "api_name": "astropy.units", "line_number": 23, "usage_type": "name" }, { "api_name": "diskchef.physics....
40702922597
from channels.routing import route_class from channels.generic.websockets import JsonWebsocketConsumer import random from stroopapp.models import Constants class TaskTracker(JsonWebsocketConsumer): url_pattern = (r'^/tasktracker/(?P<player>[0-9]+)$') def prepare_task(self): color_text, color_color = ...
chapkovski/stroop_test
stroopapp/otree_extensions/routing.py
routing.py
py
808
python
en
code
0
github-code
97
[ { "api_name": "channels.generic.websockets.JsonWebsocketConsumer", "line_number": 7, "usage_type": "name" }, { "api_name": "random.sample", "line_number": 11, "usage_type": "call" }, { "api_name": "stroopapp.models.Constants.colors", "line_number": 11, "usage_type": "attr...
1876070501
import streamlit as st from pipeline import * # from PIL import Image from PIL import Image import numpy as np model = MelanomaDetection() def display_predicted_image(json_value, image_path): image = Image.open(image_path) image_array = np.array(image) for obj in json_value['objectsDetec...
samrocks03/MelanomaDetection
app.py
app.py
py
3,777
python
en
code
1
github-code
97
[ { "api_name": "PIL.Image.open", "line_number": 12, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 12, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "streamlit.image", "line_numb...
11606287346
# Her bir grup verisi normal dağılım göstermeli ya da n >= 30 # Normal dağılım sağlanıyorsa One Way F Testi, sağlanmıyorsa Welch's Anova Testi ya da Kruskal Testi kullanılabilir. # Anova testi sonucunda anlamlı farklılık çıkarsa, farklılığın hangi gruplar arasında olduğunu test etmek için Post Hoc Analizi uygulanır....
htcSnmz/statistics_and_probability
one_way_anova.py
one_way_anova.py
py
6,704
python
tr
code
0
github-code
97
[ { "api_name": "scipy.stats.f_oneway", "line_number": 16, "usage_type": "call" }, { "api_name": "scipy.stats", "line_number": 16, "usage_type": "name" }, { "api_name": "pandas.read_excel", "line_number": 22, "usage_type": "call" }, { "api_name": "scipy.stats.shapir...
41262125176
from discord import SyncWebhook from selenium import webdriver from bs4 import BeautifulSoup import params_file import datetime import time import chromedriver_autoinstaller chromedriver_autoinstaller.install() finished = False webhook = SyncWebhook.from_url(params_file.discord_webhook) print("Getting webpage resul...
rgcam/RyansWebScrapes
MicrosoftJobAlertScraper/SeleniumScraper.py
SeleniumScraper.py
py
1,943
python
en
code
1
github-code
97
[ { "api_name": "chromedriver_autoinstaller.install", "line_number": 9, "usage_type": "call" }, { "api_name": "discord.SyncWebhook.from_url", "line_number": 12, "usage_type": "call" }, { "api_name": "discord.SyncWebhook", "line_number": 12, "usage_type": "name" }, { ...
1374259075
#!/usr/local/bin/python3 # coding:utf-8 import pymysql import time from datetime import date from datetime import timedelta from log import logger class MysqlWxfc: def openDB(self, ip='localhost', username='root', password='333', db='wxfc'): db = pymysql.connect(ip, username, password, db, charset='utf8')...
everseeker0307/spider-wxfc
src/MysqlWxfc.py
MysqlWxfc.py
py
4,880
python
en
code
1
github-code
97
[ { "api_name": "pymysql.connect", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 30, "usage_type": "argument" }, { "api_name": "datetime.date", "line_number": 43, "usage_type": "call" }, { "api_name": "datetime.timedelta", ...
74206953278
''' João Pedro L. Affonso Date: 17/02/22 Full registration.py/step ca client, capable of generating, renewing and revoking certificate, as well as logging the steps for later analysis. ''' #sys import sys sys.path.insert(2, "C:\\path_to_your_telegram_variables") # Telethon from variables import api_id, api_hash #my i...
joaopedrolourencoaffonso/python_smallstep
9-version/certificate.py
certificate.py
py
7,488
python
en
code
4
github-code
97
[ { "api_name": "sys.path.insert", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.INFO", "l...
31439175886
from textwrap import dedent from docx import Document from docx.oxml import OxmlElement, parse_xml from docx.table import _Cell from docx.enum.table import WD_TABLE_ALIGNMENT, WD_CELL_VERTICAL_ALIGNMENT, WD_ROW_HEIGHT_RULE from docx.enum.text import WD_PARAGRAPH_ALIGNMENT, WD_TAB_ALIGNMENT from docx.shared import Pt, ...
djeck1432/python_doc
main.py
main.py
py
31,474
python
en
code
0
github-code
97
[ { "api_name": "docx.oxml.OxmlElement", "line_number": 33, "usage_type": "call" }, { "api_name": "docx.oxml.ns.qn", "line_number": 43, "usage_type": "call" }, { "api_name": "docx.oxml.OxmlElement", "line_number": 45, "usage_type": "call" }, { "api_name": "docx.oxml...
26180758539
############################################################################### # gsfa_nodes: This module implements the Graph-Based SFA Node (GSFANode) and # # the Information-Preserving GSFA Node (iGSFANode). This file belongs to the # # Cuicuilco framework # ...
AlbertoEsc/cuicuilco
gsfa_nodes.py
gsfa_nodes.py
py
101,340
python
en
code
8
github-code
97
[ { "api_name": "mdp.nodes", "line_number": 41, "usage_type": "attribute" }, { "api_name": "numpy.argsort", "line_number": 136, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 138, "usage_type": "call" }, { "api_name": "numpy.argsort", "line...
40602784581
import json from . import config from . request import request, assert_user_token def get_token(username, password, api_key=None): """ Retrieves user token to be used for authorizing actions. Args: username: str BrickSet registration username or email. password: s...
arturomoncadatorres/brickse
brickse/api_users.py
api_users.py
py
6,493
python
en
code
null
github-code
97
[ { "api_name": "request.request", "line_number": 33, "usage_type": "call" }, { "api_name": "request.request", "line_number": 59, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 136, "usage_type": "call" }, { "api_name": "request.assert_user_token...
5945817236
# Python program to read the NVD CVE downloadable JSON file and parse out only key metrics, # including: CVE ID, Description (i.e Name), Base Score, Severity, and Impact Score import json # Opening JSON file x = open('nvdcve-1.1-modified.json') # Creating output file y = open('nvdcve-converted.txt', 'w') # returns ...
EC-429/NVD-CVE-JSON-Converter
NVDCVE_JSONtoFlat_Converter.py
NVDCVE_JSONtoFlat_Converter.py
py
830
python
en
code
0
github-code
97
[ { "api_name": "json.load", "line_number": 14, "usage_type": "call" } ]
20458098270
import time import feedparser from luma.led_matrix.device import max7219 from luma.core.interface.serial import spi, noop from luma.core.render import canvas from luma.core.virtual import viewport from luma.core.legacy import text, show_message from luma.core.legacy.font import proportional, tolerant, CP437_FONT, TINY...
ozmatox/RSS_MAX7219
RSS_MAX7219.py
RSS_MAX7219.py
py
1,765
python
en
code
0
github-code
97
[ { "api_name": "luma.core.interface.serial.spi", "line_number": 14, "usage_type": "call" }, { "api_name": "luma.core.interface.serial.noop", "line_number": 14, "usage_type": "call" }, { "api_name": "luma.led_matrix.device.max7219", "line_number": 15, "usage_type": "call" ...
37515912783
# Larger than Life Cellular Automata # Author: Connor McShaffrey # This is my second (faster) implementation of the Larger than Life cellular automata. # It uses the convolution function from scipy.signal to count the number of neighbors # of each cell. This is much faster than my first implementation, which use...
cmcshaff/Larger-than-Life
LtL2.py
LtL2.py
py
1,935
python
en
code
1
github-code
97
[ { "api_name": "numpy.ones", "line_number": 22, "usage_type": "call" }, { "api_name": "scipy.signal.convolve2d", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.logical_and", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.logical_an...
8105615496
import enum from unicodedata import name from piccolo.table import Table from piccolo.table import Readable from piccolo.columns import Varchar,Text,Array,ForeignKey from piccolo.columns.reference import LazyTableReference class QuestionHead(Table): name = Varchar(length=300,null=False) class Questi...
vivekviram123/piccolo_01
piccolo_legal/piccolo_legal/legal/tables.py
tables.py
py
984
python
en
code
0
github-code
97
[ { "api_name": "piccolo.table.Table", "line_number": 11, "usage_type": "name" }, { "api_name": "unicodedata.name", "line_number": 13, "usage_type": "name" }, { "api_name": "piccolo.columns.Varchar", "line_number": 13, "usage_type": "call" }, { "api_name": "piccolo....
18688565162
import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import pickle import torch from tps import TPSGridGen from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F from torch.utils.data import Dataset, DataLoader import torch.optim as optim class MNIS...
XavierXiao/IWAE-with-Transformation
IW-TVAE/IW_TVAE.py
IW_TVAE.py
py
11,884
python
en
code
2
github-code
97
[ { "api_name": "torch.utils.data.Dataset", "line_number": 13, "usage_type": "name" }, { "api_name": "numpy.random.binomial", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 20, "usage_type": "attribute" }, { "api_name": "torc...
36930219086
import os from datetime import datetime from bson import ObjectId, json_util from flask import Flask from flask.json import JSONEncoder import socketio from root.core.views import core from root.globals import db, login_manager, socketio from root.users.views import users from root.button.views import button class ...
smbalf/Flask_MM
root/factory.py
factory.py
py
2,209
python
en
code
0
github-code
97
[ { "api_name": "flask.json.JSONEncoder", "line_number": 15, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "argument" }, { "api_name": "bson.ObjectId", "line_number": 21, "usage_type": "argument" }, { "api_name": "bson.j...
39474972529
""" python plugin for collectd to obtain rabbitmq stats """ import collectd import urllib2 import urllib import json import re RABBIT_API_URL = "http://{host}:{port}/api/" QUEUE_MESSAGE_STATS = ['messages', 'messages_ready', 'messages_unacknowledged'] QUEUE_STATS = ['memory', 'messages', 'consumers'] MESSAGE_STATS =...
blueboxgroup/ursula-monitoring
collectd/plugins/rabbitmq/rabbitmq.py
rabbitmq.py
py
8,599
python
en
code
9
github-code
97
[ { "api_name": "collectd.info", "line_number": 39, "usage_type": "call" }, { "api_name": "collectd.info", "line_number": 41, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 59, "usage_type": "call" }, { "api_name": "collectd.info", "line_numb...
15230909062
import os, multiprocessing PORT = os.getenv("PORT", '7020') HOST = os.getenv("HOST", '0.0.0.0') errorlog = '-' loglevel = 'info' accesslog = '-' access_log_format = '%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"' bind = HOST+":"+PORT workers = multiprocessing.cpu_count() * 2 + 1 threads = 2 * multiproc...
ec2ainun/air
svc/py/code/config.py
config.py
py
340
python
en
code
5
github-code
97
[ { "api_name": "os.getenv", "line_number": 3, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 4, "usage_type": "call" }, { "api_name": "multiprocessing.cpu_count", "line_number": 12, "usage_type": "call" }, { "api_name": "multiprocessing.cpu_count...
185873568
import numpy as np import torch import torchvision from torchvision import transforms import scipy.ndimage import random import cv2 from . import sRGB_funs random.seed(0) class ErodeMask: def __init__(self,mask_erosion_size=(6,6)): self.mask_erosion_size = mask_erosion_size def __call__(self,sample): mask = ...
dlichy/ShapeAndMaterial
datasets/dataset_utils/sample_transforms.py
sample_transforms.py
py
8,953
python
en
code
100
github-code
97
[ { "api_name": "random.seed", "line_number": 10, "usage_type": "call" }, { "api_name": "scipy.ndimage.ndimage.binary_erosion", "line_number": 20, "usage_type": "call" }, { "api_name": "scipy.ndimage.ndimage", "line_number": 20, "usage_type": "attribute" }, { "api_n...
72118455999
import torch.nn as nn ## 20 is the hidden dimension. arbitary choice model = nn.Sequential( nn.Linear(3,20), # 3 for the input features x1,x2,x3 nn.ReLU(), nn.Linear(20,2)) # 2 for the classes print(model)
CZYCW/LearningNotes
ml_profession/intro to dp and nn/nn_beginer.py
nn_beginer.py
py
232
python
en
code
0
github-code
97
[ { "api_name": "torch.nn.Sequential", "line_number": 5, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.nn", "line_number...
13319626407
import requests import tkinter as tk from PIL import Image, ImageTk import io root = tk.Tk() root.title("MeowFacts & CATAAS") fact_label = tk.Label(root, text="Click the button to get a cat fact and image!") fact_label.pack(pady=10) image_label = tk.Label(root) image_label.pack(pady=10) def get_cat_fact(): url ...
cemcorbacioglu/cat-facto
catto.py
catto.py
py
1,643
python
en
code
0
github-code
97
[ { "api_name": "tkinter.Tk", "line_number": 6, "usage_type": "call" }, { "api_name": "tkinter.Label", "line_number": 9, "usage_type": "call" }, { "api_name": "tkinter.Label", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number"...
27607526384
# Приложение проводит логирование своей работы с ротацией лог-файлов # при достижении размера файла 1 мегабайт. # При этом логгируются все полученные запросы и ответы приложения, # информация о добавлении в БД новой записи, либо об изменении существующих. # Также логируются результаты опроса статус кодов сайтов # - зап...
Kaydalova/resource_monitoring
test_task_app/logging_config.py
logging_config.py
py
2,033
python
ru
code
0
github-code
97
[ { "api_name": "logging.Formatter", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.handlers.RotatingFileHandler", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 22, "usage_type": "attribute" }, { "api_nam...
71298201920
import heapq import sys, os, io, atexit input = lambda: sys.stdin.readline().rstrip('\r\n') stdout = io.BytesIO() sys.stdout.write = lambda s: stdout.write(s.encode("ascii")) atexit.register(lambda: os.write(1, stdout.getvalue())) # 221002 9370 미확인 도착지 # 정답코드 def dijkstar(start): queue = [] ...
Bluuubery/Problem_Solving
백준/Gold/9370. 미확인 도착지/미확인 도착지.py
미확인 도착지.py
py
1,560
python
en
code
2
github-code
97
[ { "api_name": "sys.stdin.readline", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 4, "usage_type": "attribute" }, { "api_name": "io.BytesIO", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.stdout", "line_numb...
74144095039
from selenium import webdriver import arrow from time import sleep import os import re import pyautogui as pi from unidecode import unidecode from _comandos_banco import CRUD ar = arrow.now().format('DD/MM/YYYY') key_words = ['TEMPERO','CALDINHO','CONSERVA','TABLETE', 'CONGELADO', 'COZIDO', 'INSTANTANEO', 'LATA', 'PAP...
gustavo24063/Scrap_mysql
scrap/_teste.py
_teste.py
py
2,879
python
en
code
0
github-code
97
[ { "api_name": "arrow.now", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 16, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 16, "usage_type": "name" }, { "api_name": "time.sleep", ...
26180809649
##################################################################################################################### # test_GSFANode: Tests for the Graph-Based SFA Node (GSFANode) as defined by the Cuicuilco framework # # ...
AlbertoEsc/cuicuilco
tests/test_GSFANode.py
test_GSFANode.py
py
10,800
python
en
code
8
github-code
97
[ { "api_name": "numpy.random.normal", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 27, "usage_type": "attribute" }, { "api_name": "numpy.random.normal", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.rando...
12789882011
from django.http import HttpResponse, JsonResponse from django.views.decorators.csrf import csrf_exempt from rest_framework.decorators import api_view from rest_framework.parsers import JSONParser from .models import Person, Resume, Blog, WeekTip from .serializers import PersonSerializer, PersonListSerializer, BlogPost...
synchronizedcontrol/website-naynay
backend/api/naynay/views.py
views.py
py
1,824
python
en
code
0
github-code
97
[ { "api_name": "models.Person.objects.all", "line_number": 14, "usage_type": "call" }, { "api_name": "models.Person.objects", "line_number": 14, "usage_type": "attribute" }, { "api_name": "models.Person", "line_number": 14, "usage_type": "name" }, { "api_name": "se...
24678439267
# # @lc app=leetcode.cn id=1078 lang=python3 # # [1078] Bigram 分词 # from typing import List # @lc code=start class Solution: def findOcurrences(self, text: str, first: str, second: str) -> List[str]: _f = text.split(" ") res = [_f[i+2] for i in range(len(_f)-2) if _f[i] == first and _f[i+1]==second]...
Leaderzhangyi/DailyProblem
每日一题/1078.bigram-分词.py
1078.bigram-分词.py
py
493
python
en
code
1
github-code
97
[ { "api_name": "typing.List", "line_number": 9, "usage_type": "name" } ]
38560716858
# -*- coding: utf-8 -*- # visit http://127.0.0.1:8050/ in your web browser. # Load libraries import dash import dash_bootstrap_components as dbc from dash.dependencies import Input, Output import data_load_and_transformer as dlt import graph_formater as grf import app_layout # Styles - CERULEAN (!), COSMO, CYBORG, D...
zanis-timsans/EduAim-app
app.py
app.py
py
3,422
python
en
code
0
github-code
97
[ { "api_name": "dash_bootstrap_components.themes", "line_number": 15, "usage_type": "attribute" }, { "api_name": "dash.Dash", "line_number": 17, "usage_type": "call" }, { "api_name": "app_layout.layout", "line_number": 23, "usage_type": "call" }, { "api_name": "das...
25325752797
from logging import getLogger import requests from django.conf.urls.static import static from django.utils.translation import ugettext_lazy as _ from bitcaster.exceptions import PluginSendError from bitcaster.utils.language import classproperty from .. import serializers from ..base import (CoreDispatcher, Dispatche...
bitcaster-io/bitcaster
src/bitcaster/dispatchers/handlers/slack_webhook.py
slack_webhook.py
py
2,954
python
en
code
3
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "base.MessageType", "line_number": 18, "usage_type": "name" }, { "api_name": "base.DispatcherOptions", "line_number": 22, "usage_type": "name" }, { "api_name": "django.util...
17529255821
import pandas from sklearn import preprocessing from sklearn.model_selection import train_test_split from sklearn.neighbors import KNeighborsClassifier import numpy # step 1: Create the dataset from reading csv file dataset = pandas.read_csv('Daily_Weather_Observations.csv') # Step 2: create the training data with la...
DajunFeng/UNSW_Study
COMP9418/Topic 2: K Nearest Neighbors/KNN.py
KNN.py
py
1,412
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 18, "usage_type": "call" }, { "api_name": "sklearn.preprocessing", "line_number": 18, "usage_type": "name" }, { "api_name"...
36716810660
"""bench URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/4.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based v...
nay-kang/session-benchmark
python/bench/urls.py
urls.py
py
4,309
python
en
code
0
github-code
97
[ { "api_name": "uuid.uuid4", "line_number": 30, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 33, "usage_type": "call" }, { "api_name": "django.utils.timezone.now", "line_number": 34, "usage_type": "call" }, { "api_name": "django.utils.timezone...
22817607528
from django.urls import path, include from .views import * from .models import * urlpatterns = [ path('categories/', CategoriesListView.as_view(), name='categories'), path('categories/<slug:cat_name>', CategoryView, name='category'), path('create_category/', CreateCategoryView.as_view(), name='createcateg...
Moiseenkomihail/Shop-Articles
app/shop/urls.py
urls.py
py
479
python
en
code
0
github-code
97
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", ...
41572900878
import csv, sqlite3 from datetime import datetime import math ''' this class holds the business logic of the application for biking route we built. We get requests and analyze them. If the database isn't built yet it will be built and then the Database object will calculate different routes by measurments we create...
haiatn/pythonPPL
ass2/mybackend.py
mybackend.py
py
6,663
python
en
code
0
github-code
97
[ { "api_name": "sqlite3.connect", "line_number": 19, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 40, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 54, "usage_type": "call" }, { "api_name": "datetime.datetime.now"...
18934371894
import requests from .models import TestResponse from typing import Union,Dict class Test(): def get(self,url:str,headers:Dict[str,Union[str,int,float,bytes]],encoding:str) -> Union[TestResponse,str]: try: response = requests.get(url=url, headers=headers) response.encoding = encodin...
yangtang-special/PyUniversalKit
PyUniversalKit/Netkit/test.py
test.py
py
966
python
en
code
3
github-code
97
[ { "api_name": "typing.Dict", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 6, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "models.TestResponse", "line_nu...
29275740691
from flask import current_app from sqlalchemy import text from api.models import CodeTableVersioned from api.utils.helpers import find_model_from_table_name class CodeService: """Service to manage Fee related operations.""" @classmethod def find_code_values_by_type( cls, code_typ...
bcgov/EPIC.track
epictrack-api/src/api/services/code.py
code.py
py
1,709
python
en
code
4
github-code
97
[ { "api_name": "flask.current_app.logger.debug", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.current_app.logger", "line_number": 18, "usage_type": "attribute" }, { "api_name": "flask.current_app", "line_number": 18, "usage_type": "name" }, { "ap...
2918302971
# -*- coding: utf-8 -*- # """ Unit tests for data related operations. """ import tempfile import copy import numpy as np import tensorflow as tf import texar.tf as tx from texar.tf.data import SpecialTokens # pylint: disable=too-many-locals, too-many-branches, protected-access # pylint: disable=invalid-name class...
asyml/texar
tests/data/data/paired_text_data_test.py
paired_text_data_test.py
py
7,715
python
en
code
2,369
github-code
97
[ { "api_name": "tensorflow.test", "line_number": 20, "usage_type": "attribute" }, { "api_name": "tensorflow.test.TestCase.setUp", "line_number": 25, "usage_type": "call" }, { "api_name": "tensorflow.test", "line_number": 25, "usage_type": "attribute" }, { "api_name...
69829254078
import requests import argparse from bs4 import BeautifulSoup def get_page(lang_source, lang_target, word): url = f"https://context.reverso.net/translation/{lang_source.strip().lower()}-{lang_target.strip().lower()}/{word}" headers = {'User-Agent': 'Mozilla/5.0'} page = requests.get(url, headers=headers)...
obotezatu/hyperskill
Multilingual Online Translator/task/translator/translator.py
translator.py
py
3,129
python
en
code
0
github-code
97
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 16, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 41, "usage_type": "call" } ]
35650454274
import requests from bs4 import BeautifulSoup import smtplib as stm def get_price(url ,check): header = { "Accept-Language":"tr,en;q=0.9,en-GB;q=0.8,en-US;q=0.7", "User-Agent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/...
MahmutAtia/-100-Days-of-Code-The-Complete-Python-Pro-Bootcamp-
amazon_price_scraper/amazon.py
amazon.py
py
1,496
python
en
code
0
github-code
97
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 11, "usage_type": "call" }, { "api_name": "smtplib.SMTP", "line_number": 20, "usage_type": "call" } ]
74040110400
#!/usr/bin/python # -*- coding: UTF-8 -*- import numpy as np import pygame as pg import Common import PopupBase as PB import ButtonBase as BB class LevelSelectPopup(PB.PopupBase): def __init__(self,): super(LevelSelectPopup, self).__init__(); def initBtns(self): PB.PopupBase.initBtns(self); btnPos = [(200,220...
kitrol/sudoku
LevelSelectPopup.py
LevelSelectPopup.py
py
1,423
python
en
code
0
github-code
97
[ { "api_name": "PopupBase.PopupBase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "PopupBase.PopupBase.initBtns", "line_number": 14, "usage_type": "call" }, { "api_name": "PopupBase.PopupBase", "line_number": 14, "usage_type": "attribute" }, { "api...