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
31890262213
__author__ = 'Advik-B' # advik.b@gmail.com import os import sys from fnmatch import fnmatch # Third party modules from send2trash import send2trash as delete from termcolor import cprint DEL = False try: cwd = sys.argv[1] except IndexError: cwd = os.getcwd() if_allowed_files = os.path.isfile(os.path.join(cw...
Advik-B/GitHub-Utils
cleanup.py
cleanup.py
py
2,264
python
en
code
3
github-code
1
[ { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 1...
39996367304
import numpy as np import pandas as pd from sklearn.svm import LinearSVC from sklearn.feature_extraction.text import TfidfTransformer, CountVectorizer from sklearn.pipeline import Pipeline from sklearn.model_selection import GridSearchCV train_labels = pd.read_csv('../resources/train_labels.csv', names=['label'], head...
mokleit/text-classification-scikit
src/main/svm/find_best_svm_estimator.py
find_best_svm_estimator.py
py
1,137
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "sklearn.pipeline.Pipeli...
16706436069
import argparse import ConfigParser import cStringIO import gzip import logging import json import os import sys import traceback import urllib from boto.s3.connection import S3Connection from boto.s3.key import Key def _init_config(): conf_parser = argparse.ArgumentParser( description="Downloads a file from a ...
zacharyozer/curlitos
curlitos.py
curlitos.py
py
4,486
python
en
code
1
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "ConfigParser.SafeConfigParser", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 29, "usage_type": "call" }, { "api_name": ...
27496332734
import re import logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) if __name__ == "__main__": test_string = "+375 (29) 299-00-00" match = re.search(r"^\+\d{1,3}\s\(\d{2}\)\s\d{3}\-\d{2}\-\d{2}$", test_string) if match: logger.info(f"Found {match.group()}") ...
akinfina-ulyana/lesson
lesson_10/classwork_01.py
classwork_01.py
py
369
python
en
code
0
github-code
1
[ { "api_name": "logging.basicConfig", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 6, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "re.search", ...
71571428834
import heapq import sys from typing import ( Generic, Iterable, Iterator, List, NamedTuple, Optional, Set, Tuple, TypeVar, ) from termcolor import cprint from aoc.utils import Coord2D, Grid H = TypeVar( "H", # technically can be anything comparible but obviously python's t...
Lexicality/advent-of-code
src/aoc/y2021/day15.py
day15.py
py
4,908
python
en
code
0
github-code
1
[ { "api_name": "typing.TypeVar", "line_number": 19, "usage_type": "call" }, { "api_name": "typing.TypeVar", "line_number": 26, "usage_type": "call" }, { "api_name": "typing.Generic", "line_number": 29, "usage_type": "name" }, { "api_name": "typing.List", "line_...
36427808018
from win32com.client import Dispatch from tkinter import * import tkinter as tk from PIL import Image from PIL import ImageTk import os import re import random from threading import Thread import pythoncom import time stu_path = "名单.txt" # 学生名单路径 def speaker(str): """ 语音播报 :param str: 需要播放语音的文字 """ ...
huangguifeng/callroll
rollcall.py
rollcall.py
py
5,577
python
zh
code
1
github-code
1
[ { "api_name": "win32com.client.Dispatch", "line_number": 21, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 34, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 34, "usage_type": "name" }, { "api_name": "PIL.ImageTk.PhotoIm...
22824109486
r''' Module with all structures for defining rings with operators. Let `\sigma: R \rightarrow R` be an additive homomorphism, i.e., for all elements `r,s \in R`, the map satisfies `\sigma(r+s) = \sigma(r) + \sigma(s)`. We define the *ring* `R` *with operator* `\sigma` as the pair `(R, \sigma)`. S...
Antonio-JP/dalgebra
dalgebra/ring_w_operator.py
ring_w_operator.py
py
54,589
python
en
code
1
github-code
1
[ { "api_name": "sage.categories.all.Rings.__classcall__", "line_number": 155, "usage_type": "call" }, { "api_name": "sage.categories.all.Rings", "line_number": 155, "usage_type": "argument" }, { "api_name": "sage.categories.all.CommutativeRings.__classcall__", "line_number": 1...
23787043311
import torch as th import pandas as pd import numpy as np import dgl from bipartite_graph import BipartiteGraph ####################### # user-item Subgraph Extraction ####################### def map_newid(df, col): old_ids = df[col] old_id_uniq = old_ids.unique() id_dict = {old: new for new, old in e...
venzino-han/graph-transfer
dataset.py
dataset.py
py
7,605
python
en
code
1
github-code
1
[ { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.zeros", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.int32", "line_number": 24, "usage_type": "attribute" }, { "api_name": "torch.arange", "line_num...
8877029762
""" FILE: kernelregression.py LAST MODIFIED: 24-12-2015 DESCRIPTION: Module for Gaussian kernel regression =============================================================================== This file is part of GIAS2. (https://bitbucket.org/jangle/gias2) This Source Code Form is subject to the terms of the Mozilla Publ...
musculoskeletal/gias2
src/gias2/learning/kernelregression.py
kernelregression.py
py
5,059
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 22, "usage_type": "attribute" }, { "api_name": "numpy.exp", "line_numb...
72689147554
#coding: utf-8 __author__ = "Lário dos Santos Diniz" from django.contrib import admin from .models import (RPGSystem) class RPGSystemAdmin(admin.ModelAdmin): list_display = ['name', 'description', 'site'] search_fields = ['name', 'description', 'site'] admin.site.register(RPGSystem, RPGSystemAdmin)
lariodiniz/minhaMesaRPG
api/admin.py
admin.py
py
314
python
en
code
0
github-code
1
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 9, "usage_type": "name" }, { "api_name": "django.contrib.admin.site.register", "line_number": 14, "usage_type": "call" },...
44370675825
# Import required libraries import pandas as pd from sqlalchemy import create_engine # Load data from source into a Pandas dataframe df = pd.read_csv('source_data.csv') # Perform data transformation and cleaning df = df.dropna() df['column_name'] = df['column_name'].str.upper() # Load data into a SQL database engine...
Kripadhn/DataIntegration
DI-Alogorithms/Data Integration/DataIntegration.py
DataIntegration.py
py
906
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "sqlalchemy.create_engine", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.read_sql_query", "line_number": 21, "usage_type": "call" } ]
71835741475
import random import sys import numpy import torch import pygad import pygad.torchga from nn import create_ga, create_network import math class Gym: def __init__(self, w, h, left_ai, right_ai): self.turn_i = 0 self.w = w self.h = h self.left_ai = left_ai self.right_ai = r...
enchantinggg4/pytorch_experiment
src/mygym.py
mygym.py
py
9,940
python
en
code
0
github-code
1
[ { "api_name": "random.randint", "line_number": 28, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 71, "usage_type": "call" }, { "api_name": "numpy.array", "line_num...
38523258836
import csv import models from operator import attrgetter import statistics def filter_data(columns, row): ENERGYSTARScore = row[columns.index('ENERGYSTARScore')] if ENERGYSTARScore == '': return False YearBuilt = row[columns.index('YearBuilt')] if int(YearBuilt) < 1920: return False ...
the-non-binary-tree/ada_data_challenge_c15
utils.py
utils.py
py
9,974
python
en
code
0
github-code
1
[ { "api_name": "csv.reader", "line_number": 29, "usage_type": "call" }, { "api_name": "models.Building", "line_number": 70, "usage_type": "call" }, { "api_name": "statistics.median", "line_number": 144, "usage_type": "call" }, { "api_name": "csv.reader", "line_...
3408800450
import serial import matplotlib matplotlib.use('TkAgg') # MUST BE CALLED BEFORE IMPORTING plt from matplotlib import pyplot as plt import queue import threading import animation import seaborn as sns import numpy as np import time class ArduinoReader(threading.Thread): def __init__(self, stop_event, sig, serport):...
saintnever/dualring_py
stream.py
stream.py
py
2,949
python
en
code
0
github-code
1
[ { "api_name": "matplotlib.use", "line_number": 3, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 12, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 14, "usage_type": "call" }, { "api_name": "threadi...
10913773933
from flask import Flask, render_template, request import pandas as pd import numpy as np app = Flask(__name__) # Reading dataset in global scope df = pd.read_csv("winequalityN.csv") # This is the home page @app.route("/") def home(): return render_template("home.html") # This is the page where we will load the d...
ayushraina2028/basic-machine
app.py
app.py
py
18,393
python
en
code
2
github-code
1
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.request.method"...
31855918986
import requests import re import random import time from bs4 import BeautifulSoup import bs4 from fake_useragent import UserAgent ua = UserAgent() books = [] discounts = [] cookie = { "bid": "6183e2a207286", "_gcl_au": "1.1.1678734493.1636033188", "cid": "kypss95053", "pd": "B4MPDFMstRRagO9wOXmP3pNPoI...
jeff-901/bookstore
data/crawl.py
crawl.py
py
6,009
python
en
code
0
github-code
1
[ { "api_name": "fake_useragent.UserAgent", "line_number": 9, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 23, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 26, "usage_type": "call" }, { "api_name": "requests.get", ...
42615079781
import numpy as np import glob import sklearn.covariance as Covariance def get_covariance_object(X, load=True): if load: covarianceDict = np.load('./profiles/covarianceDict.npy', allow_pickle=True)[()] cov_object, mean, std = covarianceDict['cov_object'], covarianceDict['mean'], covarianceDict['std...
scarpma/SSM_segmentation_3DSlicer_module
compute_profiles_covariance.py
compute_profiles_covariance.py
py
2,053
python
en
code
1
github-code
1
[ { "api_name": "numpy.load", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.covariance.OAS", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.covariance", "line_number": 14, "usage_type": "name" }, { "api_name": "numpy.save", ...
38979638858
from django.core.management.base import BaseCommand, CommandError from django.core.exceptions import FieldDoesNotExist, FieldError from django.conf import settings import requests from dbproducts.models import Category, Product from dbproducts.related_functions import symbol_removal class Command(BaseCommand): "...
guillaumecarru/Pur_Beurre_Website
dbproducts/management/commands/populate_db.py
populate_db.py
py
5,396
python
en
code
0
github-code
1
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 10, "usage_type": "name" }, { "api_name": "django.conf.settings.PROD_CATEGORIES", "line_number": 32, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 32, "usage_type":...
24522787900
"""Copied from cpython to ensure compatibility""" import io from typing import Any, Callable, Dict BUFFER_SIZE = io.DEFAULT_BUFFER_SIZE # Compressed data read chunk size class BaseStream(io.BufferedIOBase): """Mode-checking helper functions.""" def _check_not_closed(self): if self.closed: ...
synodriver/python-bz3
bz3/compression.py
compression.py
py
5,403
python
en
code
5
github-code
1
[ { "api_name": "io.DEFAULT_BUFFER_SIZE", "line_number": 5, "usage_type": "attribute" }, { "api_name": "io.BufferedIOBase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "io.UnsupportedOperation", "line_number": 17, "usage_type": "call" }, { "api_name...
3262515470
#!/usr/bin/env python3 import secrets import sys import subprocess import argparse import headerStruct def calculateSizeOfTheImage(lastVirtAddr, size, SectAlignment): mult = int((size-1) / SectAlignment) + 1 return lastVirtAddr + (SectAlignment * mult) def generateKey(arch): # init values wordlength...
idrirap/projectEthHack
packer.py
packer.py
py
13,046
python
en
code
1
github-code
1
[ { "api_name": "secrets.token_bytes", "line_number": 23, "usage_type": "call" }, { "api_name": "secrets.token_bytes", "line_number": 25, "usage_type": "call" }, { "api_name": "subprocess.run", "line_number": 67, "usage_type": "call" }, { "api_name": "subprocess.run...
19681624663
from PIL import Image, ImageFilter img = Image.open('./astro.jpg') # filtered_img = img.filter(ImageFilter.BLUR) # Blurs the image # filtered_img = img.filter(ImageFilter.SMOOTH) # Smooth the image # filtered_img = img.filter(ImageFilter.SHARPEN) # Sharpens the image # filtered_img = img.convert('L') # converts t...
Yeshwanth37/ImageProcessing
Image.py
Image.py
py
687
python
en
code
0
github-code
1
[ { "api_name": "PIL.Image.open", "line_number": 3, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 3, "usage_type": "name" } ]
26237350861
import logging from datetime import datetime, timedelta from typing import Dict, Optional from synthetic.user.profile_data_update import ProfileDataUpdate from synthetic.utils.time_utils import total_difference_seconds logger = logging.getLogger(__name__) class BaseVariableManager: """Responsible for managing a...
benshi-ai/open-synthetic-data-generator
src/synthetic/managers/base_manager.py
base_manager.py
py
2,574
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "typing.Dict", "line_number": 17, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "name" }, { "api_name": "datetime.datetime", ...
6363891788
from dataclasses import dataclass, field from typing import Any, Iterable, List, Dict from config import SUBJECT_PATTERNS, DAYS @dataclass(kw_only=True) class Pattern: subject_type: str classes: int duration: int required_rooms: List[Any] = field(init=False, default_factory=list) def add_rooms(se...
oneku16/UCA-schedule-generator
brute_force_2/subject/pattern.py
pattern.py
py
726
python
en
code
0
github-code
1
[ { "api_name": "typing.List", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 11, "usage_type": "name" }, { "api_name": "dataclasses.field", "line_number": 11, "usage_type": "call" }, { "api_name": "typing.Iterable", "line_...
5142368170
import sklearn from sklearn.utils import shuffle from sklearn.neighbors import KNeighborsClassifier import pandas as pd import numpy as np from sklearn import linear_model, preprocessing data = pd.read_csv("car.data") print(data.head()) le = preprocessing.LabelEncoder() buying = le.fit_transform(list(data[...
Laudkyle/my-python-projects
Python Scripts/machine learning 1/knn.py
knn.py
py
1,408
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 11, "usage_type": "call" }, { "api_name": "sklearn.preprocessing", "line_number": 11, "usage_type": "name" }, { "api_name"...
8362112734
# --------------------------- # Problem 2 # Given an array of integers, return a new array such that each element at index i of the new array is the # product of all the numbers in the original array except the one at i. # # For example, if our input was [1, 2, 3, 4, 5], the expected output would be [120, 60, 40, 30, 2...
dmallory42/daily-coding-problem-solutions
problem_002.py
problem_002.py
py
1,104
python
en
code
0
github-code
1
[ { "api_name": "functools.reduce", "line_number": 23, "usage_type": "call" } ]
72966759394
import json import requests import sys import glance_check.exception as exc class GlanceCheck: def __init__(self, creds=None, imageid=None, os_image_url=None, cacert=None, verbose=False): self.__imageid = imageid self.__image_url = os_image_url self.__auth_url = creds['o...
ArdanaCLM/glance-check
glance_check/check.py
check.py
py
4,530
python
en
code
0
github-code
1
[ { "api_name": "sys.stderr.write", "line_number": 23, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 23, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 29, "usage_type": "call" }, { "api_name": "requests.post", "line...
74152867874
import gym import time env = gym.make('CartPole-v0') env.reset() for step in range(1000): env.render() # rendering the environment at each step env.step(env.action_space.sample()) # feed the env with random actions that exist in all possible actions time.sleep(0.1)
Aslanfmh65/open_ai_project
practice.py
practice.py
py
281
python
en
code
0
github-code
1
[ { "api_name": "gym.make", "line_number": 4, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 10, "usage_type": "call" } ]
1168928910
import cv2 import keras camera = cv2.VideoCapture(0) haar = cv2.CascadeClassifier('cascades/haarcascade_frontalface_alt2.xml') model = keras.models.load_model('gender/InceptionResNetV2/weights/inception_gender.h5') model.compile(optimizer = 'adam', loss = 'binary_crossentropy', metrics = ['accuracy']) while True: ...
imdeepmind/age-gender-prediction
detect.py
detect.py
py
1,388
python
en
code
0
github-code
1
[ { "api_name": "cv2.VideoCapture", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 5, "usage_type": "call" }, { "api_name": "keras.models.load_model", "line_number": 7, "usage_type": "call" }, { "api_name": "keras.mod...
41131109007
#Standard import numpy as np import cv2 import os import copy from PIL import Image, ImageFilter import time #Local files from Utilities import make_directory, align_image, get_from_directory, save_to_directory, numericalSort from HOG_functions import process_HOG_image, get_HOG_image import JetsonYolo #SCIPY and SKl...
ChrisLochhead/PhDSummerProject
PhDSummerProject/Programs/image_processing/ImageProcessor.py
ImageProcessor.py
py
14,887
python
en
code
0
github-code
1
[ { "api_name": "cv2.cvtColor", "line_number": 23, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2YCrCb", "line_number": 23, "usage_type": "attribute" }, { "api_name": "cv2.equalizeHist", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.cvtColor",...
25654546309
import uvicorn from fastapi import FastAPI, Request, status from fastapi.openapi.utils import get_openapi from fastapi.middleware.cors import CORSMiddleware from fastapi.responses import JSONResponse from fastapi.exceptions import RequestValidationError from app.v1.routers.facts import v1_router from config import NA...
DucNgn/Dog-Facts-API-v2
app/main.py
main.py
py
1,763
python
en
code
6
github-code
1
[ { "api_name": "app.v1.routers.facts.openapi_schema", "line_number": 16, "usage_type": "attribute" }, { "api_name": "app.v1.routers.facts", "line_number": 16, "usage_type": "name" }, { "api_name": "app.v1.routers.facts.openapi_schema", "line_number": 17, "usage_type": "att...
33845405230
#-*- coding: utf-8 -*- import pyqtgraph as pg from DateAxis import DateAxis from TableModel import TableModel from PyQt4.QtGui import * from PyQt4 import uic class LogView(QTableView): def __init__(self, graphicLayout, layoutRow = 0, layoutCol = 0): super().__init__() self.view = graphi...
turlvo/KuKuLogAnalyzer
LogView.py
LogView.py
py
3,684
python
en
code
1
github-code
1
[ { "api_name": "DateAxis.DateAxis", "line_number": 12, "usage_type": "call" }, { "api_name": "pyqtgraph.TextItem", "line_number": 85, "usage_type": "call" }, { "api_name": "pyqtgraph.ScatterPlotItem", "line_number": 109, "usage_type": "call" }, { "api_name": "pyqtg...
7420566826
from django.contrib.auth import get_user_model from django.test import TestCase from posts.models import Group, Post User = get_user_model() class TestGroupModel(TestCase): @classmethod def setUpTestData(cls): cls.group = Group.objects.create( title="Тестовый Заголовок", slug...
VaSeWS/hw05_final
yatube/posts/tests/test_models.py
test_models.py
py
2,456
python
ru
code
0
github-code
1
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 6, "usage_type": "call" }, { "api_name": "django.test.TestCase", "line_number": 9, "usage_type": "name" }, { "api_name": "posts.models.Group.objects.create", "line_number": 12, "usage_type": "call" }, ...
8803458348
from typing import Union import requests as r from requests_toolbelt.multipart.encoder import MultipartEncoder class PetFriends: def __init__(self): self.base_url = 'https://petfriends1.herokuapp.com/' def get_api_key(self, email: str, password: str): """Метод получения ключа API"...
313109116/Unit_19.7
api.py
api.py
py
2,661
python
ru
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 18, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 27, "usage_type": "call" }, { "api_name": "requests_toolbelt.multipart.encoder.MultipartEncoder", "line_number": 33, "usage_type": "call" }, { "ap...
1603872328
""" trainvalsplit.py is a script that splits an MS COCO formatted dataset into train and val partitions. For sample usage, run from command line: Example: python trainvalsplit.py --help """ import random from pathlib import Path from typing import Any, List, Tuple import numpy as np from .class_dist import CocoC...
GiscardBiamby/cocobetter
PythonAPI/pycocotools/helpers/splits.py
splits.py
py
4,977
python
en
code
0
github-code
1
[ { "api_name": "typing.List", "line_number": 28, "usage_type": "name" }, { "api_name": "numpy.ceil", "line_number": 42, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.random", "line_num...
21513980032
import json from scrapy import Selector import requests import re headers = { "content-type": "application/x-www-form-urlencoded", "sec-ch-ua-mobile": "?0", "x-requested-with": "XMLHttpRequest", 'User-Agent': 'Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Geck...
petr777/pp
flask_app/vk_app/posts.py
posts.py
py
1,845
python
en
code
0
github-code
1
[ { "api_name": "re.search", "line_number": 17, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 23, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 29, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 36, "usage_ty...
45290876502
# -*- coding: utf-8 -*- import re import markdown from markdown.treeprocessors import Treeprocessor from tina.front.templatetags.functions import resolve class TargetBlankLinkExtension(markdown.Extension): """An extension that add target="_blank" to all external links.""" def extendMarkdown(self, md): ...
phamhongnhung2501/Taiga.Tina
fwork-backend/tina/mdrender/extensions/target_link.py
target_link.py
py
879
python
en
code
0
github-code
1
[ { "api_name": "markdown.Extension", "line_number": 12, "usage_type": "attribute" }, { "api_name": "markdown.treeprocessors.Treeprocessor", "line_number": 20, "usage_type": "name" }, { "api_name": "tina.front.templatetags.functions.resolve", "line_number": 22, "usage_type"...
2760383933
# This file contains the main class to run the model import os import math from tensorflow.keras.callbacks import LambdaCallback import numpy as np import time import matplotlib.pyplot as plt # generate samples and save as a plot and save the model def summarize_performance(step, g_model, c_model, dataset, n_samples=1...
AKI-maggie/thesis
main.py
main.py
py
6,229
python
en
code
1
github-code
1
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 15, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.subplot", "line_number": 18, "usage_type": "call" }, { "api_name": "...
12158969726
from unittest import TestCase, mock from matplotlib import animation, pyplot as plt from src.chinese_checkers.game.ChineseCheckersGame import ChineseCheckersGame from src.chinese_checkers.simulation.GameSimulationAnimation import GameSimulationAnimation from src.chinese_checkers.simulation.GameSimulation import GameS...
dakotacolorado/ChineseCheckersGameEngine
tests/chinese_checkers/simulation/test_GameSimulationAnimation.py
test_GameSimulationAnimation.py
py
2,113
python
en
code
0
github-code
1
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "name" }, { "api_name": "unittest.mock.MagicMock", "line_number": 14, "usage_type": "call" }, { "api_name": "unittest.mock", "line_number": 14, "usage_type": "name" }, { "api_name": "src.chinese_c...
4752374660
import os import openai openai.api_key = "" def get_completion(prompt, model="gpt-3.5-turbo"): messages = [{"role": "user", "content": prompt}] response = openai.ChatCompletion.create( model=model, messages=messages, temperature=0, ) return response.choices[0].message["content...
yeonieheoo/MemoryCompanion
ML4H_LLM/case90.py
case90.py
py
2,539
python
en
code
0
github-code
1
[ { "api_name": "openai.api_key", "line_number": 4, "usage_type": "attribute" }, { "api_name": "openai.ChatCompletion.create", "line_number": 8, "usage_type": "call" }, { "api_name": "openai.ChatCompletion", "line_number": 8, "usage_type": "attribute" }, { "api_name...
14920841148
""" > Extremely Simple Image file format < >------------------------------------------------------------------------------------------< > Designed for databending or glitching > Has very little fancy features that could cause problems with decoding > Decoder is desi...
AlexPoulsen/esi
esi_to_png.py
esi_to_png.py
py
5,823
python
en
code
1
github-code
1
[ { "api_name": "re.sub", "line_number": 57, "usage_type": "call" }, { "api_name": "struct.pack", "line_number": 62, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 68, "usage_type": "call" }, { "api_name": "math.floor", "line_number": 69, "us...
11101974490
#!/usr/bin/env python import json import csv import re import math from pprint import pprint CURRENT_SOURCE_PATTERN = re.compile('^i', re.I) INDUCTOR_PATTERN = re.compile('^l', re.I) PULSE_PATTERN = re.compile('^pulse', re.I) POSITION_PATTERN = re.compile(r'\An|_n', re.I) TIME_PATTERN = re.compile(r'^\.tran', re.I) ...
tshaffe1/noisemapper
noisemapper.py
noisemapper.py
py
11,790
python
en
code
0
github-code
1
[ { "api_name": "re.compile", "line_number": 9, "usage_type": "call" }, { "api_name": "re.I", "line_number": 9, "usage_type": "attribute" }, { "api_name": "re.compile", "line_number": 10, "usage_type": "call" }, { "api_name": "re.I", "line_number": 10, "usag...
27393973025
# --- Bibliothèques utilisées --- from functools import partial import tkinter as tk from random import seed from random import randint # --- Préparation du jeu --- def diff_size(diff): """ sert à déterminer le nombre de cases du jeu entrées : diff (difficulté) avec trois valeurs possib...
Claripouet/demineur
démineur_final.py
démineur_final.py
py
10,371
python
fr
code
0
github-code
1
[ { "api_name": "random.seed", "line_number": 60, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 63, "usage_type": "call" }, { "api_name": "tkinter.Button", "line_number": 139, "usage_type": "call" }, { "api_name": "functools.partial", "l...
32087619445
import uiautomator2 as u2 import pytest import allure @allure.feature("测试首页")#类的主要测试部分 #@allure.environment(app_package='com.mobile.fm')# 具体Environment参数可自行设置 # @allure.environment(app_activity='com.mobile.fm.activity') # @allure.environment(device_name='aad464') # @allure.environment(platform_name='Android') class ...
luoqingfu/u2demo
testcase/test_demo.py
test_demo.py
py
2,173
python
zh
code
0
github-code
1
[ { "api_name": "uiautomator2.connect", "line_number": 34, "usage_type": "call" }, { "api_name": "allure.story", "line_number": 22, "usage_type": "call" }, { "api_name": "allure.severity", "line_number": 23, "usage_type": "call" }, { "api_name": "allure.step", "...
16805089134
import pandas as pd import numpy as np import matplotlib.pyplot as plt a_dataframe = pd.DataFrame( {'name':['Alice','Bob','Charles'], 'age':[25, 23, 34], 'gender':['female','male','male']}) print(a_dataframe) # new_dataframe = pd.DataFrame(np.arange(16).reshape((4,4)), # ...
OceanicSix/Python_program
Study/external/pand/pandas_example.py
pandas_example.py
py
973
python
en
code
1
github-code
1
[ { "api_name": "pandas.DataFrame", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.legend", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 21, "usage_type": "name" }, { "api_name": "matplotlib...
1293373601
import random import itertools from fp.fp import FreeProxy import requests from itemloaders.processors import TakeFirst, MapCompose proxies_list = FreeProxy().get_proxy_list() print(type(proxies_list)) proxy = itertools.cycle(proxies_list) # pr = random.choice(proxies) def set_proxy(proxy): _proxy = next(proxy) ...
navneet37/BusinessScrapy
testproxy.py
testproxy.py
py
589
python
en
code
0
github-code
1
[ { "api_name": "fp.fp.FreeProxy", "line_number": 6, "usage_type": "call" }, { "api_name": "itertools.cycle", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 20, "usage_type": "call" } ]
28941505818
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from tex import Tex from PIL import Image if __name__ == '__main__': for root, dirs, files in os.walk('PackedContent'): for f in files: if os.path.splitext(f)[1].lower() == '.tex': name = os.path.join(root, f) ...
noword/EXAPUNKS-Localize
images/import_imgs.py
import_imgs.py
py
1,256
python
en
code
32
github-code
1
[ { "api_name": "os.walk", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.splitext", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number"...
647601614
import json import re from konlpy.tag import Twitter from collections import Counter import pytagcloud import webbrowser import matplotlib import matplotlib.pyplot as plt from matplotlib import font_manager, rc def showGraph(wordInfo) : font_location = "C:\Windows\Fonts\malgun.ttf" font_name = font_manager.Fo...
Gyeo1/Project
Iot-인공지능-빅데이터(크롤링,워드클라우드)/2.워드클라우드.py
2.워드클라우드.py
py
1,933
python
en
code
1
github-code
1
[ { "api_name": "matplotlib.font_manager.FontProperties", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.font_manager", "line_number": 14, "usage_type": "name" }, { "api_name": "matplotlib.rc", "line_number": 15, "usage_type": "call" }, { "api_...
15405751223
#!/usr/bin/env python3 """ https://adventofcode.com/2021/day/21 """ import collections import itertools import aoc PUZZLE = aoc.Puzzle(day=21, year=2021) def solve_b(positions): """Solve puzzle part b""" rolls = collections.Counter( sum(rolls) for rolls in itertools.product(range(1, 4), repe...
trosine/advent-of-code
2021/day21.py
day21.py
py
1,970
python
en
code
0
github-code
1
[ { "api_name": "aoc.Puzzle", "line_number": 10, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 15, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 17, "usage_type": "call" }, { "api_name": "collections.defaultd...
24645452076
""" This module should contain your main project pipeline(s). Whilst the pipeline may change during the analysis phases, any more stable pipeline should be implemented here so that it can be reused and easily reproduced. """ # This must be set in the beggining because in model_util, we import it logger_name = "FCRN-BI...
aleksei-mashlakov/fcrn-bidding
src/fcrn_bidding/pipeline.py
pipeline.py
py
3,112
python
en
code
0
github-code
1
[ { "api_name": "proxy.Proxy", "line_number": 30, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 37, "usage_type": "call" }, { "api_name": "schedule.every", "line_number": 58, "usage_type": "call" }, { "api_name": "schedule.every", "lin...
43464527814
import easyocr import cv2 import matplotlib.pyplot as plt import re import unidecode from datetime import datetime import numpy as np import math import os import json from difflib import SequenceMatcher from itertools import combinations READER = easyocr.Reader(['vi']) json_path = "data/vn_administrative_location.j...
tungedng2710/TonEKYC
utils/ocr_utils.py
ocr_utils.py
py
5,405
python
en
code
2
github-code
1
[ { "api_name": "easyocr.Reader", "line_number": 14, "usage_type": "call" }, { "api_name": "json.load", "line_number": 17, "usage_type": "call" }, { "api_name": "json.load", "line_number": 22, "usage_type": "call" }, { "api_name": "json.load", "line_number": 24,...
33776237261
# # Notation: Draw Supported Notations of Explicit Converter import mechkit import networkx as nx import matplotlib.pyplot as plt plot_options = dict( node_color="yellow", node_size=2000, width=2, arrows=True, font_size=10, font_color="black", ) converter = mechkit.notation.ExplicitConverter(...
JulianKarlBauer/mechkit
docs/source/notebooks/06.py
06.py
py
551
python
en
code
14
github-code
1
[ { "api_name": "mechkit.notation.ExplicitConverter", "line_number": 16, "usage_type": "call" }, { "api_name": "mechkit.notation", "line_number": 16, "usage_type": "attribute" }, { "api_name": "networkx.spring_layout", "line_number": 20, "usage_type": "call" }, { "a...
33501639542
import matplotlib.pyplot as plt import numpy as np import seaborn as sns import torch import torch.nn as nn import torch.nn.functional as F from torch.optim import Optimizer import scipy.io from Bayesian_DL.BPINN.VI.src.utils import log_gaussian_loss, gaussian, get_kl_Gaussian_divergence from torch.utils.tensorboard...
SoloChe/BPINN
VI/KdV_identification.py
KdV_identification.py
py
13,494
python
en
code
0
github-code
1
[ { "api_name": "torch.cuda.is_available", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 15, "usage_type": "attribute" }, { "api_name": "Bayesian_DL.BPINN.VI.src.model.BBP_Model_PINN", "line_number": 20, "usage_type": "name" }, { ...
5237933206
import numpy as np import matplotlib.pyplot as plt class Agent: def __init__(self, bandit, exploration_rate): self.bandit = bandit self.exploration_rate = exploration_rate self.cur_estimates = self.first_estimates() self.all_estimates = [[self.cur_estimates[i]] for i in range(len(se...
Oppac/RL
simple_bandit.py
simple_bandit.py
py
1,735
python
en
code
0
github-code
1
[ { "api_name": "numpy.random.normal", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.random.random", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.rando...
71349302755
""" """ import datetime as dt import requests import time import pandas as pd import streamlit as st def app(): asset_contract_address = st.sidebar.text_input("Contract Address") start_dt_input = st.sidebar.date_input(label='Start Date') end_dt_input = st.sidebar.date_input(label='End Date') def get...
alhedlund/al_nft_data_app
pages/collections.py
collections.py
py
2,310
python
en
code
0
github-code
1
[ { "api_name": "streamlit.sidebar.text_input", "line_number": 11, "usage_type": "call" }, { "api_name": "streamlit.sidebar", "line_number": 11, "usage_type": "attribute" }, { "api_name": "streamlit.sidebar.date_input", "line_number": 13, "usage_type": "call" }, { "...
16190520974
# coding: utf-8 """ Производственный календарь. """ import json import os import datetime import requests WORKING_TYPE_WORK = 0 WORKING_TYPE_HOLIDAY = 2 WORKING_TYPE_SHORT = 3 DEFAULT_CACHE_PATH = '/tmp/basicdata_calend.json' def is_working_time(date_time, use_cache=False, cache_path=DEFAULT_CACHE_PATH): except...
telminov/sw-python-utils
swutils/prod_calendar.py
prod_calendar.py
py
2,802
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 66, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 72, "usage_type": "call" }, { "api_name": "json.load", "line_number": 77, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": ...
4496867704
import requests import argparse from datetime import datetime PXLA_ENDPOINT = "https://pixe.la/v1/users" USERNAME = "stamnoob" PWD = "m0n0mlkiaple0n" HEADER = {"X-USER-TOKEN": PWD} def arg_parser() -> argparse.Namespace: parser = argparse.ArgumentParser(description="Post a coding hours pixel in the pixela \"code-...
stzanos95/python-projects
Habit-Tracker/main.py
main.py
py
2,221
python
en
code
0
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "argparse.Namespace", "line_number": 10, "usage_type": "attribute" }, { "api_name": "requests.post", "line_number": 24, "usage_type": "call" }, { "api_name": "request...
72703642915
import math import random import sys import importlib #========================change variables here to modify scenario======================== path_to_folder = "C:\\Users\\LJMU\\Documents\\Felix\\OpenMATB_ScenarioCreator" path_to_folder = "C:\\Users\\felix\\Desktop\\LJMU\\Scripts\\Python\\OpenMATB_ScenarioCreator" #...
Zebrakopf/OpenMATB_ScenarioCreator
create_scenario.py
create_scenario.py
py
9,599
python
en
code
0
github-code
1
[ { "api_name": "sys.argv", "line_number": 17, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 18, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 19, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number...
4490266612
# My_Picture Predict import numpy as np import matplotlib.pyplot as plt import cv2 from tensorflow.keras.preprocessing.image import ImageDataGenerator from tensorflow.keras.models import load_model model = load_model('../data/h5/k67_img.h5') pred_datagen = ImageDataGenerator(rescale=1./255) pred_data = pred_datagen...
Taerimmm/ML
keras2/keras67_4_my_result.py
keras67_4_my_result.py
py
1,145
python
en
code
3
github-code
1
[ { "api_name": "tensorflow.keras.models.load_model", "line_number": 8, "usage_type": "call" }, { "api_name": "tensorflow.keras.preprocessing.image.ImageDataGenerator", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.imshow", "line_number": 22, "...
19294404545
from statsmodels.tsa.holtwinters import ExponentialSmoothing from dateutil.relativedelta import relativedelta import pandas as pd def predict_next_12_months(data): pred = pd.DataFrame() start_and_finish = [max(pd.to_datetime(data.columns, format = "%Y-%m")) + relativedelta(months=(x*11)+1) for x in range(2)] ...
nizarcan/CapacityPlanningDSS-SD
backend/predictor.py
predictor.py
py
1,444
python
en
code
0
github-code
1
[ { "api_name": "pandas.DataFrame", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 8, "usage_type": "call" }, { "api_name": "dateutil.relativedelta.relativedelta", "line_number": 8, "usage_type": "call" }, { "api_name": ...
36916798983
# Módulos from datetime import date # Declaração de variáveis pessoa = dict() # Entrada de dados da pessoa pessoa['nome'] = str(input('Nome: ')) nasc = int(input('Ano de nascimento: ')) pessoa['idade'] = date.today().year - nasc ctps = int(input('Carteira de Trabalho (0 se não possui): ')) if ctps !=...
Henrique-Botelho/ExerciciosDePython-Curso-em-Video
Exercícios Aula 19/Ex. 092.py
Ex. 092.py
py
636
python
pt
code
0
github-code
1
[ { "api_name": "datetime.date.today", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 12, "usage_type": "name" } ]
71730627235
from gui.visual.player import Player from gui.visual.entity import Entity import glm import OpenGL.GL as gl from gui.visual.camera import Camera from gui.visual.staticShader import StaticShader from gui.visual.entityRenderer import EntityRenderer from gui.visual.skyboxRenderer import SkyboxRenderer from gui.visual.worl...
Mimikkk/2023-amib
src/libs/framspy/gui/visual/masterRenderer.py
masterRenderer.py
py
3,138
python
en
code
0
github-code
1
[ { "api_name": "gui.visual.staticShader.StaticShader", "line_number": 22, "usage_type": "call" }, { "api_name": "gui.visual.entityRenderer.EntityRenderer", "line_number": 23, "usage_type": "call" }, { "api_name": "gui.visual.skyboxRenderer.SkyboxRenderer", "line_number": 24, ...
2558854509
import sqlite3 connection=sqlite3.connect("RUGIPP_REGISTRI.db") crsr=connection.cursor() class Registar_Geodeta: def __init__(self,JMBG,ime,prezime,strucna_sprema,broj_strucnog,red_licence): self.JMBG=JMBG self.ime=ime self.prezime=prezime self.sprema=strucna_sprema self.st...
SarajlicS/Zavrsni_Rad
Registar_Geodeta.py
Registar_Geodeta.py
py
4,781
python
en
code
0
github-code
1
[ { "api_name": "sqlite3.connect", "line_number": 2, "usage_type": "call" } ]
34459058884
import os, sys from typing import Union, List import numpy as np import pandas as pd from sklearn.preprocessing import scale import torch import torch.nn as nn from torch.utils.data import Dataset def load_data(data_path): name = ["train", "test"] columns = [f"V{i}" for i in range(1, 31)] val_columns = ...
doyooni303/UnsupervisedAnomalyDetection_VAE
src/build_datset.py
build_datset.py
py
1,789
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line...
26074240113
import json from flask import Flask, redirect, request, render_template from oauth2client.client import flow_from_clientsecrets from config import GOOGLE_CLIENT_SECRETS_JSON, REGISTERED_CREDENTIALS_JSON server_uri = 'http://localhost:5000' app = Flask(__name__) flow = flow_from_clientsecrets( GOOGLE_CLIENT_SECR...
sk364/inbox-cleaner
server.py
server.py
py
1,740
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "oauth2client.client.flow_from_clientsecrets", "line_number": 11, "usage_type": "call" }, { "api_name": "config.GOOGLE_CLIENT_SECRETS_JSON", "line_number": 12, "usage_type": "argument" ...
27286970033
import numpy as np import pandas as pd import pytest from cleanlab.datalab.internal.issue_manager import IssueManager from cleanlab.datalab.internal.issue_manager_factory import REGISTRY, register class TestCustomIssueManager: @pytest.mark.parametrize( "score", [0, 0.5, 1], ids=["zero", "...
cleanlab/cleanlab
tests/datalab/test_issue_manager.py
test_issue_manager.py
py
1,931
python
en
code
7,004
github-code
1
[ { "api_name": "pandas.DataFrame", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.testing.assert_frame_equal", "line_number": 24, "usage_type": "call" }, { "api_name": "pandas.testing", "line_number": 24, "usage_type": "attribute" }, { "api_name":...
26781812415
import re import nltk import pandas as pd from textblob import TextBlob def lemmatize_with_postag(sentence): ''' https://www.machinelearningplus.com/nlp/lemmatization-examples-python/ ''' sent = TextBlob(sentence) tag_dict = {"J": 'a', "N": 'n', "V": 'v', ...
SamEdwardes/sentiment-cdn-election
src/twitter_analysis.py
twitter_analysis.py
py
6,996
python
en
code
0
github-code
1
[ { "api_name": "textblob.TextBlob", "line_number": 12, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 38, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 40, "usage_type": "call" }, { "api_name": "textblob.TextBlob", "line_number"...
22119528446
import numpy as np import cv2 def load_image(path_img): return cv2.imread(path_img) def bgr2hsv(img): return cv2.cvtColor(img, cv2.COLOR_BGR2HSV) def setRangeColor(hsv, lower_color, upper_color): return cv2.inRange(hsv, lower_color, upper_color) def contours_img(mask): contours,_ = cv2....
opsun1/code
color_detection.py
color_detection.py
py
3,063
python
en
code
0
github-code
1
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HSV", "line_number": 8, "usage_type": "attribute" }, { "api_name": "cv2.inRange", "line_n...
43199229342
import bpy from bpy.props import BoolProperty, EnumProperty from bpy_extras.view3d_utils import region_2d_to_location_3d, region_2d_to_origin_3d, region_2d_to_vector_3d from mathutils import Vector from .. utils.registration import get_addon, get_prefs from .. utils.tools import get_active_tool from .. utils.object imp...
AtixCG/Universal-3D-Shortcuts
Blender/With Addons/scripts/addons/MACHIN3tools/operators/mirror.py
mirror.py
py
28,604
python
en
code
38
github-code
1
[ { "api_name": "bpy.types", "line_number": 79, "usage_type": "attribute" }, { "api_name": "bpy.props.BoolProperty", "line_number": 84, "usage_type": "call" }, { "api_name": "bpy.props.BoolProperty", "line_number": 85, "usage_type": "call" }, { "api_name": "bpy.prop...
39101218782
# type: ignore import json fin = open("secrets.json") raw_data = fin.read() #print(raw_data) environ_data = json.loads(raw_data) def load(os, db): for i in environ_data: os.environ[i] = environ_data[i]
py660/PyChat-Self-Deploy
shh.py
shh.py
py
216
python
en
code
0
github-code
1
[ { "api_name": "json.loads", "line_number": 7, "usage_type": "call" } ]
25497213504
import abc import logging import random import numpy as np import pandas as pd EVALUATION_CRITERIA = 'Accuracy' def _new_func(optimization, t, theta=1.0, record=None, gamma=1): third_term = np.sqrt(2 * np.log(t) / optimization.count) forth_term = np.sqrt(1 / theta * third_term) second_term = np.sqrt(1 /...
pineconebean/automl_lab
bandit/model_selection.py
model_selection.py
py
11,212
python
en
code
0
github-code
1
[ { "api_name": "numpy.sqrt", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 14, ...
70561841635
import tensorflow.keras.backend as K import matplotlib.pyplot as plt from tensorflow.keras.callbacks import Callback class LRFinder(Callback): #adjuted callback from Lucas Anders at: https://github.com/LucasAnders1/LearningRateFinder/blob/master/lr_finder_callback.py #adjusted to geometrically increase by ste...
valentinocc/Keras_cifar10
custom_callbacks.py
custom_callbacks.py
py
5,315
python
en
code
0
github-code
1
[ { "api_name": "tensorflow.keras.callbacks.Callback", "line_number": 6, "usage_type": "name" }, { "api_name": "tensorflow.keras.backend.set_value", "line_number": 42, "usage_type": "call" }, { "api_name": "tensorflow.keras.backend", "line_number": 42, "usage_type": "name" ...
36783915591
import numpy as np import matplotlib.pyplot as plt import higra as hg import torch from tqdm import tqdm #========================================= #= Helper Functions = #========================================= def get_centroids(X, high_dim_clusters,K,device="cpu",dim=2): index_sets = [np.a...
hci-unihd/DTAE
loss.py
loss.py
py
3,853
python
en
code
6
github-code
1
[ { "api_name": "numpy.argwhere", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.zeros", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.mean", "line_number...
25608601191
import json with open( "Task2.json","r+")as f: data=json.load(f) def group_of_decade(movies): dic={} list1=[] for i in movies: m=int(i)%10 decade=int(i)-m if decade not in list1: list1.append(decade) list1.sort() for i in list1: dic[i]=[] for i in ...
Subhkirti/PYTHON
WEB SCRAPPING/TASK3.py
TASK3.py
py
666
python
en
code
0
github-code
1
[ { "api_name": "json.load", "line_number": 3, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 22, "usage_type": "call" } ]
21532212683
# -*- coding: utf-8 -*- import scrapy from protectoras_scrap.models.Pet import Pet class ProtectoraLugoSpider(scrapy.Spider): name = 'protectora_lugo_spider' allowed_domains = ['www.protectoralugo.org'] base_url = 'http://www.protectoralugo.org/' start_urls = ['http://www.protectoralugo.org/templates/j...
SaulEiros/protectoras-scraper
protectoras_scrap/spiders/protectora_lugo_spider.py
protectora_lugo_spider.py
py
1,447
python
en
code
0
github-code
1
[ { "api_name": "scrapy.Spider", "line_number": 5, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 13, "usage_type": "call" }, { "api_name": "scrapy.Request", "line_number": 25, "usage_type": "call" }, { "api_name": "scrapy.Request", ...
264166147
"""django_obj URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.1/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-ba...
zhouf1234/django_obj
django_obj/urls.py
urls.py
py
1,554
python
en
code
0
github-code
1
[ { "api_name": "django.urls.path", "line_number": 22, "usage_type": "call" }, { "api_name": "django.urls.include", "line_number": 22, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 23, "usage_type": "call" }, { "api_name": "django.urls.inc...
73426657635
from time import sleep import requests def parsing_data(token_key, repos_list): url = "https://api.github.com/repos/{}/{}" headers = { "Accept": "application/vnd.github.v3+json", "Authorization": "token {}".format(token_key), # 此处的XXX代表上面的token "X-OAuth-Scopes": "repo" } urls =...
freedanfan/delete_gitlab_repositories
delete_gitlab_repositories.py
delete_gitlab_repositories.py
py
1,191
python
en
code
1
github-code
1
[ { "api_name": "requests.delete", "line_number": 24, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 25, "usage_type": "call" } ]
41440456232
from collections import deque from time import sleep def append_one(num): return int(str(num) + '1') def solution(num, target): queue = deque() queue.append([num, 0]) while(queue): cur_num, cur_cnt = queue.popleft() if cur_num == target: return cur_cnt + 1 ...
aszxvcb/TIL
BOJ/boj16953.py
boj16953.py
py
738
python
en
code
0
github-code
1
[ { "api_name": "collections.deque", "line_number": 8, "usage_type": "call" } ]
31326029236
# -*- coding: utf-8 -*- ### Import libraries ### import numpy as np import pandas as pd from pandas import Grouper import matplotlib.pyplot as plt import seaborn as sns color = sns.color_palette() sns.set_style(style="darkgrid") from data_utils import most_reviewed_products from pathlib import Path from ...
avivace/reviews-sentiment
scripts/data_exploration.py
data_exploration.py
py
14,076
python
en
code
25
github-code
1
[ { "api_name": "seaborn.color_palette", "line_number": 10, "usage_type": "call" }, { "api_name": "seaborn.set_style", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.rcParams", "line_number": 18, "usage_type": "name" }, { "api_name": "matplotli...
2396932646
import pathlib # directories DATA_DIR = pathlib.Path(__file__).resolve().parent.parent / "data" RESOURCE_DIR = pathlib.Path(__file__).resolve().parent.parent / "resources" MODEL_DIR = RESOURCE_DIR / "checkpoints" WSD_DIR = DATA_DIR / "wsd_corpora" TRAIN_DIR = DATA_DIR / "train" DEV_DIR = DATA_DIR / "dev" MAPPING_DIR =...
Riccorl/elmo-wsd
elmo-wsd/constants.py
constants.py
py
1,683
python
en
code
2
github-code
1
[ { "api_name": "pathlib.Path", "line_number": 4, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 5, "usage_type": "call" } ]
73268716835
import json test_list =\ [{"Title":"Harry Potter", "DVD":"T", "Form":"C", "Genre":"Fantasy", "Date":"2003", "Alt Title 1":"", "Alt Title 2":"", "Count":1, \ "Director":"Jon","Writer":"Rowling", "Language":"English", "Date Watched":"2019", "Spec":""}, \ {"Title":"Transformers", "DVD":"F", "Form":"B", "Genre...
Leeoku/MovieDatabase
main.py
main.py
py
789
python
en
code
0
github-code
1
[ { "api_name": "json.dumps", "line_number": 15, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 17, "usage_type": "call" } ]
74329843233
import numpy as np from sympy import Matrix import string import random dim = 2 #n차원 행렬 cipher = string.ascii_uppercase def main(): mode = input("Select Encrypt or Decrypt:") if mode == 'Encrypt': encrypt() elif mode == 'Decrypt': decrypt() def encrypt(): key = np.matrix([[1, 2], [2, 5]...
jeongyoonlee2015/Ciphers
Theoretical/hillCipher.py
hillCipher.py
py
1,602
python
en
code
1
github-code
1
[ { "api_name": "string.ascii_uppercase", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.matrix", "line_number": 15, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.matrix",...
30632192338
import argparse import json import os import platform import PySide6 as RefMod import PyInstaller.__main__ from mapclient.core.provenance import reproducibility_info from mapclient.settings.definitions import APPLICATION_NAME, FROZEN_PROVENANCE_INFO_FILE # Set Python optimisations on. os.environ['PYTHONOPTIMIZE'] ...
MusculoskeletalAtlasProject/mapclient
res/pyinstaller/create_application.py
create_application.py
py
3,596
python
en
code
19
github-code
1
[ { "api_name": "os.environ", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "mapclient.settings.defin...
2113231979
from __future__ import division from __future__ import print_function import numpy as np import gzip import re import datetime import calendar import time import glob from copy import deepcopy import warnings import sys import os import codecs from .tools import unix2date, date2unix, limitMaInidces, quantile from .to...
maahn/IMProToo
IMProToo/core.py
core.py
py
135,069
python
en
code
19
github-code
1
[ { "api_name": "importlib.metadata.version", "line_number": 29, "usage_type": "call" }, { "api_name": "importlib.metadata.PackageNotFoundError", "line_number": 30, "usage_type": "name" }, { "api_name": "pkg_resources.get_distribution", "line_number": 35, "usage_type": "cal...
2524008345
import matplotlib.pyplot as plt import cv2 import os, glob import numpy as np import matplotlib._png as png from moviepy.editor import VideoFileClip #%matplotlib inline #%config InlineBackend.figure_format = 'retina' def show_images(images, cmap=None): cols = 2 rows = (len(images) + 1) // cols plt.figur...
ghazalsaf/mobNavigation
road_detect_hls.py
road_detect_hls.py
py
10,716
python
en
code
0
github-code
1
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 16, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.subplot", "line_number": 18, "usage_type": "call" }, { "api_name": "...
538148120
import streamlit as st import datetime import requests import json import pandas as pd import time page = st.sidebar.selectbox('chose your page', ['users', 'checkin', 'checkout']) if page == 'users': st.title('ユーザー登録画面') with st.form(key='user'): username: str = st.text_input('ユーザー名', max_chars=12) ...
terotero57/tes
app.py
app.py
py
7,125
python
en
code
0
github-code
1
[ { "api_name": "streamlit.sidebar.selectbox", "line_number": 9, "usage_type": "call" }, { "api_name": "streamlit.sidebar", "line_number": 9, "usage_type": "attribute" }, { "api_name": "streamlit.title", "line_number": 12, "usage_type": "call" }, { "api_name": "stre...
70508257953
import itertools #taking input k=int(input()) a=list(map(int,input().split())) #generating prime numbers soe=[True]*(100000) for i in range(2,100000): if soe[i]==True: j=i+i while j<100000: soe[j]=False j+=i #storing prime numbers whith in given input p=[i for i in range(2,le...
jay8299/practice_cp
python_prac/smarttraining_infytq.py
smarttraining_infytq.py
py
572
python
en
code
0
github-code
1
[ { "api_name": "itertools.combinations", "line_number": 18, "usage_type": "call" } ]
9907501422
#!/usr/bin/env python3 import sys import re import sqlite3 import codecs season_length = 14 def __grab(term, lines): for line in lines: if term in line: return line def __get_line(term, lines): num = 0 for line in lines: num = num+1 if term in line: retur...
phantom-voltage/mortician
scripts/cdda.py
cdda.py
py
5,313
python
en
code
0
github-code
1
[ { "api_name": "sqlite3.connect", "line_number": 24, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 88, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 119, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 156, ...
35219965731
from ast import main import collections from statistics import mean import numpy as np import random from collections import defaultdict import matplotlib.pyplot as plt class MonteCarlo(): def __init__(self, gamma): self.actions = [(-1,0), (0,1), (1,0), (0,-1)] # up, right, down, left self.arrows ...
saurabhbajaj123/Reinforcement-Learning-Algorithms-1
HW4/submission/HW4.py
HW4.py
py
20,952
python
en
code
0
github-code
1
[ { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 31, "usage_type": "call" }, { "api_name": "collections.defaultdict", "li...
74112978272
from commands.Command import Command import discord import asyncio class Cat(Command): def __init__(self): super().__init__( { 'name': 'cat', 'description': 'extracts the text content of your file', 'argc': 1 } ) async de...
luccanunes/code-runner-bot
commands/Cat.py
Cat.py
py
1,045
python
en
code
0
github-code
1
[ { "api_name": "commands.Command.Command", "line_number": 6, "usage_type": "name" }, { "api_name": "discord.Message", "line_number": 16, "usage_type": "attribute" }, { "api_name": "discord.Embed", "line_number": 20, "usage_type": "call" }, { "api_name": "discord.Co...
1443567060
# -*- coding: utf-8 -*- """ Created on Wed Feb 9 12:39:55 2022 @author: pkinn """ def cvTrain(model, features, targets, nSplits, nEpochs, batchSz, initWts): from sklearn.model_selection import KFold import numpy as np kf = KFold(n_splits = nSplits, shuffle = True) fn = 1 # Define per-fold score co...
Tessier-Lab-UMich/Emi_Pareto_Opt_ML
cvTrain.py
cvTrain.py
py
1,305
python
en
code
14
github-code
1
[ { "api_name": "sklearn.model_selection.KFold", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 15, "usage_type": "call" } ]
36170270181
from abc import ABCMeta, abstractmethod from bisect import bisect_right from typing import Any, Dict, Iterable, List, Optional, Tuple from volatility3.framework import exceptions, interfaces from volatility3.framework.configuration import requirements from volatility3.framework.layers import linear class NonLinearly...
volatilityfoundation/volatility3
volatility3/framework/layers/segmented.py
segmented.py
py
6,939
python
en
code
1,879
github-code
1
[ { "api_name": "volatility3.framework.interfaces.layers", "line_number": 11, "usage_type": "attribute" }, { "api_name": "volatility3.framework.interfaces", "line_number": 11, "usage_type": "name" }, { "api_name": "abc.ABCMeta", "line_number": 11, "usage_type": "name" }, ...
34529095803
import copy import re from knack.log import get_logger from azdev.utilities import get_name_index logger = get_logger(__name__) _LOADER_CLS_RE = re.compile('.*azure/cli/command_modules/(?P<module>[^/]*)/__init__.*') def filter_modules(command_loader, help_file_entries, modules=None, include_whl_extensions=False...
Azure/azure-cli-dev-tools
azdev/operations/linter/util.py
util.py
py
4,677
python
en
code
71
github-code
1
[ { "api_name": "knack.log.get_logger", "line_number": 9, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 12, "usage_type": "call" }, { "api_name": "copy.copy", "line_number": 43, "usage_type": "call" }, { "api_name": "azdev.utilities.get_name_ind...
25922177105
from swift.common.swob import wsgify, HTTPInternalServerError, HTTPException from swift.common.utils import get_logger from zion.handlers import ProxyHandler from zion.handlers import ComputeHandler from zion.handlers import ObjectHandler from zion.handlers.base import NotFunctionRequest from distutils.util import strt...
JosepSampe/storage-functions
Engine/swift/middleware/zion/function_handler.py
function_handler.py
py
4,342
python
en
code
11
github-code
1
[ { "api_name": "swift.common.utils.get_logger", "line_number": 17, "usage_type": "call" }, { "api_name": "redis.ConnectionPool", "line_number": 23, "usage_type": "call" }, { "api_name": "zion.handlers.ProxyHandler", "line_number": 38, "usage_type": "name" }, { "api...
8243965245
import numpy as np import random import matplotlib.pyplot as plt import pickle class Dataset: def __init__(self): self.index = 0 self.obs = [] self.classes = [] self.num_obs = 0 self.num_classes = 0 self.indices = [] def __iter__(self): return self ...
moritzlangenberg/SCaML6
network.py
network.py
py
13,504
python
en
code
0
github-code
1
[ { "api_name": "random.shuffle", "line_number": 37, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 42, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 55, "usage_type": "call" }, { "api_name": "numpy.float32", "line_...
21358312248
__author__ = ["fkiraly"] from sktime.tests import test_all_estimators def pytest_addoption(parser): """Pytest command line parser options adder.""" parser.addoption( "--matrixdesign", default=False, help="sub-sample estimators in tests by os/version matrix partition design", ) d...
orgTestCodacy11KRepos110MB/repo-5089-sktime
conftest.py
conftest.py
py
499
python
en
code
0
github-code
1
[ { "api_name": "sktime.tests.test_all_estimators.MATRIXDESIGN", "line_number": 18, "usage_type": "attribute" }, { "api_name": "sktime.tests.test_all_estimators", "line_number": 18, "usage_type": "name" } ]
72184037154
import tqdm import torch import csv import os import os.path as osp import random import json import h5py import time from collections import defaultdict if __name__ == '__main__': from MiniImageNet import MiniImageNetDataset, TransformedImageLoader, h5load from base import MultiProcessImageLoader else: f...
alecwangcq/Prototypical-network
dataloader/MiniImageNetMAML.py
MiniImageNetMAML.py
py
7,428
python
en
code
0
github-code
1
[ { "api_name": "random.randrange", "line_number": 25, "usage_type": "call" }, { "api_name": "MiniImageNet.MiniImageNetDataset", "line_number": 30, "usage_type": "name" }, { "api_name": "random.shuffle", "line_number": 73, "usage_type": "call" }, { "api_name": "torc...
2724354165
from graphviz import Digraph import pandas as pd import numpy as np import glob import os #Associa cada cor na planilha a um par (cor de fundo,cor da fonte) do Graphviz colors = {'Amarelo':('yellow','black'),'Azul':('blue','white'),'Branco':('white','black'), 'Cinza':('grey','black'),'Marrom':('brown'...
lcoandrade/relationshipdiagram
diagrama_relacoes.py
diagrama_relacoes.py
py
7,035
python
pt
code
0
github-code
1
[ { "api_name": "pandas.read_excel", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.nan", "line_number": 34, "usage_type": "attribute" }, { "api_name": "graphviz.Digraph", "line_number": 70, "usage_type": "call" }, { "api_name": "glob.glob", "li...
4348600276
from pyspark.sql import SparkSession from pyspark.ml.feature import MinMaxScaler from pyspark.ml.linalg import Vectors spark = SparkSession.builder.appName('normalization').getOrCreate() spark.sparkContext.setLogLevel("WARN") print("### spark starting ###") records = [ (1, Vectors.dense([10.0, 10000.00, 1.0]),),...
yuyatinnefeld/spark
python/pyspark/ml_transformation/normalization.py
normalization.py
py
793
python
en
code
0
github-code
1
[ { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 5, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 5, "usage_type": "...
15166107096
import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import os all_models = pd.read_csv('model_results.csv') all_models['Accuracy'] = all_models['target_response'] folder = 'accuracy_plots' mymax = all_models.query('Task == "Different"').groupby( ['c', 'Representation', 'Category', 'Subcateg...
crasanders/vision
plot_model_accuracy.py
plot_model_accuracy.py
py
3,031
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "seaborn.catplot", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.savefig", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.p...
73033768993
# -*- coding: utf-8 -*- ''' The AWS Cloud Module ==================== The AWS cloud module is used to interact with the Amazon Web Services system. This module has been replaced by the EC2 cloud module, and is no longer supported. The documentation shown here is for reference only; it is highly recommended to change ...
shineforever/ops
salt/salt/cloud/clouds/botocore_aws.py
botocore_aws.py
py
7,499
python
en
code
9
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 60, "usage_type": "call" }, { "api_name": "salt.cloud.clouds.libcloud_aws.__opts__", "line_number": 83, "usage_type": "attribute" }, { "api_name": "salt.cloud.clouds.libcloud_aws", "line_number": 83, "usage_type": "name" ...