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
6877383992
#from IPython.display from PIL import Image from PIL import ImageDraw from PIL import ImageFont from IPython.display import display from IPython.core.display import HTML import json from pprint import pprint import os import time #import md5 import hashlib import os from aliyunsdkcore.profile import region_provider ...
jhs2jhs/AlibabaCloud_ImageSearch_Demo_py2
myutil.py
myutil.py
py
8,204
python
en
code
1
github-code
36
[ { "api_name": "os.listdir", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path", "line_number": 30, "usage_type": "attribute" }, { "api_name": "base64.b64encode", "line_num...
6994057460
from lib.cuckoo.common.abstracts import Signature class AndroidGooglePlayDiff(Signature): name = "android_google_play_diff" description = "Application Permissions On Google Play Differ (Osint)" severity = 3 categories = ["android"] authors = ["Check Point Software Technologies LTD"] minimum = "...
cuckoosandbox/community
modules/signatures/android/android_google_play_diff.py
android_google_play_diff.py
py
867
python
en
code
312
github-code
36
[ { "api_name": "lib.cuckoo.common.abstracts.Signature", "line_number": 3, "usage_type": "name" } ]
41935148033
import json import re from datetime import datetime from newspaper import Article i = 0 # id number file_path="./MK.json" news_format_json = {} news_format_json['MK'] = [] for y in range(2020, 2021): for m in range(1, 2): for n in range(0, 10001): url = "https://www.mk.co.kr/news...
hyeonoir/Stocksnet
MK.py
MK.py
py
1,571
python
en
code
0
github-code
36
[ { "api_name": "newspaper.Article", "line_number": 15, "usage_type": "call" }, { "api_name": "re.search", "line_number": 34, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 35, "usage_type": "call" }, { "api_name": "datetime.datet...
43062682888
import json import scrapy from scrapy.crawler import CrawlerProcess def decodeEmail(e): de = "" k = int(e[:2], 16) for i in range(2, len(e) - 1, 2): de += chr(int(e[i:i + 2], 16) ^ k) return de headers = { 'Host': 'ufcstats.com', 'Upgrade-Insecure-Requests': '1', 'User-Agent':...
frankamania/Scrapers
ufcstats.com/ufcstats.com_parse_player_data.py
ufcstats.com_parse_player_data.py
py
3,749
python
en
code
0
github-code
36
[ { "api_name": "scrapy.Spider", "line_number": 28, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 31, "usage_type": "call" }, { "api_name": "scrapy.Request", "line_number": 34, "usage_type": "call" }, { "api_name": "scrapy.Request", "li...
9748891676
from flask import request, Blueprint, abort from models.alarm import Alarm from models.response import ResponseJSON alarm_routes = Blueprint("alarm", __name__, url_prefix="/server/alarm") @alarm_routes.route("/", methods=["POST"]) def add_alarm(): if not request.json or 'name' not in request.json: abort...
byUNiXx/kivy_flask_gps
server/src/routes/alarm.py
alarm.py
py
1,817
python
en
code
0
github-code
36
[ { "api_name": "flask.Blueprint", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.request.json", "line_number": 11, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 11, "usage_type": "name" }, { "api_name": "flask.abort", ...
71654885545
import sys import re import ranges def read_cleanup_file(filename, full_overlaps_only): sum = 0 with open(filename, 'r') as fp: for line in fp: toks = re.split(',|-', line.strip()) if len(toks) != 4: raise Exception('wrong line format. tokens: %s' % toks) ...
dakopoulos/aoc22
day4/main.py
main.py
py
1,004
python
en
code
0
github-code
36
[ { "api_name": "re.split", "line_number": 9, "usage_type": "call" }, { "api_name": "ranges.Range", "line_number": 12, "usage_type": "call" }, { "api_name": "ranges.Range", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 21, ...
13491582898
from datetime import datetime import csv, os class File: def __init__(self, name, date): self.fr = None self.fw = None self.fa = None self.filename = f"./files/{name}_{date}.csv" def filename_change(self, filename): self.filename = filename def file_write(self, titl...
jjaekkaemi/dgsb_app
file.py
file.py
py
1,697
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.now", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 26, "usage_type": "call" }, { "api_name": "datetim...
43552330299
import pytest from rest_framework import status from tests.factories import JobFactory @pytest.mark.django_db def test_selection_create(client, user_access_token): user, access_token = user_access_token job_list = JobFactory.create_batch(10) data = { "name": "Название подборки", "items":...
VyacheslavTim/Lesson31
tests/selection/selection_test.py
selection_test.py
py
750
python
en
code
0
github-code
36
[ { "api_name": "tests.factories.JobFactory.create_batch", "line_number": 10, "usage_type": "call" }, { "api_name": "tests.factories.JobFactory", "line_number": 10, "usage_type": "name" }, { "api_name": "rest_framework.status.HTTP_201_CREATED", "line_number": 26, "usage_typ...
36319285982
from random import randint from Savedata import Savedata from entity.Entity import EntInt from entity.Player import Player from entity.Enemy.Boss import Boss from entity.Enemy.Malicious import Malicious from entity.Enemy.SimpleEnemy import SimpleEnemy from entity.item.Shield import Shield from entity.item.CadenceUp imp...
2doupo/Shooter
Levels/Level.py
Level.py
py
5,657
python
en
code
0
github-code
36
[ { "api_name": "Savedata.Savedata", "line_number": 15, "usage_type": "name" }, { "api_name": "pygame.font.Font", "line_number": 16, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pygame.font.Font"...
30167619288
from itertools import combinations import random # If true, extra inforamtion will appear DEBUG = False # O(n*log(n)) def greedy(v, w, W): n = len(w) profit = [(0, i) for i in range(n)] x = [False for i in range(n)] for i in range(n): profit[i] = (v[i]/w[i],i) profit.sort(key = lambda profit: prof...
X-V-III/OK2020
algorithms.py
algorithms.py
py
3,274
python
en
code
1
github-code
36
[ { "api_name": "itertools.combinations", "line_number": 52, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 86, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 89, "usage_type": "call" }, { "api_name": "random.random", ...
41903865929
import sys from django.db.models import Avg, Variance from django.shortcuts import render from rest_framework import generics from rest_framework.decorators import api_view, parser_classes from rest_framework.generics import ListCreateAPIView from rest_framework.parsers import JSONParser from rest_framework.response i...
harjiwiga/exchange_rate
exchangerateapp/views.py
views.py
py
6,788
python
en
code
0
github-code
36
[ { "api_name": "models.ExchangeRate.objects.all", "line_number": 18, "usage_type": "call" }, { "api_name": "models.ExchangeRate.objects", "line_number": 18, "usage_type": "attribute" }, { "api_name": "models.ExchangeRate", "line_number": 18, "usage_type": "name" }, { ...
7052172062
from django.core.context_processors import csrf from django.shortcuts import render_to_response from django.http import HttpResponse, HttpResponseRedirect from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import Authenti...
sawardekar/Django_OTP
otpapp/views.py
views.py
py
5,575
python
en
code
1
github-code
36
[ { "api_name": "forms.RegistrationForm", "line_number": 17, "usage_type": "call" }, { "api_name": "twilio.rest.Client", "line_number": 22, "usage_type": "call" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 35, "usage_type": "call" }, { "api_na...
5049967399
import array import struct from contextlib import contextmanager from typing import List, Tuple from cuda import cudart from cuda.cudart import cudaError_t from .mapping import Mapping def _raise_if_error(error: cudaError_t): if error != cudaError_t.cudaSuccess: raise RuntimeError(error) @contextmanag...
NVIDIA/TensorRT-LLM
tensorrt_llm/_ipc_utils.py
_ipc_utils.py
py
3,753
python
en
code
3,328
github-code
36
[ { "api_name": "cuda.cudart.cudaError_t", "line_number": 12, "usage_type": "name" }, { "api_name": "cuda.cudart.cudaError_t.cudaSuccess", "line_number": 13, "usage_type": "attribute" }, { "api_name": "cuda.cudart.cudaError_t", "line_number": 13, "usage_type": "name" }, ...
36963468353
import setuptools with open("README.md") as fh: long_description = fh.read() setuptools.setup( name="pysqueezebox", version="0.7.1", license="apache-2.0", author="Raj Laud", author_email="raj.laud@gmail.com", description="Asynchronous library to control Logitech Media Server", long_des...
rajlaud/pysqueezebox
setup.py
setup.py
py
572
python
en
code
10
github-code
36
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 16, "usage_type": "call" } ]
4705074588
import functools import pandas as pd import numpy as np import periodictable as pt from pathlib import Path from tinydb import TinyDB, Query from .transform import formula_to_elemental from ..util.meta import pyrolite_datafolder from ..util.database import _list_tindyb_unique_values import logging logging.getLogger(__...
skerryvore/pyrolite
pyrolite/mineral/mindb.py
mindb.py
py
4,362
python
en
code
null
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.NullHandler", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "util.meta.pyr...
74059611623
from configs import ssd300 as cfg import torch import torchvision.transforms as transforms def base_transform(size): transform = transforms.Compose([ transforms.Resize(size), transforms.ToTensor() ]) return transform class BaseTransform: def __init__(self, size, mean): self.si...
alswlsghd320/SSD_pytorch
datasets/transforms.py
transforms.py
py
2,372
python
en
code
1
github-code
36
[ { "api_name": "torchvision.transforms.Compose", "line_number": 7, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 7, "usage_type": "name" }, { "api_name": "torchvision.transforms.Resize", "line_number": 8, "usage_type": "call" }, { "...
17796457144
from __future__ import absolute_import, division, print_function, unicode_literals import uuid from contextlib import contextmanager from pants.backend.codegen.thrift.java.java_thrift_library import JavaThriftLibrary from pants.backend.codegen.thrift.java.thrift_defaults import ThriftDefaults from pants.build_graph.t...
fakeNetflix/twitter-repo-pants
tests/python/pants_test/backend/codegen/thrift/java/test_thrift_defaults.py
test_thrift_defaults.py
py
2,046
python
en
code
0
github-code
36
[ { "api_name": "pants_test.test_base.TestBase", "line_number": 12, "usage_type": "name" }, { "api_name": "pants.backend.codegen.thrift.java.thrift_defaults.ThriftDefaults", "line_number": 14, "usage_type": "name" }, { "api_name": "pants.backend.codegen.thrift.java.thrift_defaults....
23195728404
from django.http import HttpResponse from django.shortcuts import render from config import settings #from email.message import EmailMessage from django.core.mail import EmailMessage # Create your views here. def home(request): return render(request,"index.html") def send_email(request): if request.method=='...
utkir-dev/Send-Email
smtp/views.py
views.py
py
855
python
en
code
0
github-code
36
[ { "api_name": "django.shortcuts.render", "line_number": 10, "usage_type": "call" }, { "api_name": "django.core.mail.EmailMessage", "line_number": 19, "usage_type": "call" }, { "api_name": "config.settings.EMAIL_HOST_USER", "line_number": 22, "usage_type": "attribute" },...
72152970345
import os, glob, math import numpy as np import tensorflow as tf from PIL import Image from myutils_tf import bwutils def save_4ch_to_3ch(path_pixel_shift): print(path_pixel_shift) files = glob.glob(os.path.join(path_pixel_shift, '*.npy')) # print(files) for idx, file in enumerate(files): if...
samsungexpert/snu
myinference_srgb2raw_tf.py
myinference_srgb2raw_tf.py
py
4,612
python
en
code
1
github-code
36
[ { "api_name": "glob.glob", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.load", "line_number": 1...
36955645899
import os import helper, wiredtiger, wttest from wtscenario import make_scenarios # test_prefetch01.py # Test basic functionality of the prefetch configuration. class test_prefetch01(wttest.WiredTigerTestCase): new_dir = 'new.dir' conn_avail = [ ('available', dict(available=True)), ('not-a...
mongodb/mongo
src/third_party/wiredtiger/test/suite/test_prefetch01.py
test_prefetch01.py
py
2,236
python
en
code
24,670
github-code
36
[ { "api_name": "wttest.WiredTigerTestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "wtscenario.make_scenarios", "line_number": 27, "usage_type": "call" }, { "api_name": "os.mkdir", "line_number": 37, "usage_type": "call" }, { "api_name": "help...
2796043458
import argparse import os from glob import glob import json import jellyfish from text_extraction import Rectangle, AUTHOR_LABEL, DESCRIPTION_LABEL import re import pandas as pd from tqdm import tqdm ap = argparse.ArgumentParser() ap.add_argument("-i", "--input-folder", required=True, help="Folder with the json file")...
paulguhennec/Cini-Project
Process-Images/ocr_evaluation.py
ocr_evaluation.py
py
4,367
python
en
code
null
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "glob.glob", ...
5603935400
from django.urls import path from . import views app_name = 'base' urlpatterns = [ path('home/', views.landing_page, name='home'), path('school_registered/', views.school_list_page, name='school_registered'), path('contact_us/', views.contact_us_page, name='contact_us'), ]
zuri-training/Project-My-Debtors-Team-38
SDM/base/urls.py
urls.py
py
293
python
en
code
2
github-code
36
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" } ]
29421162955
import firebase_admin from firebase_admin import credentials, firestore import os from gcloud import storage from pprint import pprint from datetime import datetime import ast from django import template INDEX = 1 INDEX_historic = 1 INDEX_cv = 1 # Setup the connexion to the project cred = credentials.Certificate("./w...
SnipeHR/SnipeHR-github.io
website/query_firestore.py
query_firestore.py
py
12,180
python
en
code
0
github-code
36
[ { "api_name": "firebase_admin.credentials.Certificate", "line_number": 15, "usage_type": "call" }, { "api_name": "firebase_admin.credentials", "line_number": 15, "usage_type": "name" }, { "api_name": "firebase_admin.initialize_app", "line_number": 17, "usage_type": "call"...
26716825256
""" Support for random optimizers, including the random-greedy path. """ import functools import heapq import math import numbers import time from collections import deque from random import choices as random_choices from random import seed as random_seed from typing import Any, Dict, Generator, Iterable, List, Option...
dgasmith/opt_einsum
opt_einsum/path_random.py
path_random.py
py
14,478
python
en
code
764
github-code
36
[ { "api_name": "typing.Optional", "line_number": 72, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 89, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 90, "usage_type": "name" }, { "api_name": "typing.Dict", "line_numbe...
4872107449
import pyriemann import mne from mne.io import read_raw_gdf import scipy from scipy import signal from scipy.signal import butter, filtfilt, sosfiltfilt import os import pickle import sklearn import seaborn as sns import matplotlib import matplotlib as mpl mpl.use('Qt5Agg') # for using pyplot (pip install...
Kyungho-Won/PyRiemann-with-OpenViBE
train_MI_Riemann.py
train_MI_Riemann.py
py
4,441
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.use", "line_number": 14, "usage_type": "call" }, { "api_name": "scipy.signal.butter", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.newaxis", "li...
34301681133
import matplotlib matplotlib.use('TKAgg') import matplotlib.pyplot as plt import matplotlib.dates as mdates from dateutil import parser import numpy as np import pandas as pd import datetime df_ferrara = pd.read_csv('WeatherData/ferrara_270615.csv') df_milano = pd.read_csv('WeatherData/milano_270615.csv') df_mantov...
eternity-phoenix/Private
气象数据分析/气象线性分析.py
气象线性分析.py
py
4,432
python
zh
code
0
github-code
36
[ { "api_name": "matplotlib.use", "line_number": 3, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.read_csv", "...
11538129042
""" Sandbox URL Configuration """ from django.conf import settings from django.conf.urls import url from django.views.generic.base import TemplateView from sandbox.views import BasicSampleFormView, ModesSampleFormView urlpatterns = [ # Dummy homepage to list demo views url(r'^$', TemplateView.as_view( ...
sveetch/djangocodemirror
sandbox/urls.py
urls.py
py
947
python
en
code
31
github-code
36
[ { "api_name": "django.conf.urls.url", "line_number": 14, "usage_type": "call" }, { "api_name": "django.views.generic.base.TemplateView.as_view", "line_number": 14, "usage_type": "call" }, { "api_name": "django.views.generic.base.TemplateView", "line_number": 14, "usage_ty...
40126491559
import json from typing import Any, Dict, List, Optional, Set from clairvoyance.entities import GraphQLPrimitive from clairvoyance.entities.context import log from clairvoyance.entities.primitives import GraphQLKind class Schema: """Host of the introspection data.""" def __init__( self, quer...
nikitastupin/clairvoyance
clairvoyance/graphql.py
graphql.py
py
12,718
python
en
code
785
github-code
36
[ { "api_name": "typing.Dict", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 17, "usage_type": "name" }, { "api_name": "clairvoyance.entities.GraphQLPrimitive.STRING", "line_number": 43, "usage_type": "attribute" }, { "api_nam...
6215124822
from rodi import RoDI import time robot = RoDI() def reubicar(): robot.move_stop() robot.pixel(20,0,0) robot.move_backward() time.sleep(0.1) robot.move_left() time.sleep(0.5) robot.move_forward() time.sleep(0.5) def ataque(): robot.move(100,100) while True: try: dist...
devpbeat/bootcamp
rob.py
rob.py
py
921
python
es
code
0
github-code
36
[ { "api_name": "rodi.RoDI", "line_number": 4, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 10, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 12, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 14, ...
9036950970
from datetime import datetime from sqlalchemy import Column, String, Integer, Float, DateTime, select, delete from sqlalchemy.exc import IntegrityError, NoResultFound from sqlalchemy.ext.asyncio import AsyncSession from app.services.database import Base class TokenInfo(Base): __tablename__ = "TokenInfo" crea...
treybrooks/TopCryptosAPI
api/app/models.py
models.py
py
1,243
python
en
code
0
github-code
36
[ { "api_name": "app.services.database.Base", "line_number": 9, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 11, "usage_type": "call" }, { "api_name": "sqlalchemy.DateTime", "line_number": 11, "usage_type": "argument" }, { "api_name": "s...
1522352511
import cv2, time, pandas from datetime import datetime firstFrame = None statusList = [None, None] times = [] contourCount = [] frameCount = [] avgContour = [] contCStart = 0 #indicator to start recording contour area video = cv2.VideoCapture(0, cv2.CAP_DSHOW) df = pandas.DataFrame(columns=["Start","End"]...
Caseyar95/MotionDetectingWebcam
VideoCapture2.py
VideoCapture2.py
py
3,169
python
en
code
0
github-code
36
[ { "api_name": "cv2.VideoCapture", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.CAP_DSHOW", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.cvtColor", ...
5145048204
from .range_borders import Date, FromInfinity, ToInfinity from datetime import timedelta class DateRange: """ This class implements date ranges that support open borders, so it is possible to create date ranges that contain all dates up to a specific date or all dates from a specific date on. Strict r...
tlie03/OpenDateRange
src/openDateRange/date_range.py
date_range.py
py
3,833
python
en
code
0
github-code
36
[ { "api_name": "range_borders.FromInfinity", "line_number": 27, "usage_type": "call" }, { "api_name": "range_borders.Date", "line_number": 29, "usage_type": "call" }, { "api_name": "range_borders.ToInfinity", "line_number": 32, "usage_type": "call" }, { "api_name":...
6790838721
from django.db import models from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.fields import GenericRelation from model_utils.models import TimeStampedModel from files.mixins import UploadedFileMixin from permis...
tomasgarzon/exo-services
service-exo-core/forum/models/post.py
post.py
py
6,189
python
en
code
0
github-code
36
[ { "api_name": "mixins.PostPermissionsMixin", "line_number": 22, "usage_type": "name" }, { "api_name": "mixins.PostMetricMixin", "line_number": 23, "usage_type": "name" }, { "api_name": "mixins.PostStatsMixin", "line_number": 24, "usage_type": "name" }, { "api_name...
11538242087
from PIL import Image, ImageDraw cella = 75 def rect(x1, y1, x2, y2, col): dib.polygon([(x1, y1), (x2, y1), (x2, y2), (x1, y2)], col) def cercle(x, y, col): dib.ellipse([cella*x + 25, cella*y + 25, cella*x + 49, cella*y + 49], col) c = int(input()) f = int(input()) img = Image.new('RGB', (cella*c, cella*f...
oicatalana/solucions_oicat_2019
concurs_classificatori2/pb6.py
pb6.py
py
1,255
python
en
code
1
github-code
36
[ { "api_name": "PIL.Image.new", "line_number": 19, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 19, "usage_type": "name" }, { "api_name": "PIL.ImageDraw.Draw", "line_number": 20, "usage_type": "call" }, { "api_name": "PIL.ImageDraw", "line_...
18180968433
# Student Virtual Assistant # Libraries for accessing Google Scholar and scheduling reminders import webbrowser import schedule import time # Function to access Google Scholar def search_scholar(query): webbrowser.open(f"https://scholar.google.com/scholar?q={query}") # Function to input schedule def in...
macnya/Student_virtual_assistant
Student_VA.py
Student_VA.py
py
1,790
python
en
code
0
github-code
36
[ { "api_name": "webbrowser.open", "line_number": 10, "usage_type": "call" }, { "api_name": "schedule.every", "line_number": 56, "usage_type": "call" }, { "api_name": "schedule.run_pending", "line_number": 60, "usage_type": "call" }, { "api_name": "time.sleep", ...
37241864515
#!/usr/bin/python3 """ Run this with: python3 -m http.server --cgi """ import cgitb cgitb.enable(format="text") from helper import get_input, json # user_input = get_input() test_data = { "firstName": "John", "lastName": "Smith", "age": 27 } # Will give you JSON output in the console print(json.dumps(tes...
Alexico1969/Points-Sandbox
cgi-bin/api.py
api.py
py
415
python
en
code
0
github-code
36
[ { "api_name": "cgitb.enable", "line_number": 10, "usage_type": "call" }, { "api_name": "helper.json.dumps", "line_number": 23, "usage_type": "call" }, { "api_name": "helper.json", "line_number": 23, "usage_type": "name" } ]
72084597543
from setuptools import setup, find_packages with open("requirements.txt") as f: content = f.readlines() requirements = [x.strip() for x in content if "git+" not in x] setup(name='chord-cleaning', description='creating a set of standardized chords from data', install_requires=requirements, packag...
emilycardwell/chord-cleaning
setup.py
setup.py
py
341
python
en
code
0
github-code
36
[ { "api_name": "setuptools.setup", "line_number": 7, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 10, "usage_type": "call" } ]
8265346084
import csv import os import sys from typing import List from termcolor import colored from tqdm import tqdm from .binaryds import BinaryDs MINIMUM_FEATURES: int = 32 csv.field_size_limit(sys.maxsize) def run_preprocess(input_dir: List[str], category: int, output_dir: str, openc: bool, features: ...
inoueke-n/optimization-detector
src/preprocess.py
preprocess.py
py
7,391
python
en
code
3
github-code
36
[ { "api_name": "csv.field_size_limit", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.maxsize", "line_number": 12, "usage_type": "attribute" }, { "api_name": "typing.List", "line_number": 15, "usage_type": "name" }, { "api_name": "os.path.exists", ...
41133433788
from cryptography.fernet import Fernet import os from pathlib import Path default_path = Path("/home/Diode/Dicot/VisionIOT/main") if not os.path.exists(default_path): os.makedirs(default_path) filen = os.path.join(default_path, "app.dat") open(filen, 'w').close() forread = open(filen) content = fo...
imdiode/PythonExper
home4.py
home4.py
py
502
python
en
code
0
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number"...
22209534047
# -*- coding: utf-8 -*- """ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in...
terual/sbcc
module/functions.py
functions.py
py
2,415
python
en
code
2
github-code
36
[ { "api_name": "logging.error", "line_number": 53, "usage_type": "call" }, { "api_name": "os.devnull", "line_number": 57, "usage_type": "argument" }, { "api_name": "subprocess.Popen", "line_number": 60, "usage_type": "call" }, { "api_name": "logging.critical", ...
32033182710
#!/usr/bin/env python3 # -*- coding:utf-8 -*- """ @author:ai @file:rootNet.py @time:2020/06/01 """ import traceback import warnings from collections import defaultdict import arrow import pandas as pd from configs.riskConfig import FUTURE_ENDS from tradingSystem import Order from configs.Database import mysql, Databas...
Joey2634/MultiFactorFramework
tradingSystem/CATS/catsserverapi/UseAITrading/rootNet.py
rootNet.py
py
11,539
python
en
code
0
github-code
36
[ { "api_name": "arrow.now", "line_number": 34, "usage_type": "call" }, { "api_name": "utils.Date.getTradeSectionDates", "line_number": 35, "usage_type": "call" }, { "api_name": "tradingSystem.rootNet.RootNetTrading.RootNetTrading", "line_number": 36, "usage_type": "call" ...
27049180203
from datetime import datetime from django.core.management.base import BaseCommand from django.utils.timezone import now from django.conf import settings from django.core.files.uploadedfile import SimpleUploadedFile from django.utils.translation import gettext as _ from imap_tools import MailBox, AND from filebrowser....
andywar65/project_repo
blog/management/commands/fetch_article_emails.py
fetch_article_emails.py
py
2,479
python
en
code
2
github-code
36
[ { "api_name": "django.utils.translation.gettext", "line_number": 18, "usage_type": "call" }, { "api_name": "django.utils.translation.gettext", "line_number": 19, "usage_type": "call" }, { "api_name": "django.utils.translation.gettext", "line_number": 20, "usage_type": "ca...
13329932727
import json from channels.generic.websocket import WebsocketConsumer from django.contrib.auth.models import User from gestion_admin.models import Article, Historique class ChatConsumer(WebsocketConsumer): def connect(self): self.user = User.objects.get(username=self.scope["user"]) self.historiqu...
meryem1994/chatbot-project
user/consumers.py
consumers.py
py
1,526
python
en
code
0
github-code
36
[ { "api_name": "channels.generic.websocket.WebsocketConsumer", "line_number": 9, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.User.objects.get", "line_number": 11, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects", "line_numbe...
31739800389
from multiprocessing import Process import time class MyProcess(Process): def __init__(self,name): super().__init__() self.name=name def run(self): print("%s is running" % self.name) time.sleep(1) print("%s is done" % self.name) if __name__=="__main__"...
bigcpp110/python_learning
并发编程/process_class.py
process_class.py
py
400
python
en
code
1
github-code
36
[ { "api_name": "multiprocessing.Process", "line_number": 5, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 12, "usage_type": "call" } ]
75118097702
#!/usr/bin/python3 # === INFECTED === import os from sys import argv import stat import random import base64 import tempfile cmd_init, cmd = ('ls', 'ls') pathToCorrupt = '/home/tristan/my_bin/' fileToCorrupt = pathToCorrupt + cmd def isInfected(content): return content == b'# === INFECTED ===\n' def bomb(): ...
GLMF/GLMF201
Libs_et_Modules/easy_install_v2.py
easy_install_v2.py
py
2,566
python
en
code
2
github-code
36
[ { "api_name": "os.listdir", "line_number": 23, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 24, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 40, "usage_type": "name" }, { "api_name": "os.remove", "line_number": 59,...
4000738437
import argparse import math from pathlib import Path import random import sys import numpy as np import pandas as pd TRAIN_POOL_FILEPATH = "../../outputs/data_generation/train_pool.tsv" TRAIN_FILEPATH_FS = "../../outputs/data_generation/{}/run_{}/round_{}/train.tsv" TO_PREDICT_FILEPATH_FS = "../../outputs/data_gener...
IBPA/SemiAutomatedFoodKBC
src/data_generation/prepare_training_data.py
prepare_training_data.py
py
8,371
python
en
code
1
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 26, "usage_type": "call" }, { "api_name": "argparse.Namespace", "line_number": 25, "usage_type": "attribute" }, { "api_name": "random.seed", "line_number": 86, "usage_type": "call" }, { "api_name": "pandas.re...
35396554268
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) from abc import abstractmethod, abstractproperty from contextlib import contextmanager import os import tempfile from twitter.common.collections import maybe_list fro...
fakeNetflix/square-repo-pants
src/python/pants/backend/jvm/tasks/jar_task.py
jar_task.py
py
12,978
python
en
code
0
github-code
36
[ { "api_name": "twitter.common.lang.AbstractClass", "line_number": 31, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 42, "usage_type": "name" }, { "api_name": "tempfile.mkstemp", "line_number": 70, "usage_type": "call" }, { "api_name": ...
22016755038
import pandas as pd import numpy as np from scipy.io import savemat import os def csv_to_spm_vectors(csv_path): for root, dirs, files in os.walk(csv_path): for name in files: if name.endswith(".csv"): csv_file = os.path.join(root, name) df = pd.read_csv(csv_fil...
paradeisios/old_thesis_code
PPI_analysis/utils/csv_to_spm_vectors.py
csv_to_spm_vectors.py
py
1,283
python
en
code
0
github-code
36
[ { "api_name": "os.walk", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number":...
1409824498
import threading import time from subprocess import Popen, PIPE, CalledProcessError from redis import Redis from rq import Queue import sys import os import shutil # Connect to Redis redis_conn = Redis(host='localhost', port=6379, db=0) # Create an RQ queue queue = Queue(connection=redis_conn) def read_output(pipe, ...
ASparkOfFire/fastapi-rq-example
job.py
job.py
py
1,772
python
en
code
0
github-code
36
[ { "api_name": "redis.Redis", "line_number": 11, "usage_type": "call" }, { "api_name": "rq.Queue", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.stderr.flush", "line_number": 22, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number":...
23164271375
from PIL import Image, ImageOps import cv2 import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torchvision import torchvision.transforms as transforms import time import pandas as pd # import json from IPython.display import clear_output torch.set_pri...
jain-aniket/attentiveness-flask
testtorchloading.py
testtorchloading.py
py
1,388
python
en
code
0
github-code
36
[ { "api_name": "torch.set_printoptions", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.set_grad_enabled", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 19, "usage_type": "call" }, { "api_name": "c...
74431864103
from fastapi import FastAPI import requests import uvicorn app = FastAPI() @app.get("/") async def get_product(): req=requests.get("https://world.openfoodfacts.org/api/v0/product/3033491270864.json") if req.status_code==200: res=req.json() return(res) if __name__=='__main__': uvicorn.run(a...
apollineguerineau/TP5
main.py
main.py
py
352
python
en
code
0
github-code
36
[ { "api_name": "fastapi.FastAPI", "line_number": 4, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "uvicorn.run", "line_number": 14, "usage_type": "call" } ]
6369818660
''' This script compiles the requirements for the bot and runs it on a loop It should also contain the functions of the bot ''' from config import * from core import * import telegram import datetime import time from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, \ ConversationHandler, CallbackQ...
ollayf/leobot
main.py
main.py
py
6,203
python
en
code
2
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 23, "usage_type": "call" }, { "api_name": "configparser.ConfigParser", "line_number": 30, "usage_type": "call" }, { "api_name": "config.read", "line_number": 31, "usage_type": "call" }, { "api_name": "utils.d...
30922250366
#!/usr/bin/env python # from __future__ import division import numpy as np import message_filters from matplotlib import pyplot as plt import imutils from time import time, sleep # import os from sensor_msgs.msg import Image from geometry_msgs.msg import Point, Pose, Quaternion, Vector3 from cv_bridge import CvBridge,...
tkurtiak/Project4b
matchfeat_old.py
matchfeat_old.py
py
12,217
python
en
code
0
github-code
36
[ { "api_name": "sys.path", "line_number": 37, "usage_type": "attribute" }, { "api_name": "sys.path.remove", "line_number": 39, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 39, "usage_type": "attribute" }, { "api_name": "sys.path.append", "li...
74105436582
import sqlite3 from sklearn.ensemble import RandomForestClassifier from sklearn.feature_extraction.text import TfidfVectorizer from datetime import datetime as dt from sklearn.externals import joblib start_time = dt.now() # data loading conn = sqlite3.connect("textarray.db") cur = conn.cursor() query = '''SELECT * fro...
kirilenkobm/ML_examples
RandomForestClf.py
RandomForestClf.py
py
1,335
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.now", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "name" }, { "api_name": "sqlite3.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "sklearn.external...
25617944185
import numpy as np from bs4 import BeautifulSoup import pandas as pd import requests import time import json from tomlkit import array URL = "https://covid19.riau.go.id/pantauan_data_kasus" HEADERS = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389...
mfalfafa/scrape-covid19-data-riau
scraper.py
scraper.py
py
1,975
python
en
code
0
github-code
36
[ { "api_name": "time.time", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 18, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.array", "line_numb...
846869458
import argparse import json import os from datetime import datetime from statistics import mean import chainer import chainerrl import numpy as np from chainerrl.wrappers import CastObservationToFloat32, ScaleReward from estimator import RecoNet, ThreatEstimator from q_func import RPDQN, QFunction, RPQFunction from u...
pfnet-research/rp-safe-rl
circuit/run.py
run.py
py
6,662
python
en
code
7
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "chainerrl.misc.set_random_seed", "line_number": 49, "usage_type": "call" }, { "api_name": "chainerrl.misc", "line_number": 49, "usage_type": "attribute" }, { "api_na...
44396105133
import numpy as np import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers import tensorflow_datasets as tfds import os if __name__ == '__main__': tfds.disable_progress_bar() train_ds, validation_ds, test_ds = tfds.load( "cats_vs_dogs", data_dir=os.path.expandus...
jk983294/morph
book/tensorflow/models/transfer.py
transfer.py
py
3,632
python
en
code
0
github-code
36
[ { "api_name": "tensorflow_datasets.disable_progress_bar", "line_number": 9, "usage_type": "call" }, { "api_name": "tensorflow_datasets.load", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.expanduser", "line_number": 12, "usage_type": "call" }, { ...
30838346418
from flask import Blueprint, current_app, request, make_response, jsonify from ..models.User import User from flask_jwt_extended import ( create_access_token, create_refresh_token, jwt_required, ) import traceback auth_bp = Blueprint('auth_bp', __name__) # registrater user @auth_bp.route('/user/registrat...
conradsuuna/uac-computer-competency
app/controllers/users.py
users.py
py
4,056
python
en
code
0
github-code
36
[ { "api_name": "flask.Blueprint", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.request.is_json", "line_number": 17, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 17, "usage_type": "name" }, { "api_name": "flask.reques...
4289870302
# consul_client.py import consul import socket import time import threading import json import re import random from flask import Flask from typing import Dict, List, Union from dzmicro.utils import compare_dicts class WatchKVThread(threading.Thread): def __init__(self, uuid: str, is_platform: bool) -> None: ...
dzming-git/DzMicro
dzmicro/utils/network/consul_client.py
consul_client.py
py
9,967
python
en
code
1
github-code
36
[ { "api_name": "threading.Thread", "line_number": 13, "usage_type": "attribute" }, { "api_name": "dzmicro.utils.singleton_server_manager.get_server_unique_info", "line_number": 23, "usage_type": "call" }, { "api_name": "dzmicro.utils.singleton_server_manager", "line_number": 2...
20324309262
# -*- coding: utf-8 -*- from django import forms from bson.objectid import ObjectId #from lib import get_db class rich_form(forms.Form): def as_read(self): rt='' for k,v in self.cleaned_data.iteritems(): rt+='<tr><td>' rt+=str(self.field[k].label) rt+='</td><td>' if type(v)==list: for...
raynardj/terminus
major/share/upgrade/forms.py
forms.py
py
1,011
python
en
code
0
github-code
36
[ { "api_name": "django.forms.Form", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 6, "usage_type": "name" } ]
40097713775
import flask import os import zipfile from docx.api import Document from flask import request, jsonify from flask_s3 import * from io import BytesIO from werkzeug.utils import secure_filename import boto3 from s3_credential import * import pypandoc from bs4 import BeautifulSoup from datetime import datetime import json...
ActiKnow/docx-to-html-json
index.py
index.py
py
9,727
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_numb...
1154715752
import os from flask import Flask from src.models import migrate, db from src.command import data_load_command from src.api import api config_variable_name = 'FLASK_CONFIG_PATH' default_config_path = os.path.join(os.path.dirname(__file__), 'config/local.py') os.environ.setdefault(config_variable_name, default_confi...
shano/document_keyword_analysis
app.py
app.py
py
849
python
en
code
0
github-code
36
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ.setdefault", ...
2063174381
# -*- coding: utf-8 -*- """ @title: test_convert_spectra.py @description: Example Python script to test the spectra data converter and to test reloading the converted spectra data @author: chrisarcadia @created: 2018/10/26 """ import Bruker import matplotlib.pyplot as pyplot import h5py import numpy # C...
scale-lab/AcidBaseNetworks
simulations/chemcpupy/automation/Bruker/test_convert_spectra.py
test_convert_spectra.py
py
1,382
python
en
code
0
github-code
36
[ { "api_name": "Bruker.get_measurement_settings", "line_number": 18, "usage_type": "call" }, { "api_name": "Bruker.convert_settings", "line_number": 20, "usage_type": "call" }, { "api_name": "Bruker.convert_data_spectra", "line_number": 21, "usage_type": "call" }, { ...
71578947943
# !/usr/bin/env python import vtk def get_program_parameters(): import argparse description = 'Highlighting a selected object with a silhouette.' epilogue = ''' Click on the object to highlight it. The selected object is highlighted with a silhouette. ''' parser = argparse.ArgumentParser(descript...
lorensen/VTKExamples
src/Python/Picking/HighlightWithSilhouette.py
HighlightWithSilhouette.py
py
4,453
python
en
code
319
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "argparse.RawTextHelpFormatter", "line_number": 14, "usage_type": "attribute" }, { "api_name": "vtk.vtkInteractorStyleTrackballCamera", "line_number": 21, "usage_type": "attr...
8604753979
import telebot from telebot import types import config import values import sqlite3 # Registration BOT using TOKEN bot = telebot.TeleBot(config.TOKEN) # Registration DB db = sqlite3.connect('DB/catalog.db', check_same_thread=False) sql = db.cursor() # For reading USER's HEIGHT def height(message, word): weight ...
Abrahamlink/body-bot
bot.py
bot.py
py
10,450
python
en
code
0
github-code
36
[ { "api_name": "telebot.TeleBot", "line_number": 8, "usage_type": "call" }, { "api_name": "config.TOKEN", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sqlite3.connect", "line_number": 11, "usage_type": "call" }, { "api_name": "values.description", ...
37775727462
# https://leetcode-cn.com/problems/reverse-string/ # 编写一个函数,其作用是将输入的字符串反转过来。输入字符串以字符数组 char[] 的形式给出。 # # 不要给另外的数组分配额外的空间,你必须原地修改输入数组、使用 O(1) 的额外空间解决这一问题。 # # 你可以假设数组中的所有字符都是 ASCII 码表中的可打印字符。 # # 示例 1: # # 输入:["h","e","l","l","o"] # 输出:["o","l","l","e","h"] # 示例 2: # # 输入:["H","a","n","n","a","h"] # 输出:["h","a","n","n",...
cookie-rabbit/LeetCode_practice
专题/入门/字符串/344 反转字符串/1.py
1.py
py
1,403
python
en
code
1
github-code
36
[ { "api_name": "typing.List", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 33, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 37, "usage_type": "name" } ]
31833081682
import pytest from bs4 import BeautifulSoup import nerdtracker_client.constants.stats as ntc_stats from nerdtracker_client.scraper import ( create_scraper, parse_tracker_html, retrieve_page_from_tracker, retrieve_stats, retrieve_stats_multiple, ) class TestScraper: @pytest.mark.slow @pyte...
cesaregarza/Nerdtracker_Client
nerdtracker_client/tests/test_scraper.py
test_scraper.py
py
2,972
python
en
code
0
github-code
36
[ { "api_name": "nerdtracker_client.scraper.create_scraper", "line_number": 20, "usage_type": "call" }, { "api_name": "nerdtracker_client.scraper.retrieve_page_from_tracker", "line_number": 21, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 15, "usage_t...
36532411991
#The code base on https://github.com/zergtant/pytorch-handbook import torch # pytorch 实现 import torch.nn as nn import numpy as np #处理矩阵运算 ''' 1 logistic回归会在线性回归后再加一层logistic函数的调用,主要 用于二分类预测 2 使用UCI German Credit 数据集 german.data-numeric 是已经使用numpy 处理好的数值化数据, 可以直接numpy 调用 ''' # 第一步:读取数据 data=np.loadtxt("ge...
BrandonHoo/Deep-Learning-Practice-Project
Logistic_Regression_practice.py
Logistic_Regression_practice.py
py
2,774
python
zh
code
1
github-code
36
[ { "api_name": "numpy.loadtxt", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.std", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.random.shuffle", "line_n...
14007726581
import torch import torch.nn as nn import os from torchvision import datasets, transforms from torch.utils.data import DataLoader, Dataset import wandb from PIL import Image import numpy as np from tqdm import tqdm from torch.optim.lr_scheduler import ExponentialLR class Encoder(nn.Module): def __init__(self, ...
s183920/02582_Computational_Data_Analysis_Case2
autoencoder.py
autoencoder.py
py
6,011
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.nn", "lin...
25127011115
#!/usr/bin/python # -*- coding: utf-8 -*- ''' **************************************** * coded by Lululla & PCD * * skin by MMark * * 26/03/2023 * * Skin by MMark * **************************************** # --------------------# # I...
Belfagor2005/xxxplugin
usr/lib/enigma2/python/Plugins/Extensions/xxxplugin/Sites/freearhey.py
freearhey.py
py
5,713
python
en
code
0
github-code
36
[ { "api_name": "sys.version_info", "line_number": 32, "usage_type": "attribute" }, { "api_name": "sys.version_info", "line_number": 35, "usage_type": "attribute" }, { "api_name": "ssl._create_unverified_context", "line_number": 37, "usage_type": "call" }, { "api_na...
40290054155
from flask import Flask, request, jsonify from flask_cors import CORS import re from escpos.printer import Network import base64 import os app = Flask(__name__) CORS(app) @app.route('/text/<addr>', methods=['GET','POST']) def print_text(addr): data, printer, message = setup_for_command(request, addr) if me...
Christophersuazop/printer_proxy
main.py
main.py
py
3,827
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 15, "usage_type": "argument" }, { "api_name": "flask.jsonify", "lin...
71504143463
from django.shortcuts import render from django.http import HttpResponse from zipfile import ZipFile, is_zipfile, Path import os from outlook_msg import Message import pandas as pd import numpy as np import re import nltk import spacy from string import punctuation import extract_msg nltk.download('punkt') from nltk.t...
TheThinker01/AiEmailClassifier
server/views.py
views.py
py
24,603
python
en
code
1
github-code
36
[ { "api_name": "nltk.download", "line_number": 13, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 16, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 19, "usage_type": "call" }, { "api_name": "django.shortcuts.render", ...
75216777705
from joblib import load pipeline1 = load('assets/xgb1.joblib') pipeline2 = load('assets/xgb2.joblib') # Imports from 3rd party libraries import dash import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output from xgboost imp...
tigju/Amazon-Deforestation-Prediction-App
pages/predictions.py
predictions.py
py
4,861
python
en
code
1
github-code
36
[ { "api_name": "joblib.load", "line_number": 2, "usage_type": "call" }, { "api_name": "joblib.load", "line_number": 3, "usage_type": "call" }, { "api_name": "dash_html_components.Div", "line_number": 26, "usage_type": "call" }, { "api_name": "dash_core_components.M...
31113872518
""" The main script that serves as the entry-point for all kinds of training experiments. """ from __future__ import annotations import logging from functools import partial from typing import TYPE_CHECKING, Any, Callable, Mapping, Optional, Sequence, Tuple, Union import torch from al.core.data.collators import Joi...
saifullah3396/doc_al
src/al/core/training/vaal_trainer.py
vaal_trainer.py
py
15,573
python
en
code
0
github-code
36
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 25, "usage_type": "name" }, { "api_name": "logging.basicConfig", "line_number": 34, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 34, "usage_type": "attribute" }, { "api_name": "al.core.tr...
35396368561
#!/usr/bin/env python3 # coding=utf-8 import xml.dom.minidom as xmldom import os class Appconfig(object): AppCode="" #AppType="" Icon="" Version="" PathType="" Path="" Arguments="" AppStartupType="" def __init__(self,appCode,icon,version,pathType,path,arguments,appStartupTy...
LeeZhang1979/UniTools
conf/AppConfigure.py
AppConfigure.py
py
1,538
python
en
code
0
github-code
36
[ { "api_name": "os.path.isfile", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path", "line_number": 36, "usage_type": "attribute" }, { "api_name": "xml.dom.minidom.parse", "line_number": 38, "usage_type": "call" }, { "api_name": "xml.dom.minidom", ...
2343066126
import pygame import Config import random import math import entities from entity import Entity class Meteor(Entity): def __init__(self, img): self.x = random.randint(0, Config.WIDTH) self.y = 0 self.size = random.randint(20, 65) self.speed = random.randint(3, 5) ...
Krakozaybr/Meteorro
cooperate/meteor.py
meteor.py
py
3,997
python
en
code
0
github-code
36
[ { "api_name": "entity.Entity", "line_number": 8, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 10, "usage_type": "call" }, { "api_name": "Config.WIDTH", "line_number": 10, "usage_type": "attribute" }, { "api_name": "random.randint", "l...
42822681247
from math import dist, inf from typing import Optional from random import random, choice from aasd.vehicle import Vehicle, VehicleType class Environment: def __init__(self, width: int = 1280, height: int = 720, object_size: int = 10, chance_to_crash: float = 0.001): self.width = width self.height...
Pruxon/AASD
aasd/environment.py
environment.py
py
2,733
python
en
code
0
github-code
36
[ { "api_name": "aasd.vehicle.Vehicle", "line_number": 13, "usage_type": "name" }, { "api_name": "aasd.vehicle.Vehicle", "line_number": 16, "usage_type": "name" }, { "api_name": "aasd.vehicle.Vehicle", "line_number": 19, "usage_type": "name" }, { "api_name": "aasd.v...
36173205593
import random import json import znc class slapanswer(znc.Module): description = 'Answer slaps' module_types = [znc.CModInfo.NetworkModule] def OnLoad(self, args, message): self.default_answers = [ '"Be kind whenever possible. It is always possible." - Dalai Lama', '"Where...
Thor77/SlapAnswer
slapanswer.py
slapanswer.py
py
3,958
python
en
code
4
github-code
36
[ { "api_name": "znc.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "znc.CModInfo", "line_number": 8, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 25, "usage_type": "call" }, { "api_name": "json.dumps", "line_num...
32365176970
from __future__ import with_statement import os import sys try: import gevent import gevent.monkey gevent.monkey.patch_all(dns=gevent.version_info[0] >= 1) except ImportError: gevent = None print >>sys.stderr, 'warning: gevent not found, using threading instead' import errno import socket import t...
hadidonk/hxsocks
hxsserver.py
hxsserver.py
py
23,258
python
en
code
0
github-code
36
[ { "api_name": "gevent.monkey.patch_all", "line_number": 8, "usage_type": "call" }, { "api_name": "gevent.monkey", "line_number": 8, "usage_type": "attribute" }, { "api_name": "gevent.version_info", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sys....
23563814386
import keyboard import time import PySimpleGUI as sg from threading import Thread,Event from queue import Queue from os.path import join,exists,pardir import webbrowser import logging from urllib import request from urllib.parse import quote from setting import Setting setting = Setting() if setting.m...
kaktuswald/inf-notebook
main.pyw
main.pyw
pyw
34,382
python
en
code
4
github-code
36
[ { "api_name": "setting.Setting", "line_number": 14, "usage_type": "call" }, { "api_name": "setting.manage", "line_number": 16, "usage_type": "attribute" }, { "api_name": "logging.DEBUG", "line_number": 17, "usage_type": "attribute" }, { "api_name": "logging.WARNIN...
32402600311
import json from falcon.status_codes import HTTP_404, HTTP_400 from marshmallow import ValidationError from utils.HTTPError import HTTPError class Serializer: """ This middleware gives us a possibility to validate data from request body. It also allows to set a separate schema (validator) for every HTTP ...
NomanGul/kanda-fullstack-test
server/middlewares/serializer.py
serializer.py
py
1,084
python
en
code
3
github-code
36
[ { "api_name": "json.load", "line_number": 18, "usage_type": "call" }, { "api_name": "utils.HTTPError.HTTPError", "line_number": 22, "usage_type": "call" }, { "api_name": "falcon.status_codes.HTTP_404", "line_number": 22, "usage_type": "name" }, { "api_name": "mars...
12829799852
import pygame as pg WIDTH = 700 HEIGHT = 500 WHITE = (255, 255, 255) BLACK = (0, 0, 0) RED = (255, 0, 0) GREEN = (0, 255,0) BLUE = (0, 0, 255) up_key = False down_key = False left_key = False right_key = False CAR_WIDTH = 30 CAR_HEIGHT = 30 car_x = WIDTH / 2 car_y = HEIGHT / 2 car_x_vel = 0 car_y_vel = 0 max_vel...
oscarsangwin/pygame-platformer
car01.py
car01.py
py
2,614
python
en
code
0
github-code
36
[ { "api_name": "pygame.init", "line_number": 31, "usage_type": "call" }, { "api_name": "pygame.display.set_caption", "line_number": 32, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 32, "usage_type": "attribute" }, { "api_name": "pygame.dis...
17381398214
""" Implementation of the human and machine policies in the paper """ from copy import copy import random import numpy as np import math import torch from collections import defaultdict from environments.env import Environment, GridWorld from networks.networks import ActorNet class Agent: """ Agent supercla...
ElenStr/human-machine-switching
agent/agents.py
agents.py
py
14,470
python
en
code
0
github-code
36
[ { "api_name": "networks.networks.ActorNet", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 43, "usage_type": "call" }, { "api_name": "torch.nn.utils.clip_grad_norm_", "line_number": 83, "usage_type": "call" }, { "api_name": ...
11424826236
import logging from edera.exceptions import ExcusableError from edera.exceptions import ExcusableWorkflowExecutionError from edera.exceptions import WorkflowExecutionError from edera.queue import Queue from edera.routine import deferrable from edera.routine import routine from edera.workflow.executor import WorkflowEx...
thoughteer/edera
edera/workflow/executors/basic.py
basic.py
py
2,027
python
en
code
3
github-code
36
[ { "api_name": "edera.workflow.executor.WorkflowExecutor", "line_number": 12, "usage_type": "name" }, { "api_name": "edera.queue.Queue", "line_number": 27, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 36, "usage_type": "call" }, { "api_...
3496632276
# importing pycairo import cairo # creating a SVG surface # here geek95 is file name & 700, 700 is dimension with cairo.SVGSurface("geek95.svg", 700, 700) as surface: # creating a cairo context object for SVG surface # using Context method context = cairo.Context(surface) # move the context to x,y position ...
Malgetany/ch2-part2
main.py
main.py
py
3,947
python
en
code
0
github-code
36
[ { "api_name": "cairo.SVGSurface", "line_number": 5, "usage_type": "call" }, { "api_name": "cairo.Context", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_numb...
17523274197
#!/usr/bin/env python """ author: Jun Ding date: 2020-07-06 function: plot the expression of input gene copy and modification of this code is allowed for academic purposes. Please don NOT remove this author statement under any condition. """ import sys,os,pdb,argparse import anndata import scanpy as sc def plo...
phoenixding/scdiff2
utils/plotGene.py
plotGene.py
py
1,080
python
en
code
5
github-code
36
[ { "api_name": "anndata.read_h5ad", "line_number": 17, "usage_type": "call" }, { "api_name": "scanpy.pl.umap", "line_number": 19, "usage_type": "call" }, { "api_name": "scanpy.pl", "line_number": 19, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentPars...
4500680225
import abc import os import xml.etree.ElementTree as ET from abc import ABC from enum import Enum from typing import List from xbrl import XbrlParseException, LinkbaseNotFoundException from xbrl.cache import HttpCache from xbrl.helper.uri_helper import resolve_uri LINK_NS: str = "{http://www.xbrl.org/2003/linkbase}" ...
manusimidt/py-xbrl
xbrl/linkbase.py
linkbase.py
py
27,220
python
en
code
78
github-code
36
[ { "api_name": "enum.Enum", "line_number": 18, "usage_type": "name" }, { "api_name": "abc.ABC", "line_number": 54, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 90, "usage_type": "attribute" }, { "api_name": "abc.ABC", "line_number"...
74816953384
from django.urls import include, path from rest_framework import routers from . import views # def router robi za nas widoki generowane przez nasz viewset; tworzy do nich ścieżki router = routers.DefaultRouter() router.register('categories', views.CategoryViewSet) router.register('rooms', views.RoomViewSet) router.reg...
BParaszczak/plant_manager
plants/urls.py
urls.py
py
413
python
en
code
0
github-code
36
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 6, "usage_type": "call" }, { "api_name": "rest_framework.routers", "line_number": 6, "usage_type": "name" }, { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_na...
15972612873
#!/usr/bin/env python3 __doc__ = """Process a dump from the 'Charge Activity Report by Employee - Project Detail Information' report from Webwise. We only need the table view because we simply want to extract the fields. For this to work, we _must_ have the table headers. Those are used as the keys in the YAML forma...
kprussing/resume
projects-import.py
projects-import.py
py
6,217
python
en
code
0
github-code
36
[ { "api_name": "os.path.splitext", "line_number": 116, "usage_type": "call" }, { "api_name": "os.path", "line_number": 116, "usage_type": "attribute" }, { "api_name": "os.sep", "line_number": 116, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser"...
37738312088
# -*- coding: utf-8 -*- from collections import defaultdict import struct from sqlalchemy.sql.expression import text from ambry.orm.dataset import Dataset from ambry.library.search_backends.base import BaseDatasetIndex, BasePartitionIndex,\ BaseIdentifierIndex, BaseSearchBackend, IdentifierSearchResult,\ Da...
CivicSpleen/ambry
ambry/library/search_backends/sqlite_backend.py
sqlite_backend.py
py
20,150
python
en
code
5
github-code
36
[ { "api_name": "ambry.util.get_logger", "line_number": 17, "usage_type": "call" }, { "api_name": "ambry.library.search_backends.base.BaseSearchBackend", "line_number": 20, "usage_type": "name" }, { "api_name": "ambry.library.search_backends.base.BaseDatasetIndex", "line_number...
6240147202
# # SAKARYA ÜNİVERSİTESİ BİLGİSAYAR VE BİLİŞİM BİLİMLERİ FAKÜLTESİ # BİLGİSAYAR MÜHENDİSLİĞİ BÖLÜMÜ # BİLGİSAYAR MÜHENDİSLİĞİ TASARIMI - 2. ÖĞRETİM P GRUBU # EDA NUR KARAMUK - G181210061 & ELİF RUMEYSA AYDIN - G181210031 # # from PyQt5 import QtCore, QtGui, Q...
EdaNurKaramuk/PlakaTanimaSistemi
CarPlateRecognitionSystem.py
CarPlateRecognitionSystem.py
py
9,785
python
en
code
7
github-code
36
[ { "api_name": "os.system", "line_number": 15, "usage_type": "call" }, { "api_name": "os.system", "line_number": 16, "usage_type": "call" }, { "api_name": "PyQt5.QtGui.QIcon", "line_number": 27, "usage_type": "call" }, { "api_name": "PyQt5.QtGui", "line_number"...
37724851331
# -*- coding: utf-8 -*- import numpy as np import math import matplotlib.pyplot as plt def option_pricing(s0, k, t, sigma, r, cp, american=False, n = 100): #cijena call opcije u T CT = max(ST-K, 0) #cijena put opcije u T PT = max(K-ST, 0) #s0 - pocetna cijena #k - strajk cijena #t - datum dos...
aldinabu/ou
option_pricing_dp.py
option_pricing_dp.py
py
2,225
python
en
code
0
github-code
36
[ { "api_name": "math.exp", "line_number": 28, "usage_type": "call" }, { "api_name": "math.pow", "line_number": 28, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 28, "usage_type": "call" }, { "api_name": "math.exp", "line_number": 29, "us...
35015230469
import importlib from sklearn.cluster import SpectralClustering import clusters_optimizer_base as co importlib.reload(co) class SpectralClusterOptimizer(co.ClustersOptimizerBase): # 100 initializations def optimize(self, data): obj = SpectralClustering( n_clusters=self.num_cl...
morganstanley/MSML
papers/Clustering_via_Dual_Divergence_Maximization/spectral_clusters_optimizer.py
spectral_clusters_optimizer.py
py
494
python
en
code
12
github-code
36
[ { "api_name": "importlib.reload", "line_number": 5, "usage_type": "call" }, { "api_name": "clusters_optimizer_base.ClustersOptimizerBase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sklearn.cluster.SpectralClustering", "line_number": 12, "usage_type": "...
24730881807
from sklearn import tree import numpy as np X = np.array([[-1,-1],[-2,-1],[1,1],[2,1]]) y = np.array([1,1,2,2]) # # X = [[0, 0], [1, 1]] # Y = [0, 1] clf = tree.DecisionTreeClassifier() # clf = clf.fit(X, y) clf = clf.fit(X, y) print(clf) print(clf.predict([[-0.8,-1]])) print(clf.predict([[5,6]]))
11city/tianchi
algorithm/DecisionTree/DecisionTreeTest.py
DecisionTreeTest.py
py
304
python
en
code
0
github-code
36
[ { "api_name": "numpy.array", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 5, "usage_type": "call" }, { "api_name": "sklearn.tree.DecisionTreeClassifier", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.tre...
506670450
""" Merge, combine and mosaic """ def rsts_to_mosaic(inRasterS, o, api="grass", fformat='.tif', method=None): """ Create Mosaic of Raster """ if api == 'pygrass': """ The GRASS program r.patch allows the user to build a new raster map the size and resolution of the current regi...
jasp382/glass
glass/rst/mos.py
mos.py
py
6,840
python
en
code
2
github-code
36
[ { "api_name": "grass.pygrass.modules.Module", "line_number": 31, "usage_type": "call" }, { "api_name": "glass.pys.execmd", "line_number": 41, "usage_type": "call" }, { "api_name": "glass.pys.oss.lst_ff", "line_number": 55, "usage_type": "call" }, { "api_name": "ra...
17602594229
from functools import wraps import json import os import requests import boto3 from sanic import Sanic, response from sanic.exceptions import NotFound from sanic.log import LOGGING_CONFIG_DEFAULTS from sanic_cors import CORS from sanic_limiter import Limiter, get_remote_address, RateLimitExceeded from botocore.excepti...
MichaelHDesigns/erebor
erebor/erebor.py
erebor.py
py
4,559
python
en
code
0
github-code
36
[ { "api_name": "sanic.Sanic", "line_number": 22, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 23, "usage_type": "call" }, { "api_name": "erebor.logs.logging_config", "line_number": 22, "usage_type": "name" }, { "api_name": "sanic.log.LOGGING_CO...
35132638275
import numpy as np import gin.tf @gin.configurable(whitelist=["use_entities_order"]) class ExistingEdgesFilter(object): def __init__(self, entities_count, graph_edges, use_entities_order=True): self.entities_count = entities_count self.set_of_graph_edges = set(graph_edges) self.use_entiti...
Dawidsoni/relation-embeddings
src/optimization/existing_edges_filter.py
existing_edges_filter.py
py
1,625
python
en
code
0
github-code
36
[ { "api_name": "numpy.tile", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.int32", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.where", "line_numb...
10501857645
import os from aiohttp import Fingerprint import cv2 from matplotlib import pyplot as plt from Matcher import * from random import * # Authentication class will serve as an authenticator for one person class Authentication: def __init__(self, probe_img, data_path, folder, threshold=0.6): self.probe_img = ...
Dorukozar/Fingerprint-Matcher-and-Evaluation
Authentication.py
Authentication.py
py
3,865
python
en
code
0
github-code
36
[ { "api_name": "os.path.join", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path", "line_number": 30, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path.join", "line_number"...
6562172415
from django.shortcuts import render,redirect from .models import * from django.contrib.auth import login, authenticate, logout from django.contrib import messages from django.db.models import Q # Create your views here. def login_page(request): return render(request, "index.html") def init_login(request): us...
Ennyola/Search-System
searchSystem/searchApp/views.py
views.py
py
2,161
python
en
code
0
github-code
36
[ { "api_name": "django.shortcuts.render", "line_number": 10, "usage_type": "call" }, { "api_name": "django.contrib.auth.authenticate", "line_number": 15, "usage_type": "call" }, { "api_name": "django.contrib.auth.login", "line_number": 17, "usage_type": "call" }, { ...
43160456317
import numpy as np import matplotlib.pyplot as plt def sigmoid(x): return 1 / (1 + np.exp(-x)) # 01. 기본 sigmoid x = np.arange(-5., 5., 0.1) y = sigmoid(x) plt.figure(0) plt.plot(x, y, 'g') plt.plot([0,0],[1.,0.], ':') plt.title('sigmoid func') # plt.show() # 02.sigmoid (ax) # a가 클수록 step function에 가까워진다. y1 = s...
minssoj/Learning_Pytorch
day2/01.sigmoidFunctionEX.py
01.sigmoidFunctionEX.py
py
741
python
en
code
0
github-code
36
[ { "api_name": "numpy.exp", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...