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
73675758266
"""VIEWS. List of endpoints identified at urls.py """ # -*- coding: utf-8 -*- import json from io import BytesIO from django.contrib.auth import authenticate, login, logout from django.http import HttpResponse from django.views.decorators.cache import never_cache, cache_page from django.views.decorators.csrf import cs...
Mosquito-Alert/mosquito_alert
tigapublic/views.py
views.py
py
20,621
python
en
code
6
github-code
6
[ { "api_name": "django.conf.settings.DATABASES", "line_number": 61, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 61, "usage_type": "name" }, { "api_name": "psycopg2.connect", "line_number": 62, "usage_type": "call" }, { "api_nam...
30358168611
import unittest from unittest import mock from pyface.api import OK from traits.api import Event, File, HasTraits from traitsui.api import FileEditor, Item, View from traitsui.tests._tools import ( BaseTestMixin, requires_toolkit, ToolkitName, ) from traitsui.testing.api import DisplayedText, KeyClick, Ke...
enthought/traitsui
traitsui/tests/editors/test_file_editor.py
test_file_editor.py
py
5,818
python
en
code
290
github-code
6
[ { "api_name": "traits.api.HasTraits", "line_number": 16, "usage_type": "name" }, { "api_name": "traits.api.File", "line_number": 18, "usage_type": "call" }, { "api_name": "traits.api.Event", "line_number": 20, "usage_type": "call" }, { "api_name": "traits.api.File...
29675360602
from dataclasses import dataclass import json from elephant_news.llm.llm import llm_api, Log, Message @dataclass class Source: id: int description: str source_type: str is_primary_source: bool is_available_online: bool def list_sources(article: str) -> list[Source]: log = Log("gpt-3.5-turbo...
MattUnderscoreZhang/TheWholeElephant
backend/elephant_news/analysis/sources.py
sources.py
py
1,172
python
en
code
1
github-code
6
[ { "api_name": "dataclasses.dataclass", "line_number": 7, "usage_type": "name" }, { "api_name": "elephant_news.llm.llm.Log", "line_number": 17, "usage_type": "call" }, { "api_name": "elephant_news.llm.llm.Message", "line_number": 30, "usage_type": "call" }, { "api_...
2002639200
# Day 8 (2023) from colorama import Fore, init import math # Initialize colorama init(autoreset=True) day = 8 #Edit this year = 2023 #Edit this def parse(): filepath = 'data/day' + str(day) + '.txt' with open(filepath, 'r') as f: input = f.readlines() return input def solve_part1(input): ...
przemekgrzesiak91/AoC
2023/day8.py
day8.py
py
2,010
python
en
code
0
github-code
6
[ { "api_name": "colorama.init", "line_number": 6, "usage_type": "call" }, { "api_name": "math.lcm", "line_number": 75, "usage_type": "call" }, { "api_name": "colorama.Fore.YELLOW", "line_number": 84, "usage_type": "attribute" }, { "api_name": "colorama.Fore", "...
5393499934
from flask_app import app from flask import redirect,request,render_template from flask_app.model.user import User @app.route('/') def all_users(): all_users = User.show_all() print(all_users) return render_template('index.html', users=all_users) @app.route('/form') def add_user(): return ...
Ndukwopeace/mysql_flask_assignments
Kalu_Ndukwo_peace_Users/flask_app/controller/user_routes.py
user_routes.py
py
633
python
en
code
0
github-code
6
[ { "api_name": "flask_app.model.user.User.show_all", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_app.model.user.User", "line_number": 7, "usage_type": "name" }, { "api_name": "flask.render_template", "line_number": 9, "usage_type": "call" }, { "a...
10742661707
# BasicAuthentication is the base class that we will inherit as our auth class, and we'll overwrite the default behaviour by using the authenticate method import jwt from django.conf import settings from rest_framework.authentication import BasicAuthentication from rest_framework.exceptions import PermissionDenied from...
justingrant94/BackEnd--Project4
jwt_auth/authentication.py
authentication.py
py
1,216
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 7, "usage_type": "call" }, { "api_name": "rest_framework.authentication.BasicAuthentication", "line_number": 10, "usage_type": "name" }, { "api_name": "rest_framework.exceptions.PermissionDenied", "line_number...
39061628756
import requests; import sys; from bs4 import BeautifulSoup; from bs4 import element; import json; import datetime; import os; import re; class download_xtract: def __init__(self, url): print("Download & Extraction Started......"); self.url = url; self.page = ""; self.sp = ""; ...
sivaswav/scrapper
download_xtract.py
download_xtract.py
py
2,817
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 25, "usage_type": "call" }, { "api_name": "sys.exc_info", "line_number": 32, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 37, "usage_type": "call" }, { "api_name": "sys.exc_info", "line_...
7572351450
import pylatlon import sys import os import logging import cartopy import cartopy.crs as ccrs from cartopy.io import shapereader from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER import matplotlib from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.ba...
MarineDataTools/pylatlon
pylatlon/pylatlon_gui.py
pylatlon_gui.py
py
12,178
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg", "line_number": 22, "usage_type": "name" }, { "api_name": "cartopy.crs.PlateCarree", "line_number": 23, "usage_type": "call" }, { "api_name": "cartopy.crs", "line_number": 23, "usage_type": "name" }, ...
5001400157
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json from django.shortcuts import render from django.http import HttpResponseRedirect, HttpResponse from django.core.urlresolvers import reverse from django.core.context_processors import csrf from django.views.generic import View from django.core.e...
duonghau/hoidap
question/views.py
views.py
py
7,709
python
en
code
0
github-code
6
[ { "api_name": "django.views.generic.View", "line_number": 17, "usage_type": "name" }, { "api_name": "models.Question.objects.get", "line_number": 21, "usage_type": "call" }, { "api_name": "models.Question.objects", "line_number": 21, "usage_type": "attribute" }, { ...
21700468285
import torchvision.transforms as T from torch.utils.data.dataloader import DataLoader import os.path as osp import glob import re import numpy as np import torch import copy import random from torch.utils.data import Dataset from torch.utils.data.sampler import Sampler from collections import defaultdict from PIL impor...
Cihsaing/SJDL-Foggy-Vehicle-Re-Identification--AAAI2022
SJDL/dataset.py
dataset.py
py
14,991
python
en
code
27
github-code
6
[ { "api_name": "PIL.ImageFile.LOAD_TRUNCATED_IMAGES", "line_number": 14, "usage_type": "attribute" }, { "api_name": "PIL.ImageFile", "line_number": 14, "usage_type": "name" }, { "api_name": "torchvision.transforms.Resize", "line_number": 22, "usage_type": "call" }, { ...
11296067457
import requests import constants import json data = { "a": "JGStockListox", "c": "JGTracking", "apiv": "w6", "Token": constants.token, "Type": 1, "OrderType": 0, "index": 0, "st": 40, "isPer": 1, "UserID": constants.userId, } ''' { "Time": 1511663560, "StockList": [{ ...
mykright/auto_stock_search
个人股东追踪.py
个人股东追踪.py
py
1,015
python
en
code
3
github-code
6
[ { "api_name": "constants.token", "line_number": 9, "usage_type": "attribute" }, { "api_name": "constants.userId", "line_number": 15, "usage_type": "attribute" }, { "api_name": "requests.post", "line_number": 48, "usage_type": "call" }, { "api_name": "json.loads", ...
72471332028
from flask import Blueprint from flask import render_template, flash, redirect, url_for, abort from flask import request from flask_login import current_user, login_required, login_user, logout_user from app.consts import INVALID_CREDENTIALS_MESSAGE, LOG_IN_MESSAGE, LOG_OUT_MESSAGE, TASK_CREATED_MESSAGE, TASK_DELETED_...
DBSantiago/flask-tasks-crud
app/views.py
views.py
py
4,336
python
en
code
0
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 13, "usage_type": "call" }, { "api_name": "models.User.get_by_id", "line_number": 18, "usage_type": "call" }, { "api_name": "models.User", "line_number": 18, "usage_type": "name" }, { "api_name": "flask.render_templa...
41251148827
import torch import torch.nn as nn from Transformer_Decoder import decoder , Trainer from my_models import my_model from torch.utils.data import DataLoader , Dataset import json # from torchvision.io.image import decode_png, read_image from torchvision.io import decode_png, read_image , ImageReadMode import torchvision...
toinnn/Torax_Xray-Health-Care
DinoV2.py
DinoV2.py
py
9,056
python
en
code
0
github-code
6
[ { "api_name": "torchvision.io.read_image", "line_number": 24, "usage_type": "call" }, { "api_name": "torchvision.io.ImageReadMode.GRAY", "line_number": 24, "usage_type": "attribute" }, { "api_name": "torchvision.io.ImageReadMode", "line_number": 24, "usage_type": "name" ...
70143317307
""" Iteratively reads all the tagged input_data sets corresponding to one particular politician. Creates one clean and correctly tagged training and validation text file as an input to the model fine tuning. To be called like this: python create_training_file.py <FULL_NAME_OF_POLITICIAN> """ import os import sys impo...
JokusPokus/TINART-finetuning
preprocessing/create_training_file.py
create_training_file.py
py
5,556
python
en
code
0
github-code
6
[ { "api_name": "nltk.data.download", "line_number": 15, "usage_type": "call" }, { "api_name": "nltk.data", "line_number": 15, "usage_type": "name" }, { "api_name": "os.listdir", "line_number": 59, "usage_type": "call" }, { "api_name": "os.path.join", "line_numb...
23595280071
from typing import Tuple, get_type_hints class a: x: Tuple[int, int] = (5, 19) clazz_dict = get_type_hints(a) clazz = clazz_dict['x'] if clazz._name == 'Tuple': print('a is a tuple, checked by name') if hasattr(clazz, '__origin__') and clazz.__origin__ == tuple: print('a is a tuple, checked by origin')...
songofhawk/simplerpa
test/test_for_typing/test_for_typing.py
test_for_typing.py
py
321
python
en
code
15
github-code
6
[ { "api_name": "typing.Tuple", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.get_type_hints", "line_number": 8, "usage_type": "call" } ]
30827920683
#If you use only cpu throw error https://huggingface.co/tiiuae/falcon-40b/discussions/3 #you have to have enough ram and gpu to run this model from transformers import AutoTokenizer, AutoModelForCausalLM import transformers import torch model = "tiiuae/falcon-7b" tokenizer = AutoTokenizer.from_pretrained(model) pipe...
ryuki8643/chainlit-huggingface-llm-demo-chat
models/tiiuae_falcon_7b.py
tiiuae_falcon_7b.py
py
940
python
en
code
0
github-code
6
[ { "api_name": "transformers.AutoTokenizer.from_pretrained", "line_number": 10, "usage_type": "call" }, { "api_name": "transformers.AutoTokenizer", "line_number": 10, "usage_type": "name" }, { "api_name": "transformers.pipeline", "line_number": 11, "usage_type": "call" }...
73075061307
# USAGE # python opencv_inpainting.py --image examples/example01.png --mask examples/mask01.png # import the necessary packages import argparse import cv2 # construct the argument parser and parse the arguments ap = argparse.ArgumentParser() ap.add_argument("-i", "--image", type=str, required=True, help="path input ...
frax0n/DIP
opencv_inpainting_enhancing.py
opencv_inpainting_enhancing.py
py
2,262
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.INPAINT_TELEA", "line_number": 23, "usage_type": "attribute" }, { "api_name": "cv2.INPAINT_NS", "line_number": 28, "usage_type": "attribute" }, { "api_name": "cv2...
40668562124
from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler, FileModifiedEvent, FileCreatedEvent from lib.index import hash_file from lib.anidb.endpoints import AuthRequest, LogoutRequest from os.path import isfile from threading import Timer from time import time from math import floor ...
prototo/animerenamerpythonappthreemillion
lib/watcher.py
watcher.py
py
2,939
python
en
code
0
github-code
6
[ { "api_name": "watchdog.events.FileSystemEventHandler", "line_number": 10, "usage_type": "name" }, { "api_name": "watchdog.events.FileSystemEventHandler", "line_number": 14, "usage_type": "name" }, { "api_name": "math.floor", "line_number": 24, "usage_type": "call" }, ...
12496630591
# 60min 소요 from collections import deque dr = [0, 1, 0, -1] dc = [1, 0, -1, 0] N, L, R = list(map(int, input().split())) board = [] for _ in range(N): board.append(list(map(int, input().split()))) now_update = True now_update_count = -1 # 모든 국가에서 주변 방문 가능 국가 탐색 + 인구수 업데이트 while now_update == Tr...
devappendCBangJ/Algorithm_Python
2_CodingTest/4_Simulation/Baekjoon_16234_인구 이동.py
Baekjoon_16234_인구 이동.py
py
4,180
python
ko
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 28, "usage_type": "call" } ]
12962608419
from __future__ import unicode_literals, absolute_import from collections import defaultdict from datetime import date from django.db.models import Q, F, QuerySet import pytest from django.test import RequestFactory from tri_declarative import class_shortcut from tri_form import ( Form, Field, ) from tests.mo...
jlubcke/tri.query
tests/test_query.py
test_query.py
py
18,315
python
en
code
4
github-code
6
[ { "api_name": "tri_struct.Struct", "line_number": 25, "usage_type": "name" }, { "api_name": "tri_query.Query", "line_number": 33, "usage_type": "name" }, { "api_name": "tri_query.Variable", "line_number": 34, "usage_type": "call" }, { "api_name": "tri_query.Variab...
73727640508
from scipy import sparse from sklearn.utils.graph_shortest_path import graph_shortest_path from sklearn.decomposition import PCA from sklearn import preprocessing from tqdm import tqdm import pickle import argparse import time import os import csv import json import numpy as np from scipy.sparse import coo_matrix from ...
bowang-lab/gcn-drug-repurposing
method/make_data.py
make_data.py
py
10,391
python
en
code
1
github-code
6
[ { "api_name": "csv.reader", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 45, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 46, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 4...
31306966651
import cv2 import numpy as np import pylab as pl from PIL import Image from PIL import ImageFilter import os import glob import Features # The input parameters are: # HGamma: gamma value of Gabor filter # HKernelSize: Kernel size of Gabor filter # HSig: Sigma value of Gabor filter # HWavelength: ...
gak97/multistream-audiovisual-speech-recognition
Gabor.py
Gabor.py
py
2,223
python
en
code
0
github-code
6
[ { "api_name": "os.path.exists", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path.join", "line_number"...
28105912421
# -*- coding: utf-8 -*- """ Created on Sun Jul 18 11:25:58 2021 @author: xiatong """ import json import pandas as pd import numpy as np import joblib import numpy as np import json import os import librosa import pandas as pd from sklearn import metrics from operator import itemgetter from scipy.fftpack import fft,h...
AAAEEEE/covid19-sounds-neurips
Respiratory_prediction/data/pickle_data.py
pickle_data.py
py
3,442
python
en
code
0
github-code
6
[ { "api_name": "librosa.load", "line_number": 32, "usage_type": "call" }, { "api_name": "librosa.effects.trim", "line_number": 33, "usage_type": "call" }, { "api_name": "librosa.effects", "line_number": 33, "usage_type": "attribute" }, { "api_name": "numpy.max", ...
36693987544
#!/usr/bin/env python3 from bs4 import BeautifulSoup import urllib.parse import requests import signal import json import time import sys cookies = { 'kktix_session_token_v2': '' } def getCSRFToken( event ): url = f"https://kktix.com/events/{ event }/registrations/new" print( f"-> { url }" ) r = reque...
d0gkiller87/OKTix
oktix.py
oktix.py
py
2,570
python
en
code
1
github-code
6
[ { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" }, { "api_name": "urllib.parse.parse.quote", "line_number": 26, "usage_type": "call" }, { "api_name": "urllib.parse....
6593035544
from pyspark.sql import SparkSession from pyspark.sql.functions import udf from pyspark.sql.types import IntegerType from pyspark.ml.feature import Tokenizer, StopWordsRemover, StringIndexer from pyspark.ml.feature import HashingTF, IDF from pyspark.ml import Pipeline from pyspark.ml.recommendation import ALS from pysp...
AngelaMina/Proyecto-Grupal-Amazon
finall.py
finall.py
py
3,608
python
es
code
1
github-code
6
[ { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 18, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 18, "usage_type"...
31836638335
import pymysql class vuelosDb: def __init__(self) -> None: self.connection = pymysql.connect( # si se ejecuta sin correr desde docker ya sea con nginx o con uvicorn el host es localhost o el ip de l servidor #host con valor mysql solo funciona si se ejecuta desde el docker-compose up -d...
mfluevano/XDIGITAL
wraperAPI/app/database.py
database.py
py
2,975
python
es
code
0
github-code
6
[ { "api_name": "pymysql.connect", "line_number": 6, "usage_type": "call" } ]
31267272941
import bpy, os, getpass, math, mathutils, logging from pprint import pprint # When bpy is already in local, we know this is not the initial import... if "bpy" in locals(): # ...so we need to reload our submodule(s) using importlib import importlib if "config" in locals(): importlib.reload(config) ...
OGRECave/blender2ogre
io_ogre/ui/importer.py
importer.py
py
11,020
python
en
code
187
github-code
6
[ { "api_name": "importlib.reload", "line_number": 10, "usage_type": "call" }, { "api_name": "importlib.reload", "line_number": 12, "usage_type": "call" }, { "api_name": "importlib.reload", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.getLogger"...
72531814269
"""alters product.login_settings Revision ID: 10b293fdcd56 Revises: 69957302b7ee Create Date: 2023-01-14 21:12:56.182870+00:00 """ import json import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = "10b293fdcd56" down_revision = ...
ITISFoundation/osparc-simcore
packages/postgres-database/src/simcore_postgres_database/migration/versions/10b293fdcd56_alters_product_login_settings.py
10b293fdcd56_alters_product_login_settings.py
py
2,248
python
en
code
35
github-code
6
[ { "api_name": "alembic.op.get_bind", "line_number": 23, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 23, "usage_type": "name" }, { "api_name": "sqlalchemy.DDL", "line_number": 24, "usage_type": "call" }, { "api_name": "json.dumps", "line_...
75093926586
import requests from datetime import datetime import smtplib import time # Seattle latitude and longitude MY_LAT = 47.606209 MY_LONG = -122.332069 # Email credentials MY_EMAIL = "dimitriyk25@gmail.com" MY_PASSWORD = "CLEARED" # International Space Station API longitude/latitude data response = requests.get(url="http...
deikaplan/100-Days-of-Code
Intermediate Projects/ISS Overhead Notification (API-Based)/main.py
main.py
py
2,200
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 29, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 43, "usage_type": "call" }, { "api_name": "datetime.datetime", ...
3755359880
import neptune_py.skeleton.neptune_rpc.remote_call as remote_call from neptune_py.skeleton.messager import NeptuneMessageType, NeptuneMessageTuple from neptune_py.skeleton import utils from neptune_py.common import EUniversalMessageField import json import logging class NeptuneEntityBase: def __init__(self, enti...
kstardust/neptune
neptune_py/skeleton/entity/entity.py
entity.py
py
4,425
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "neptune_py.skeleton.neptune_rpc.remote_call.NeptuneNestedRpc", "line_number": 14, "usage_type": "call" }, { "api_name": "neptune_py.skeleton.neptune_rpc.remote_call", "line_number": 1...
37562010198
import openpyxl workbook = openpyxl.Workbook() sheet = workbook.active sheet["A1"] = "테스트파일" sheet["A2"] = "hello openpyxl" sheet.merge_cells("A1:C1") sheet["A1"].font = openpyxl.styles.Font(size=20) workbook.save("newExcelFile.xlsx")
yathoo88/BigdataStudy
scraping_crawling/excel-sample.py
excel-sample.py
py
247
python
en
code
0
github-code
6
[ { "api_name": "openpyxl.Workbook", "line_number": 3, "usage_type": "call" }, { "api_name": "openpyxl.styles.Font", "line_number": 9, "usage_type": "call" }, { "api_name": "openpyxl.styles", "line_number": 9, "usage_type": "attribute" } ]
2828057632
from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index'), # search urls path('rs/<str:rest>', views.restaurant_search, name='restaurant_search'), path('ts/<str:tag>', views.tag_search, name='tag_search'), # user modification path('uc', views.user_...
arijitchabri/Food_Delivery
menu/urls.py
urls.py
py
763
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", ...
26471002941
""" Problem 86: Cuboid Route https://projecteuler.net/problem=86 Goal: Find the number of distinct cuboids (ignoring rotations) that can be formed (with integer dimensions and shortest route with integer length) up to a maximum size of MxMxM. Constraints: A <= M && B <= M && C <= M 1 <= M <= 4e5 This i...
bog-walk/project-euler-python
solution/batch8/problem86.py
problem86.py
py
4,828
python
en
code
0
github-code
6
[ { "api_name": "util.maths.reusable.pythagorean_triplet", "line_number": 70, "usage_type": "call" }, { "api_name": "util.maths.reusable.pythagorean_triplet", "line_number": 109, "usage_type": "call" }, { "api_name": "itertools.accumulate", "line_number": 122, "usage_type":...
18795833137
import argparse import docker import gzip import os import yaml from nested_lookup import nested_lookup if __name__ == "__main__": parser = argparse.ArgumentParser( description="Save Docker images") parser.add_argument("--manifest", required=True, help=...
milvus-io/milvus
deployments/offline/save_image.py
save_image.py
py
1,614
python
en
code
24,190
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "yaml.safe_load", "line_number": 28, "usage_type": "call" }, { "api_name": "nested_lookup.nested_lookup", "line_number": 29, "usage_type": "call" }, { "api_name": "os...
2274364242
import numpy as np import cv2 from PIL import Image, ImageEnhance import sys import scipy from scipy.spatial.distance import euclidean from scipy.spatial.distance import cosine from scipy import ndimage import math from matplotlib import pyplot as plt import glob import pickle import os class RGBHistog...
sarthikadhawan/Traffic-Sign-Recognition
Demo/cbir_histograms.py
cbir_histograms.py
py
3,631
python
en
code
0
github-code
6
[ { "api_name": "cv2.cvtColor", "line_number": 24, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2RGB", "line_number": 24, "usage_type": "attribute" }, { "api_name": "cv2.calcHist", "line_number": 26, "usage_type": "call" }, { "api_name": "cv2.normalize", ...
25925298892
import time from selenium.common import NoSuchElementException, StaleElementReferenceException, ElementNotInteractableException from DepartmentManagement import DepartmentManagement from Log_Update import test_update from Click_Handling import Erorr_Handling from PermissionManagement import PermissionManagement from U...
ahmadfadily/FinalProject_Selenium_Test
ControlPanel.py
ControlPanel.py
py
1,446
python
en
code
0
github-code
6
[ { "api_name": "Click_Handling.Erorr_Handling", "line_number": 16, "usage_type": "call" }, { "api_name": "Log_Update.test_update", "line_number": 20, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 25, "usage_type": "call" }, { "api_name": "Log_U...
37431905658
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' name: 实易DNS管理系统文件包含至远程代码执行 referer: http://www.wooyun.org/bugs/wooyun-2015-0122543 author: Lucifer description: 实易智能DNS管理系统,php CGI远程代码执行,文件包含。 ''' import sys import requests class forease_fileinclude_code_exec_BaseVerify(): def __init__(self, url): self....
iceyhexman/onlinetools
scanner/plugins/system/others/forease_fileinclude_code_exec.py
forease_fileinclude_code_exec.py
py
1,201
python
en
code
1,626
github-code
6
[ { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 35, "usage_type": "attribute" } ]
25502928494
from load_session import load_session from bill_object import Bill from flask import Response, redirect, session, Flask from flask_session import Session from dotenv import load_dotenv import os load_dotenv() secret_key = os.environ["SECRET_KEY"] def download_item(id): app = Flask(__name__) app.config["SESSI...
RyanWhitemore/billing_code
download_item.py
download_item.py
py
1,915
python
en
code
0
github-code
6
[ { "api_name": "dotenv.load_dotenv", "line_number": 8, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "flask_session.Session", ...
16710300284
import numpy as np from scipy.signal import find_peaks from scipy.integrate import trapezoid import time from multiprocessing import Pool, cpu_count import multiprocessing import multiprocessing.pool from tqdm import tqdm import sys sys.path.insert(0, 'TPC-utils') from tpc_utils import search_high_res from ..hdf.TPCH5_...
turinath/Spyral
pcutils/phases/Phase1.py
Phase1.py
py
7,275
python
en
code
1
github-code
6
[ { "api_name": "sys.path.insert", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "multiprocessing.Process", "line_number": 20, "usage_type": "attribute" }, { "api_name": "multiproce...
70879513148
import pytest import aoc_cj.aoc2016.day07 as d @pytest.mark.parametrize( "input, expected", [ ("abba[mnop]qrst", True), ("abcd[bddb]xyyx", False), ("aaaa[qwer]tyui", False), ("ioxxoj[asdfgh]zxcvbn", True), ], ) def test_supports_tls(input, expected): assert d.supports_...
cj81499/advent-of-code
tests/aoc2016/y2016d07_test.py
y2016d07_test.py
py
621
python
en
code
2
github-code
6
[ { "api_name": "aoc_cj.aoc2016.day07.supports_tls", "line_number": 16, "usage_type": "call" }, { "api_name": "aoc_cj.aoc2016.day07", "line_number": 16, "usage_type": "name" }, { "api_name": "pytest.mark.parametrize", "line_number": 6, "usage_type": "call" }, { "api...
10225988030
import torch from torch.nn.parameter import Parameter import numpy as np from torch.distributions.multivariate_normal import MultivariateNormal from torch.distributions.normal import Normal import pickle import copy import math import matplotlib import matplotlib.pyplot as plt class GPR(torch.nn.Module): """ ...
easonwang717/FedCor_prof
src/GPR.py
GPR.py
py
22,096
python
en
code
0
github-code
6
[ { "api_name": "torch.nn", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.nn.parameter.Parameter", "line_number": 38, "usage_type": "call" }, { "api_name": "torch.tensor", "line_number": 38, "usage_type": "call" }, { "api_name": "torch.zeros",...
26277277210
import json import logging import os import os.path as op import shutil import subprocess from Bio import AlignIO, SeqIO from Bio.PDB import PDBIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from elaspic.kmtools_legacy import switch_paths from . import ( call_foldx, call_modeller, call_tc...
elaspic/elaspic
elaspic/elaspic_model.py
elaspic_model.py
py
33,623
python
en
code
7
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "Bio.SeqIO.parse", "line_number": 48, "usage_type": "call" }, { "api_name": "Bio.SeqIO", "line_number": 48, "usage_type": "name" }, { "api_name": "os.path.splitext", "l...
610045140
import requests from datetime import datetime import smtplib import time MY_LAT = 28 MY_LONG = 50 def is_iss_overhead(): response_ISS = requests.get(url="http://api.open-notify.org/iss-now.json") response_ISS.raise_for_status() longitude_ISS = float(response_ISS.json()["iss_position"]["longitude"]) ...
Carloslb17/100-Days-of-Python---Angela
Day 33/ISS.py
ISS.py
py
1,557
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 28, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 36, "usage_type": "call" }, { "api_name": "datetime.datetime", ...
30479119190
from distutils.core import setup from setuptools import setup,setuptools import os with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme_file: readme = readme_file.read() os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-picsum', versi...
VarthanV/django-picsum
setup.py
setup.py
py
1,397
python
en
code
0
github-code
6
[ { "api_name": "os.path.join", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 4, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": ...
18390509321
#!/usr/bin/python # coding: utf-8 import scrapy class IMDBInfoSpider(scrapy.Spider): name = "imdb_info" custom_settings = {'DEFAULT_REQUEST_HEADERS': {'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'fr'}} #def make_requests_from_url(self, url): # ...
ria4/tln
util/old/crawlers/imdb/imdb_spider.py
imdb_spider.py
py
1,708
python
en
code
3
github-code
6
[ { "api_name": "scrapy.Spider", "line_number": 7, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 20, "usage_type": "call" } ]
21314542055
import snowflake.connector from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.asymmetric import rsa from cryptography.hazmat.primitives.asymmetric import dsa from cryptography.hazmat.primitives import serialization import pandas as pd import os from io import StringIO import b...
xiongye77/aws_sysops_tasks
snowflake.py
snowflake.py
py
1,937
python
en
code
1
github-code
6
[ { "api_name": "boto3.session.Session", "line_number": 14, "usage_type": "call" }, { "api_name": "boto3.session", "line_number": 14, "usage_type": "attribute" }, { "api_name": "cryptography.hazmat.primitives.serialization.load_pem_private_key", "line_number": 23, "usage_ty...
23711977611
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('products', '0001_initial'), ] operations = [ migrations.AddField( model_name='product', name='descri...
boiyelove/caremedics
products/migrations/0002_auto_20150914_0513.py
0002_auto_20150914_0513.py
py
1,401
python
en
code
0
github-code
6
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AddField", "line_number": 14, "usage_type": "call" }, { ...
37379644266
import torch import torch.nn as nn import torch.nn.functional as F num_classes = 21 def conv1x1(in_planes, out_planes, stride=1, bias=False): "1x1 convolution" return nn.Conv2d( in_planes, out_planes, kernel_size=1, stride=stride, padding=0, bias=bias ) class CRPBlock(nn.Module): def __init__...
faye0078/RS-ImgShp2Dataset
train_example/model/Fast_NAS/train/train/model_lw_v2.py
model_lw_v2.py
py
7,119
python
en
code
1
github-code
6
[ { "api_name": "torch.nn.Conv2d", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_numb...
3626533135
import numpy as np import matplotlib.pyplot as plt dt = 0.5 dx = 1. u = 1. max_x = 100. nt = 2000 x = np.arange(0.,max_x+dx,dx) print(x) print("Courant Number:", u*dt/dx) f = np.copy(x) f[:] = 0. f[(x>=40.)&(x<=60.)] = 1. #initial distribution of f #plt.plot(x,f) #plt.show() g = (f-np.roll(f,1,axis=0))/dx if(u>=0...
teeyingyap/partial-differential-eq
problem3/cipcode.py
cipcode.py
py
939
python
en
code
0
github-code
6
[ { "api_name": "numpy.arange", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.copy", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.roll", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.clf", "line_n...
36294818380
import numpy as np from statsmodels.tsa.stattools import adfuller # TODO: Add type hinting def gsadf(m:int, t:int, adflag:int=0, mflag:str="c"): qe = [0.9, 0.95, 0.99] r0 = 0.01 + 1.8 / np.sqrt(t) swindow0 = np.floor(r0 * t) dim = t - swindow0 + 1 y = dgp(t, m) gsadf_vals = np.ones((m, 1)) ...
mfjackson/multibubs
multibubs/stats.py
stats.py
py
3,717
python
en
code
1
github-code
6
[ { "api_name": "numpy.sqrt", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.floor", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 17, ...
13812707669
import os import urllib from google.appengine.api import users from google.appengine.ext import ndb import jinja2 import webapp2 JINJA_ENVIRONMENT = jinja2.Environment( loader=jinja2.FileSystemLoader(os.path.dirname(__file__)), extensions=['jinja2.ext.autoescape'], autoescape=True) PROJECT_DIR = os.path...
ShyAlon/RiskHedger
guestbook.py
guestbook.py
py
1,723
python
en
code
0
github-code
6
[ { "api_name": "jinja2.Environment", "line_number": 10, "usage_type": "call" }, { "api_name": "jinja2.FileSystemLoader", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", ...
36091610471
from copy import deepcopy from math import sqrt from torch import Tensor from torch.nn.modules import * from .base import Rotatable from functions import GroupLinearFunction, SequentialLinearFunction class SemisyncLinear(Linear, Rotatable): def __init__(self, linear: Linear, group_list: list = None):...
ryhoh/torch_async
layers/static.py
static.py
py
3,039
python
en
code
2
github-code
6
[ { "api_name": "base.Rotatable", "line_number": 11, "usage_type": "name" }, { "api_name": "copy.deepcopy", "line_number": 15, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 16, "usage_type": "call" }, { "api_name": "math.sqrt", "line_numb...
1787307500
# -*- coding: utf-8 -*- """ Created on Thu May 2 12:26:30 2019 @author: Guinex """ from kivy.app import App from kivy.uix.widget import Widget from kivy.properties import NumericProperty, ReferenceListProperty,\ ObjectProperty, StringProperty from kivy.vector import Vector from kivy.clock import Clock from kivy....
guinex/FirePong
pong.py
pong.py
py
6,330
python
en
code
1
github-code
6
[ { "api_name": "kivy.uix.widget.Widget", "line_number": 28, "usage_type": "name" }, { "api_name": "kivy.properties.NumericProperty", "line_number": 29, "usage_type": "call" }, { "api_name": "kivy.vector.Vector", "line_number": 36, "usage_type": "call" }, { "api_nam...
10936941582
import datetime palavra = 'escola' frase = 'Escola do Futuro Luiz Rassi' caractere = "F" #print(type(caractere)) #concatenação de strings (string interpolation) #f-strings nome = 'Thalles' titulo = 'professor' print(f'Olá, {titulo} {nome}.') a = 5 b = 3 print(f'A soma de {a} com {b} é igual a {a + b}.') #%-formatt...
thallesbruno/logica-de-programacao
tipos_basicos/strings.py
strings.py
py
578
python
pt
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 24, "usage_type": "attribute" } ]
33584425555
from datetime import datetime from fastapi_users_db_sqlalchemy import SQLAlchemyBaseUserTable from sqlalchemy import MetaData, Column, Integer, String, TIMESTAMP, ForeignKey, Boolean from src.database import Base metadata = MetaData() class Client(SQLAlchemyBaseUserTable[int], Base): __tablename__ = "client" ...
verondel/fast_chat
src/models.py
models.py
py
2,525
python
en
code
0
github-code
6
[ { "api_name": "sqlalchemy.MetaData", "line_number": 7, "usage_type": "call" }, { "api_name": "fastapi_users_db_sqlalchemy.SQLAlchemyBaseUserTable", "line_number": 9, "usage_type": "name" }, { "api_name": "src.database.Base", "line_number": 9, "usage_type": "name" }, {...
17882906317
import traceback from typing import Tuple import click from demisto_sdk.commands.format.format_constants import (ERROR_RETURN_CODE, SKIP_RETURN_CODE, SUCCESS_RETURN_CODE) from demisto_sdk.commands.forma...
AdouniH/demisto-sdk
demisto_sdk/commands/format/update_pre_process_rules.py
update_pre_process_rules.py
py
2,396
python
en
code
null
github-code
6
[ { "api_name": "demisto_sdk.commands.format.update_generic_json.BaseUpdateJSON", "line_number": 14, "usage_type": "name" }, { "api_name": "demisto_sdk.commands.format.format_constants.SKIP_RETURN_CODE", "line_number": 31, "usage_type": "name" }, { "api_name": "typing.Tuple", "...
40945225891
from io import StringIO import json import pytest import import_organizations @pytest.fixture() def organizations(): return [ { "organization_key": "ff3959a49ac10fc70181bc00e308fbeb", "organization_name": "Super Mario", "created_at": "2018-01-24 17:28:09.000000", ...
a-grever/coding-challenge-20210403
warehouse/tests/test_import_organizations.py
test_import_organizations.py
py
1,930
python
en
code
0
github-code
6
[ { "api_name": "pytest.fixture", "line_number": 9, "usage_type": "call" }, { "api_name": "io.StringIO", "line_number": 29, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 29, "usage_type": "call" }, { "api_name": "import_organizations.get_organiz...
10764762863
from dataclasses import dataclass from datetime import timedelta import os import pandas as pd import unicodedata import codecs from io import StringIO from enum import Enum import logging import re log = logging.getLogger(__name__) @dataclass class CsvCol: index: int name: str class SourceType(Enum): ...
pawelciurka/money-insights
project/parsers.py
parsers.py
py
9,123
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "dataclasses.dataclass", "line_number": 15, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 21, "usage_type": "name" }, { "api_name": "dataclasses.datacla...
26040581416
from __future__ import annotations import os from dataclasses import dataclass from typing import Iterable from pants.backend.kotlin.subsystems.kotlin import KotlinSubsystem from pants.backend.kotlin.target_types import ( KotlinJunitTestsGeneratorSourcesField, KotlinJunitTestsGeneratorTarget, KotlinSource...
pantsbuild/pants
src/python/pants/backend/kotlin/goals/tailor.py
tailor.py
py
2,734
python
en
code
2,896
github-code
6
[ { "api_name": "pants.core.goals.tailor.PutativeTargetsRequest", "line_number": 30, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 29, "usage_type": "call" }, { "api_name": "typing.Iterable", "line_number": 34, "usage_type": "name" }, { ...
72437271549
from flask import g, request import sqlite3 import datetime DB_PATH = "ndio.db" def get_db(): try: conn = sqlite3.connect(DB_PATH) return conn except Exception as e: print("Could not connect to the database. Error: ", e) return None def _do_query(query:str, args = (), one=Fal...
nvplus/ndio
webserver/flask-backend/ndb.py
ndb.py
py
2,758
python
en
code
0
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.g.db.execute", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.g.db", "line_number": 17, "usage_type": "attribute" }, { "api_name": "flask.g", "line...
6398844401
#%% from datetime import timedelta from os.path import basename, join from re import findall from time import time import numpy as np from joblib import dump, load from skimage.exposure import rescale_intensity from skimage.io import imread_collection from skimage.util import img_as_bool from sklearn.base import BaseE...
dunnkers/bsc-thesis
src/transform.py
transform.py
py
10,894
python
en
code
2
github-code
6
[ { "api_name": "constants.N_FOLDS", "line_number": 24, "usage_type": "argument" }, { "api_name": "constants.FEATURE_VECTOR", "line_number": 25, "usage_type": "argument" }, { "api_name": "sklearn.base.BaseEstimator", "line_number": 28, "usage_type": "name" }, { "api...
35836966928
#!/usr/bin/env python3 # -*- encoding:utf-8 -*- # @Author : Haoran Pan # Date: 2022/03/07 from datetime import datetime __author__ = ("Haoran Pan") __copyright__ = "Copyright (c) 2019-{}, Haoran Pan".format(datetime.now().year) __email__ = "haoranpan@foxmail.com" __license__ = "BSD" __status__ = "Developm...
valderpan/PYHR
__init__.py
__init__.py
py
348
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "name" } ]
72939128188
import numpy as np from scipy.special import logit, expit from scipy.optimize import minimize from .helpers import truncate_by_g, mse, cross_entropy, truncate_all_by_g from .att import att_estimates def _perturbed_model_bin_outcome(q_t0, q_t1, g, t, eps): """ Helper for psi_tmle_bin_outcome Returns q_\e...
claudiashi57/dragonnet
src/semi_parametric_estimation/ate.py
ate.py
py
3,726
python
en
code
207
github-code
6
[ { "api_name": "scipy.special.logit", "line_number": 17, "usage_type": "call" }, { "api_name": "scipy.special.expit", "line_number": 19, "usage_type": "call" }, { "api_name": "helpers.truncate_all_by_g", "line_number": 26, "usage_type": "call" }, { "api_name": "sci...
13231258792
""" @Author : Hirsi @ Time : 2020/7/2 """ """ 1.导入模块 2.通过模块提供的Process类创建进程对象 3.启动进程 """ import multiprocessing import time def work(): for i in range(5): print('正在运行work...',i) time.sleep(0.5) if __name__ == '__main__': p1 = multiprocessing.Process(target=work) p1.start() print('xxx...
gitHirsi/PythonNotes02
day07-多任务-进程/01-进程的基本使用.py
01-进程的基本使用.py
py
375
python
en
code
0
github-code
6
[ { "api_name": "time.sleep", "line_number": 17, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 20, "usage_type": "call" } ]
30984215070
import random from utils import get_resource_ids, get_available_resources, get_activities_for_resource from resource import Resource class GreedyAllocator: resources = {} workload = 1 def __init__(self, workload): self.workload = workload return def fit(self, data, salary): ...
brrrachel/MLinBPM
code/allocator/greedy.py
greedy.py
py
1,849
python
en
code
0
github-code
6
[ { "api_name": "utils.get_resource_ids", "line_number": 16, "usage_type": "call" }, { "api_name": "utils.get_activities_for_resource", "line_number": 20, "usage_type": "call" }, { "api_name": "resource.Resource", "line_number": 21, "usage_type": "call" }, { "api_na...
22949938203
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # rfclass.py - Waqas Bhatti (wbhatti@astro.princeton.edu) - Dec 2017 # License: MIT. See the LICENSE file for more details. '''Does variable classification using random forests. Two types of classification are supported: - Variable classification using non-periodic featu...
waqasbhatti/astrobase
astrobase/varclass/rfclass.py
rfclass.py
py
23,036
python
en
code
50
github-code
6
[ { "api_name": "logging.DEBUG", "line_number": 32, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 34, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 35, "usage_type": "call" }, { "api_name": "logging.basicC...
35126893080
from datetime import date """ Esta tarea esta diseñada para poner a prueba los conocimientos adquiridos en la primera clase de la Certificacion de Python Son 6 ejercicios, resuelvalos en un solo archivo :: Debera separarlos por comentarios e impresiones :: >Puede reutilizar los valores de las variables< :D """ #Ejerci...
LRFranco21/prueba-de-git1
Clase 1 - 10.Sept - Tarea.py
Clase 1 - 10.Sept - Tarea.py
py
3,048
python
es
code
0
github-code
6
[ { "api_name": "datetime.date", "line_number": 81, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 82, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 82, "usage_type": "name" } ]
40893470335
#Nome: Leonardo Rodrigues Ribeiro #RA: 0040972123041 ''' Um matemático está precisando de um programa que calcule a SEQUÊNCIA DE FIBONACCI. SEQUÊNCIA DE FIBONACCI é uma sucessão de números que, misteriosamente, aparece em muitos fenômenos da natureza. Descrita no final do século 12 pelo italiano Leonardo Fibonacci,...
LeoNardoRR/studying_repository
Python/Fibonacci/Fibonacci.py
Fibonacci.py
py
2,394
python
pt
code
0
github-code
6
[ { "api_name": "openpyxl.Workbook", "line_number": 61, "usage_type": "call" } ]
35616214837
# https://adventofcode.com/2020/day/21 from collections import defaultdict, Counter from functools import reduce def read(source): for _ in open(source): ingredients, _, allergens = _[:-2].partition(" (contains ") yield set(ingredients.split()), set(allergens.split(", ")) def solve(source): ...
P403n1x87/aoc
2020/21/code.py
code.py
py
1,267
python
en
code
2
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 14, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 16, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 23, "usage_type": "call" }, { "api_name": "functool...
13321465244
from airflow.models import Variable from airflow.hooks.postgres_hook import PostgresHook import requests def remove_deleted_tags(ds, *args, **kwargs): if "client" not in kwargs or kwargs["client"] is None: raise Exception("You must configure a client for this operator") headers = {"Authorization-Toke...
CrossingsCommunityChurch/apollos-shovel
dags/rock/rock_deleted_tags.py
rock_deleted_tags.py
py
2,705
python
en
code
0
github-code
6
[ { "api_name": "airflow.models.Variable.get", "line_number": 10, "usage_type": "call" }, { "api_name": "airflow.models.Variable", "line_number": 10, "usage_type": "name" }, { "api_name": "airflow.hooks.postgres_hook.PostgresHook", "line_number": 13, "usage_type": "call" ...
7146667131
# -*- coding: utf-8 -*- """ Created on Fri Jun 24 15:28:18 2016 @author: aurelia """ import tensorflow as tf import numpy as np from tensorflow.python.ops.rnn import dynamic_rnn import tensorflow.contrib.slim as slim import copy from scipy.ndimage.interpolation import shift from tensorflow.python.ops.rnn_cell import ...
aureliale/BONN-model
policies/bonn_policy.py
bonn_policy.py
py
17,114
python
en
code
8
github-code
6
[ { "api_name": "tensorflow.python.ops.rnn_cell.RNNCell", "line_number": 20, "usage_type": "name" }, { "api_name": "tensorflow.nn", "line_number": 25, "usage_type": "attribute" }, { "api_name": "tensorflow.variable_scope", "line_number": 45, "usage_type": "call" }, { ...
14702968477
import re from datetime import datetime, timedelta from parser import ParserError from city_scrapers_core.constants import BOARD, COMMITTEE from city_scrapers_core.spiders import CityScrapersSpider from dateutil.parser import parse from city_scrapers.items import Meeting class CaHighspeedRailSpider(CityScrapersSpid...
washabstract/city-scrapers-ca
city_scrapers/spiders/ca_highspeed_rail.py
ca_highspeed_rail.py
py
4,728
python
en
code
1
github-code
6
[ { "api_name": "city_scrapers_core.spiders.CityScrapersSpider", "line_number": 12, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 32, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 32, "usage_type": "name" }, { ...
25972392613
#!/usr/bin/env python3 """%(prog)s [OPTIONS] COLUMN [COLUMNS] [FILES] Extract the specified columns from FILES or stdin. Column numbering starts at 1, not 0; column 0 is the entire line, just like awk. Column numbers that are out of bounds are silently ignored. When each line is split, empty leading or trailing colu...
tobinjt/bin
python/colx.py
colx.py
py
5,993
python
en
code
2
github-code
6
[ { "api_name": "typing.List", "line_number": 33, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 42, "usage_type": "call" }, { "api_name": "argparse.RawDescriptionHelpFormatter", "line_number": 45, "usage_type": "attribute" }, { "api...
529608651
from zope import interface from zope.component import getUtility from zope.proxy import removeAllProxies from zope.traversing.api import getParents from zope.app.intid.interfaces import IIntIds from zc.catalog.index import SetIndex, parseQuery from interfaces import IPathIndex class PathIndex(SetIndex): interfac...
Zojax/zojax.pathindex
src/zojax/pathindex/index.py
index.py
py
1,807
python
en
code
1
github-code
6
[ { "api_name": "zc.catalog.index.SetIndex", "line_number": 11, "usage_type": "name" }, { "api_name": "zope.interface.implements", "line_number": 12, "usage_type": "call" }, { "api_name": "interfaces.IPathIndex", "line_number": 12, "usage_type": "argument" }, { "api...
43050449408
from scipy.stats import bernoulli from actionManagement import StandardActionManagement from components import ComputationState, LearningStage, ReceiverAction, ReceiverState, RewardsInEpisode, SenderAction, SenderState, Settings, Movement from Walls import getMyWalls, choosePrizeLocation, isItInTheWalls from gridUI imp...
dgwarlug47/Treasure-Hunt
trainTest.py
trainTest.py
py
6,615
python
en
code
0
github-code
6
[ { "api_name": "Walls.getMyWalls", "line_number": 8, "usage_type": "call" }, { "api_name": "Walls.choosePrizeLocation", "line_number": 9, "usage_type": "call" }, { "api_name": "components.ReceiverAction", "line_number": 18, "usage_type": "call" }, { "api_name": "co...
19501433632
""" This file (test_video.py) contains unit tests for the video.py file. """ from pathlib import Path import os import warnings import numpy as np from youbit.video import VideoEncoder, VideoDecoder from youbit.settings import Settings from youbit.types import ndarr_1d_uint8 from youbit import util TEST_VIDEO_ENCOD...
mevimo/youbit
tests/unit/test_video.py
test_video.py
py
1,297
python
en
code
651
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 19, "usage_type": "name" }, { "api_name": "youbit.types.ndarr_1d_uint8", "line_number": 19, "usage_type": "name" }, { "api_name": "youbit.video.VideoEncoder", "line_number": 22, "usage_type": "call" }, { "api_name": "yo...
25993210589
__copyright__ = "Copyright 2016, Netflix, Inc." __license__ = "LGPL Version 3" import os import unittest import config from routine import train_test_on_dataset from tools.misc import import_python_file class TestTrainOnDataset(unittest.TestCase): def setUp(self): self.train_dataset = import_python_fil...
henrylee18/vmaf
python/test/routine_test.py
routine_test.py
py
1,881
python
en
code
0
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 12, "usage_type": "attribute" }, { "api_name": "tools.misc.import_python_file", "line_number": 15, "usage_type": "call" }, { "api_name": "config.ROOT", "line_number": 16, "usage_type": "attribute" }, { "api_name": ...
6100518065
import boto3 import requests import time def create_input_s3_presigned_url(aws_key = '', aws_secret = '', bucket_name = '', input_file = ''): # Instantiate Boto Client s3_client = boto3.client('s3', aws_access_key_id = aws_key, aws_secret_access_key = ...
codylocks/dolpy
dolpy.py
dolpy.py
py
7,762
python
en
code
0
github-code
6
[ { "api_name": "boto3.client", "line_number": 8, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 22, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 37, "usage_type": "call" }, { "api_name": "requests.post", "line_numbe...
17189518398
import torch.nn as nn class SimpleCNN(nn.Module): def __init__(self, num_classes=7): super(SimpleCNN, self).__init__() self.conv1 = nn.Conv2d(3, 16, kernel_size=3, padding=1) # Change the input channels from 1 to 3 self.conv2 = nn.Conv2d(16, 32, kernel_size=3, padding=1) self.conv...
ml19z5s/FER2013
models/SimpleCNN.py
SimpleCNN.py
py
987
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 4, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.nn", "line_numbe...
69821032829
from django.urls import path from . import views urlpatterns = [ # RENDER URLS path("", views.index, name="index"), path("login", views.login_view, name="login"), path("logout", views.logout_view, name="logout"), path("register", views.register, name="register"), path("new_idea", views.new_id...
XpTo2k/bright-network
network/urls.py
urls.py
py
692
python
en
code
0
github-code
6
[ { "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", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", ...
74805771708
"""APP Module with all the available endpoints and the FastAPI initialization. """ # # Native # # from typing import Optional, Set # # Installed # # import uvicorn from fastapi import FastAPI, Response, Query, HTTPException # # Project # # from vigobusapi.entities import Stop, Stops, BusesResponse from vigobusapi.re...
David-Lor/VigoBusAPI
vigobusapi/app.py
app.py
py
3,089
python
en
code
12
github-code
6
[ { "api_name": "fastapi.FastAPI", "line_number": 22, "usage_type": "call" }, { "api_name": "vigobusapi.settings.settings.api_name", "line_number": 23, "usage_type": "attribute" }, { "api_name": "vigobusapi.settings.settings", "line_number": 23, "usage_type": "name" }, ...
42641542575
import os import sys import logging import argparse import subprocess import pkg_resources import timeout_decorator from os.path import join, exists, basename @timeout_decorator.timeout(20) def try_entry_cmd(entry_cmd, cwd=None): logging.warning("calling the entry script: %s", entry_cmd) # execute the comma...
osssanitizer/maloss
src/pm_proxy/scripts/main.py
main.py
py
4,916
python
en
code
98
github-code
6
[ { "api_name": "logging.warning", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 17, "usage_type": "call" }, { "api_name": "subprocess.call", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.info", "line...
36040435906
import logging import re import sys import typing from ParadoxTrading.Engine import ActionType, DirectionType, FillEvent, \ OrderEvent, OrderType, PortfolioAbstract, SignalEvent, SignalType from ParadoxTrading.EngineExt.Futures.PointValue import POINT_VALUE from ParadoxTrading.Fetch import FetchAbstract from Parad...
ppaanngggg/ParadoxTrading
ParadoxTrading/EngineExt/Futures/TickPortfolio.py
TickPortfolio.py
py
4,740
python
en
code
51
github-code
6
[ { "api_name": "ParadoxTrading.Engine.PortfolioAbstract", "line_number": 13, "usage_type": "name" }, { "api_name": "ParadoxTrading.Fetch.FetchAbstract", "line_number": 20, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 27, "usage_type": "attribute" }...
26088089514
import numpy as np import matplotlib.pyplot as plt import nengo """ This example demonstrates how to create a neuronal ensemble that represents a two-dimensional signal. Network diagram: [Input] ---> (Neurons) Network behaviour: Neurons = Input """ model = nengo.Model('2D Representation') model.make_node...
jaberg/nengo
examples/2drepresentation.py
2drepresentation.py
py
987
python
en
code
0
github-code
6
[ { "api_name": "nengo.Model", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 21, "usage_type": "attribute" }, { "api_name": "numpy.cos", "line_number": 22, "usage_type": "attribute" }, { "api_name": "nengo.LIF", "line_numbe...
28729408696
import time from keras.preprocessing.image import ImageDataGenerator from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten from keras.layers import Convolution2D, MaxPooling2D from keras.callbacks import History, ModelCheckpoint, Callback import numpy as np import matplotlib.p...
chasingbob/character-vision
cnn_train.py
cnn_train.py
py
4,045
python
en
code
0
github-code
6
[ { "api_name": "keras.models.Sequential", "line_number": 19, "usage_type": "call" }, { "api_name": "keras.layers.Convolution2D", "line_number": 20, "usage_type": "call" }, { "api_name": "keras.layers.Activation", "line_number": 21, "usage_type": "call" }, { "api_na...
6455520010
"""JSON parser for Stats Perform MA1 feeds.""" from typing import Any, Dict import unidecode # type: ignore from ...base import MissingDataError from .base import OptaJSONParser, assertget class MA1JSONParser(OptaJSONParser): """Extract data from a Stats Perform MA1 data stream. Parameters ---------- ...
Unaimd/socceraction
socceraction/data/opta/parsers/ma1_json.py
ma1_json.py
py
3,544
python
en
code
null
github-code
6
[ { "api_name": "base.OptaJSONParser", "line_number": 10, "usage_type": "name" }, { "api_name": "base.MissingDataError", "line_number": 22, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.Any", ...
14851959621
from collections import namedtuple import fileinput import torch from fairseq import checkpoint_utils, options, tasks, utils from fairseq.data import encoders import sys, os, random import cgi, ssl, json, urllib from http.server import HTTPServer, BaseHTTPRequestHandler import numpy as np from pprint import pprint ...
jack-and-rozz/speculative_sampling
fairseq/demo.py
demo.py
py
11,972
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 15, "usage_type": "call" }, { "api_name": "collections.namedtuple", ...
40667994422
import os import sys import h5py import math import yaml import copy import numpy as np from docopt import docopt from sprocket.model.f0statistics import F0statistics from utils.utils import write_hdf5, check_hdf5, read_hdf5, read_txt from utils.param_feat import acoustic_parameter from utils.multi_process...
bigpon/QPNet
src/runFE.py
runFE.py
py
6,082
python
en
code
13
github-code
6
[ { "api_name": "docopt.docopt", "line_number": 26, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 27, "usage_type": "attribute" }, { "api_name": "utils.param_path.SRC_DIR", "line_number": 27, "usage_type": "name" }, { "api_name": "utils.param_fe...
5446630124
# -*- coding: utf-8 -*- """ Created on Wed Dec 7 09:40:20 2016 @author: Zhi Chen Here we present a L-convolutional/pooling layer CNN model, i.e., trying to catpture the distinct features of the original images for detection, where again no ML libary is utilised for better understanding the whole procedure....
chenzhi2223/machine-learning-and-intelligent-applications
cnn_from_scratch.py
cnn_from_scratch.py
py
66,980
python
en
code
0
github-code
6
[ { "api_name": "skcuda.linalg.init", "line_number": 28, "usage_type": "call" }, { "api_name": "skcuda.linalg", "line_number": 28, "usage_type": "name" }, { "api_name": "six.moves.cPickle.load", "line_number": 55, "usage_type": "call" }, { "api_name": "six.moves.cPi...
28555726150
#!/usr/bin/env/python3 """ Author: Robert van der Klis Student number: 1003241 Script to do pathway enrichment analysis on Arabidopsis Thaliana Usage: python3 pathway_enrichment.py aracyc_pathways sample_list aracyc_pathways: tsv file of aracyc arabidopsis pathways with genes sample_list: txt file of all .tsv files wit...
Anna-MarieSeelen/Advanced_Bioinformatics_project
python/pathway_enrichment.py
pathway_enrichment.py
py
7,328
python
en
code
0
github-code
6
[ { "api_name": "scipy.stats.fisher_exact", "line_number": 123, "usage_type": "call" }, { "api_name": "scipy.stats", "line_number": 123, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 141, "usage_type": "name" }, { "api_name": "sys.argv", "line...
15198929275
import pickle from warnings import catch_warnings import numpy as np from flask import Flask, redirect, render_template, request, jsonify, flash app = Flask(__name__) @app.route('/') def index(): return render_template('home.html') @app.route('/predict', methods=['GET', 'POST']) def predictor(): model = ...
MayurPimpude/Loan-prediction
app.py
app.py
py
1,716
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 9, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.request.method", ...
71133294907
import sqlite3 import os from torch.utils.data import Dataset from PIL import Image from io import BytesIO class SQLDataset(Dataset): def __init__(self, db_path, table_name, task_name, train_val=True, transform=None): super().__init__() self.db_path = db_path self.table_name = table_name ...
WooDwayToneTion/cl_competition
load_data.py
load_data.py
py
3,747
python
en
code
0
github-code
6
[ { "api_name": "torch.utils.data.Dataset", "line_number": 8, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 32, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 32, "usage_type": "name" }, { "api_name": "io.BytesIO", "li...
1165374122
import secrets import json import subprocess import os from pathlib import Path from hcs_2.provision_hcs_priv import InProvisionerPriv2, ProvisionerPriv2 from hcs_2.provision_hcs_pub import InProvisionerPub2, ProvisionerPub2 # VARIABLES folder_hcs_sys_platform = "hcs-sys-platform" vpn_secret_data_file = "secret.json" ...
leonardpahlke/hcs-direct-connect
provision_hcs_2.py
provision_hcs_2.py
py
4,597
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 37, "usage_type": "call" }, { "api_name": "json.load", "line_number": 40, "usage_type": "call" }, { "api_name": "secrets.token_urlsafe", "line_number": 45, "usage_type": "call" }, { "api_name": "json.dump", "line_nu...
24124413785
#!/usr/bin/env python3 import functools from select import select import pyudev import requests from evdev import InputDevice, categorize, ecodes # Replace with your BarcodeBuddy URL SERVER_ADDRESS = 'http://10.0.20.2/barcodebuddy/api/' # Replace with your Barcode Buddy API key API_KEY = 'MyApiKey' # Replace with an...
Forceu/barcodebuddy
example/grabInput_variant3.py
grabInput_variant3.py
py
3,770
python
en
code
358
github-code
6
[ { "api_name": "pyudev.Context", "line_number": 17, "usage_type": "call" }, { "api_name": "pyudev.Monitor.from_netlink", "line_number": 19, "usage_type": "call" }, { "api_name": "pyudev.Monitor", "line_number": 19, "usage_type": "attribute" }, { "api_name": "evdev....
7606767381
from collections import defaultdict from email.mime.multipart import MIMEMultipart import email.mime.text from email.mime.image import MIMEImage from pathlib import Path import jinja2 from .. import chart class Email(MIMEMultipart): def __init__(self, name, context): super().__init__('related') ...
thomasleese/gantt-charts
ganttcharts/emails/emails.py
emails.py
py
2,902
python
en
code
0
github-code
6
[ { "api_name": "email.mime.multipart.MIMEMultipart", "line_number": 12, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "call" }, { "api_name": "email.mime.image.MIMEImage", "line_number": 21, "usage_type": "call" }, { "api_na...
18296859706
# Importing stock ml libraries import warnings warnings.simplefilter('ignore') import numpy as np import pandas as pd from tqdm import tqdm from sklearn import metrics import transformers import torch from torch.utils.data import Dataset, DataLoader, RandomSampler, SequentialSampler from transformers import DistilBertT...
drndr/multilabel-text-clf
Transformers/distilbert_model_multi_label.py
distilbert_model_multi_label.py
py
9,617
python
en
code
13
github-code
6
[ { "api_name": "warnings.simplefilter", "line_number": 3, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.ERROR", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.enviro...
20921290836
import numpy as np import matplotlib.pyplot as plt from objective_functions.flat_clustering import modularity from clustering_algorithms.louvain import louvain from clustering_algorithms.paris import paris def resolution_n_clusters(G, k=40, n_tests=100, file_name =""): # Paris D = paris(G) resolutions_pari...
sharpenb/Multi-Scale-Modularity-Graph-Clustering
Scripts/experiments/resolution_analysis.py
resolution_analysis.py
py
2,868
python
en
code
2
github-code
6
[ { "api_name": "clustering_algorithms.paris.paris", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 12, "usage_type": "name" }, { "api_n...
32820621511
import json import time from operation.operation import top class Statistic: def __init__(self, stats): self.time_stats = time.strftime("%I:%M:%S %p", time.localtime()) self.interfaces_stats = stats['if'] self.disks_stats = stats['disk'] self.processes_stats = stats['process'] ...
malveillantspathologiques/snmp_monitoring
domain/Statistic.py
Statistic.py
py
711
python
en
code
0
github-code
6
[ { "api_name": "time.strftime", "line_number": 10, "usage_type": "call" }, { "api_name": "time.localtime", "line_number": 10, "usage_type": "call" }, { "api_name": "operation.operation.top", "line_number": 15, "usage_type": "call" }, { "api_name": "json.dumps", ...
13538932966
import numpy as np import random from itertools import compress from sklearn.preprocessing import normalize from sklearn.metrics.pairwise import euclidean_distances def normalise_vector(vector): if np.isnan(vector).any(): return np.array((0, 0)) else: return normalize(vector.reshape(1, -1))[0]...
SimonCarryer/video_game_ai
util/helpers.py
helpers.py
py
9,158
python
en
code
2
github-code
6
[ { "api_name": "numpy.isnan", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 10, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.normalize", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.linalg.n...
18670358089
import cv2 img = cv2.imread('Lenna_(test_image).png') text = 'open Cv' org = (150, 150) fontFace = cv2.FONT_HERSHEY_COMPLEX fontScale = 2 color = (0, 255, 0) thickness = 3 cv2.putText(img, text, org, fontFace, fontScale, color, thickness) cv2.imshow('text', img) cv2.waitKey() cv2.destroyAllWindows()
mir-iam/cv_practicals
lab5/draw_text_on_an_image.py
draw_text_on_an_image.py
py
301
python
en
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 2, "usage_type": "call" }, { "api_name": "cv2.FONT_HERSHEY_COMPLEX", "line_number": 5, "usage_type": "attribute" }, { "api_name": "cv2.putText", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.imshow", "l...