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
14438218202
import psycopg2 update_sql = "UPDATE test SET data = %s WHERE num = %s" conn = None try: # connect to the PostgreSQL database conn = psycopg2.connect( dbname='spacedys', host='localhost', user='spacedys', password='password') # create a new cursor cur = conn.cursor() ...
nicolacammillini/spacedys
docs/demos/db/update-pg.py
update-pg.py
py
694
python
en
code
0
github-code
36
[ { "api_name": "psycopg2.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "psycopg2.DatabaseError", "line_number": 24, "usage_type": "attribute" } ]
15872415911
import torch import numpy as np from falkon import Falkon from falkon.kernels import GaussianKernel from falkon.options import FalkonOptions from falkonhep.models import HEPModel class FalkonHEPModel(HEPModel): def create_labels(self, ref_size, data_size): ref_labels = np.zeros(ref_size, dtype=np.floa...
FalkonHEP/falkonhep
falkonhep/models/flkhep_model.py
flkhep_model.py
py
1,858
python
en
code
1
github-code
36
[ { "api_name": "falkonhep.models.HEPModel", "line_number": 11, "usage_type": "name" }, { "api_name": "numpy.zeros", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.float64", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.ones",...
24969027415
from typing import List class Solution: def dailyTemperatures(self, temperatures: List[int]) -> List[int]: ans = [0] * len(temperatures) stack = [] for i, v in enumerate(temperatures): while stack and stack[-1][1] < v: index, value = stack.pop() ...
inverseTrig/leet_code
739_daily_temperatures.py
739_daily_temperatures.py
py
530
python
en
code
0
github-code
36
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
34212066405
# https://www.acmicpc.net/problem/14502 # solution # 1) ์ž„์˜๋กœ 3๊ฐœ์˜ ๋ฒฝ์„ ์„ธ์šด๋‹ค(dfs) # 2) ๋ฐ”์ด๋Ÿฌ์Šค๋ฅผ ํผ๋œจ๋ฆฐ๋‹ค(bfs) # 3) ์•ˆ์ „๊ตฌ์—ญ์˜ ํฌ๊ธฐ๋ฅผ ๊ตฌํ•ด์„œ ์ตœ๋Œ€๊ฐ’์„ ๊ฐฑ์‹ ํ•œ๋‹ค # 4) 1)๋กœ ๋Œ์•„๊ฐ€ ๋ชจ๋“  ๊ฒฝ์šฐ์— ๋Œ€ํ•ด ๋ฐ˜๋ณตํ•œ๋‹ค # 5) ์•ˆ์ „๊ตฌ์—ญ ํฌ๊ธฐ์˜ ์ตœ๋Œ€๊ฐ’์„ ์ถœ๋ ฅํ•œ๋‹ค # TIL # 2์ฐจ์› ๋ฐฐ์—ด์—์„œ ๊ฐ€๋Šฅํ•œ ๋ชจ๋“  ์กฐํ•ฉ์„ ์žฌ๊ท€์ ์œผ๋กœ ํƒ์ƒ‰ํ•˜๋Š” ์ฝ”๋“œ( line:60~66 ) ## -> ๋ชซ(i//m)๊ณผ ๋‚˜๋จธ์ง€(i%m)๋ฅผ ์ด์šฉํ•œ ํƒ์ƒ‰๊ณผ ์žฌ๊ท€ํ•จ์ˆ˜ ๋‚ด์— ๋ฐ˜๋ณต๋ฌธ ์žˆ๋Š” ํ˜•ํƒœ import copy from collections i...
chankoo/problem-solving
graph/14502-์—ฐ๊ตฌ์†Œ.py
14502-์—ฐ๊ตฌ์†Œ.py
py
2,358
python
ko
code
1
github-code
36
[ { "api_name": "collections.deque", "line_number": 35, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 52, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 53, "usage_type": "call" } ]
22377349542
import pandas as pd import matplotlib.pyplot as plt import os # file muveletek import datetime from datetime import date import time import copy import numpy as np class nHop: time_stamp = '' next_hop = '' count = 0 per8 = 0 adv_range = 0 def __init__(self): self.time_stamp = '' self.next_hop = '' self....
Tomikaze/IP-stats-trends
venv/nexthop.py
nexthop.py
py
2,796
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.now", "line_number": 91, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 91, "usage_type": "attribute" }, { "api_name": "os.walk", "line_number": 94, "usage_type": "call" }, { "api_name": "datetime.datetim...
264212609
""" https://portswigger.net/web-security/cross-site-scripting/contexts/lab-onclick-event-angle-brackets-double-quotes-html-encoded-single-quotes-backslash-escaped """ import sys import requests from bs4 import BeautifulSoup site = sys.argv[1] if 'https://' in site: site = site.rstrip('/').lstrip('https://') s = ...
brandonaltermatt/penetration-testing-scripts
cross-site-scripting/contexts/onclick-event-angle-brackets-double-quotes-html-encoded-single-quotes-backslash-escaped.py
onclick-event-angle-brackets-double-quotes-html-encoded-single-quotes-backslash-escaped.py
py
1,149
python
en
code
0
github-code
36
[ { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "requests.Session", "line_number": 13, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" } ]
71205780264
from setuptools import setup, find_packages from apache_spark import __version__ tests_require = [ 'mock', 'nose', 'coverage', 'yanc', 'preggy', 'tox', 'ipdb', 'coveralls', 'sphinx', ] setup( name='apache_spark', version=__version__, description='Computational tools for...
yosoyubik/ApacheSpark_02817
setup.py
setup.py
py
1,598
python
en
code
0
github-code
36
[ { "api_name": "setuptools.setup", "line_number": 16, "usage_type": "call" }, { "api_name": "apache_spark.__version__", "line_number": 18, "usage_type": "name" }, { "api_name": "setuptools.find_packages", "line_number": 39, "usage_type": "call" } ]
74134918182
from cmath import nan import re from types import NoneType from django.shortcuts import render, redirect from django.http import JsonResponse from mensajeria.models import ( Archivos, Destinatarios, Personas, Maestras, Peticion, Paises, Areas, Secciones, Grupos ) from mensajeria.form...
YilberthAndres/masivo
mensajeria/views/carga/carga_distribucion.py
carga_distribucion.py
py
16,140
python
es
code
0
github-code
36
[ { "api_name": "rest_framework.generics.CreateAPIView", "line_number": 40, "usage_type": "name" }, { "api_name": "mixins.base.ResponseMixin", "line_number": 40, "usage_type": "name" }, { "api_name": "serializers.auth.signup_serializers.SignupSerializers", "line_number": 41, ...
20078510579
from flask import Blueprint, render_template, url_for, request, send_from_directory from flask_login import login_required, current_user from werkzeug.utils import redirect from crm import db from ..utils.images_handler import save_image_uploads, get_image_list, load_image_uploads, delete_images from .forms import Ne...
tomasz-rzesikowski/crm
crm/note/views.py
views.py
py
2,354
python
en
code
0
github-code
36
[ { "api_name": "flask.Blueprint", "line_number": 11, "usage_type": "call" }, { "api_name": "utils.images_handler.load_image_uploads", "line_number": 16, "usage_type": "call" }, { "api_name": "models.Note.get_all_with_users", "line_number": 22, "usage_type": "call" }, {...
1938554685
import sys from typing import List from kclvm.tools.lint.reporters.base_reporter import BaseReporter from kclvm.tools.lint.message.message import Message class FileReporter(BaseReporter): def __init__(self, linter, output=None, encoding=None): self.name = "file_reporter" self.output_file = linter...
kcl-lang/kcl-py
kclvm/tools/lint/reporters/file_reporter.py
file_reporter.py
py
968
python
en
code
8
github-code
36
[ { "api_name": "kclvm.tools.lint.reporters.base_reporter.BaseReporter", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 14, "usage_type": "name" }, { "api_name": "kclvm.tools.lint.message.message.Message", "line_number": 14, "usage_typ...
73421284263
import tensorflow as tf import keras as K from keras import callbacks, optimizers from keras import backend as KB from keras.engine import Layer from keras.layers import Activation from keras.layers import LeakyReLU, Dense, Input, Embedding, Dropout, Reshape, Concatenate, MaxPooling1D, Flatten from keras.layers impor...
Chucooleg/CapsNet_for_NER
code/buildCapsModel.py
buildCapsModel.py
py
12,144
python
en
code
10
github-code
36
[ { "api_name": "keras.layers.Input", "line_number": 44, "usage_type": "call" }, { "api_name": "keras.layers.Input", "line_number": 46, "usage_type": "call" }, { "api_name": "keras.layers.Input", "line_number": 48, "usage_type": "call" }, { "api_name": "keras.layers...
30753498437
from __future__ import absolute_import, division, print_function, unicode_literals import os import tensorflow as tf from tensorflow.keras import datasets, layers, models import matplotlib.pyplot as plt CHECKPOINT_PATH = "model/lab2.h5" def main(): (train_images, train_labels), (test_images, ...
sontuphan/deep-learning-labs
labs/lab2.py
lab2.py
py
1,755
python
en
code
0
github-code
36
[ { "api_name": "tensorflow.keras.datasets.cifar10.load_data", "line_number": 14, "usage_type": "call" }, { "api_name": "tensorflow.keras.datasets.cifar10", "line_number": 14, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.datasets", "line_number": 14, "usage_...
18262811618
import requests import json import os import pyperclip from wox import Wox,WoxAPI class Main(Wox): def query(self,key): results=[] key=key.split(' ') servers={ '1':"LuXingNiao",'2':"MoGuLi",'3':"MaoXiaoPang", } worlds={ 'HongYuHai':"็บข็މๆตท", ...
ShiomiyaRinne/FFXIV-Market-Query
main.py
main.py
py
3,542
python
en
code
1
github-code
36
[ { "api_name": "wox.Wox", "line_number": 6, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 46, "usage_type": "call" }, { "api_name": "os.path", "line_number": 46, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": ...
9262633989
from tts_websocketserver.tts_pipeline import get_pipeline from rgws.interface import WebsocketServer import json, asyncio class TTSPipelineManager: def __init__(self): self.state = "Setup" self.pipeline = get_pipeline() self.pipeline.build() self.state = "Ready" as...
TheSoundOfAIOSR/rg_text_to_sound
tts_websocketserver/src/tts_websocketserver/tts_server.py
tts_server.py
py
1,659
python
en
code
4
github-code
36
[ { "api_name": "tts_websocketserver.tts_pipeline.get_pipeline", "line_number": 9, "usage_type": "call" }, { "api_name": "rgws.interface.WebsocketServer", "line_number": 33, "usage_type": "name" }, { "api_name": "asyncio.get_event_loop", "line_number": 54, "usage_type": "ca...
34316494896
''' Created on Mar 6, 2014 @author: kerem ''' from random import randint from random import random as rnd class InteractionBox(object): center = None width = None height = None depth = None is_valid = None def __init__(self): pass def set(self, box): self.center = box.cen...
keryil/leaparticulatorqt
leaparticulator/data/frame.py
frame.py
py
4,847
python
en
code
0
github-code
36
[ { "api_name": "random.random", "line_number": 50, "usage_type": "call" }, { "api_name": "random.random", "line_number": 51, "usage_type": "call" }, { "api_name": "random.random", "line_number": 52, "usage_type": "call" }, { "api_name": "random.random", "line_n...
12575982154
from distutils.log import INFO from multiprocessing.sharedctypes import Value from dash import Dash, html, dcc, Input, Output, State, dash_table import dash import dash_bootstrap_components as dbc import LoraLogger import pandas as pd import json import plotly.io as pio pio.templates.default = "plotly_dark" logger = ...
adrwong/FAI
app.py
app.py
py
10,096
python
en
code
0
github-code
36
[ { "api_name": "plotly.io.templates", "line_number": 11, "usage_type": "attribute" }, { "api_name": "plotly.io", "line_number": 11, "usage_type": "name" }, { "api_name": "LoraLogger.logger", "line_number": 13, "usage_type": "call" }, { "api_name": "distutils.log.IN...
11695978241
#!/usr/bin/env python # -*- coding: utf-8 -*- #ย @Timeย ย ย  : 2020/3/27 16:43 #ย @Authorย  : TanLHHH #ย @Siteย ย ย  : #ย @Fileย ย ย  : tieba.py #ย @Software: PyCharm import requests,re url = "https://tieba.baidu.com/f?kw=%E6%96%B0%E5%9E%8B%E5%86%A0%E7%8A%B6%E7%97%85%E6%AF%92&ie=utf-8&pn=0" headers = { "User-Agent": "Mozilla/...
TanLHHHH/Spiders
ๆต‹่ฏ•ๆ–‡ไปถๅคน/tieba.py
tieba.py
py
1,112
python
en
code
3
github-code
36
[ { "api_name": "requests.get", "line_number": 18, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 22, "usage_type": "call" }, { "api_name": "re.S", "line_number": 22, "usage_type": "attribute" }, { "api_name": "re.compile", "line_number": 30,...
37071867440
from flask import Flask,render_template,redirect,url_for from flask_bootstrap import Bootstrap from detail_collector import DetailCollector app = Flask(__name__) app.config['Secret_KEY'] = '83hs293C0926jcw2FJ893Bd3E' Bootstrap(app) detail = DetailCollector() @app.route("/") @app.route("/home") def home(): retu...
Amari-17/portfolio
app.py
app.py
py
370
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask_bootstrap.Bootstrap", "line_number": 9, "usage_type": "call" }, { "api_name": "detail_collector.DetailCollector", "line_number": 11, "usage_type": "call" }, { "api_name": "...
14086957906
import json import networkx as nx import matplotlib.pyplot as plt def get_topology(edges): g = nx.Graph() l3edges_json = json.loads(edges.to_json(orient="index")) for k in l3edges_json: neighbor = l3edges_json[k] node_id = neighbor["Interface"]["hostname"] remote_node_id = neighb...
martimy/Bat-Q
pages/common/plotting.py
plotting.py
py
756
python
en
code
1
github-code
36
[ { "api_name": "networkx.Graph", "line_number": 8, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 10, "usage_type": "call" }, { "api_name": "networkx.spring_layout", "line_number": 28, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.sub...
34353676149
import requests from bs4 import BeautifulSoup from time import sleep import json from sqlalchemy import create_engine,Column,Integer,String,ForeignKey,table, column, select, update, insert from sqlalchemy.ext.declarative import declarative_base from urlparse import urlparse from sqlalchemy.orm import sessionmaker from ...
VladislavSpassov/HackBulgariaTasks
Week13/CrawnBGWebsites.py
CrawnBGWebsites.py
py
3,072
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 14, "usage_type": "call" }, { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 17, "usage_type": "call" }, { "api_na...
14263045240
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from .models import Account, UserProfile, RefundRequests, FavoriteItem, Preferences # Register your models here. class AccountAdmin(UserAdmin): list_display = ('email', 'first_name', 'last_name', 'username', 'phone_number', 'last_lo...
jeffjcb/southcartel-app
southcartel/accounts/admin.py
admin.py
py
1,150
python
en
code
1
github-code
36
[ { "api_name": "django.contrib.auth.admin.UserAdmin", "line_number": 8, "usage_type": "name" }, { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 16, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 16, "usage_type": "name" ...
74978102183
import os import random from captcha import image import numpy as np import PIL.Image as PILImage import cv2 import shutil def create_train_dataset(output_dir: str, width: float, height: float, captcha_count=4, count=2000): if not os.path.exists(output_dir): os.mkdir(output_dir) number_sets = lambda o...
SquarePants1991/LearnTensorFlow
้ชŒ่ฏ็ ่ฏ†ๅˆซ/dataset_util.py
dataset_util.py
py
1,701
python
en
code
0
github-code
36
[ { "api_name": "os.path.exists", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 11, "usage_type": "call" }, { "api_name": "random.randrange", "line_num...
28225180956
from typing import List import unittest class Solution: def carFleet(self, target: int, position: List[int], speed: List[int]) -> int: records = [ (pos, spd) for pos, spd in zip(position, speed) ] records.sort(key=lambda x: x[0]) for i in rang...
HomayoonAlimohammadi/Training
Leetcode/853_CarFleet.py
853_CarFleet.py
py
1,349
python
en
code
2
github-code
36
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 27, "usage_type": "attribute" }, { "api_name": "unittest.main", "line_number": 56, "usage_type": "call" } ]
5032205330
import os import sys import numpy as np import matplotlib.pyplot as plt import getdist #from getdist import plots, MCSamples sys.path.append( "{}/utils".format(os.environ["GitHub"]) ) import list_utils as list_utils import directory_utils as directory_utils # NOTE: A LOT NEED TO CHANGE HERE ... # TODO: The sampl...
Sketos/utils
autolens_utils/autolens_directory_utils.py
autolens_directory_utils.py
py
5,540
python
en
code
0
github-code
36
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.walk", "line_number...
32901525311
import csv import itertools import os.path import sys if __name__ == "__main__": #Create ontology dictionary from MEGARes ontology file #megares_ontology = {} #ontology_filename = "/home/noyes046/jsettle/argmobrich/MEGARESONTOLOGY.tsv" #with open(ontology_filename, 'r') as ontology_tsv: #ontolo...
settj/argmobrich_analysis
colocalization/gen_overlap.py
gen_overlap.py
py
2,748
python
en
code
0
github-code
36
[ { "api_name": "sys.argv", "line_number": 26, "usage_type": "attribute" }, { "api_name": "csv.reader", "line_number": 30, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 40, "usage_type": "call" }, { "api_name": "os.path.path.splitext", ...
24390093684
import argparse import os import re import subprocess from . import tool from .common import check_which, Command, guess_command, make_command_converter from .. import log, options as opts, shell from ..exceptions import PackageResolutionError, PackageVersionError from ..file_types import Directory, HeaderDirectory fr...
jimporter/bfg9000
bfg9000/tools/pkg_config.py
pkg_config.py
py
10,628
python
en
code
73
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 21, "usage_type": "call" }, { "api_name": "common.make_command_converter", "line_number": 24, "usage_type": "call" }, { "api...
39804054613
import os from django.urls import resolve, reverse from django.shortcuts import redirect from django.http import HttpResponseForbidden from internal_users.models import InternalUser from firebase_auth_app.models import FirebaseUser from customer_users.models import CustomerUser class InternalUserMiddleware: # De...
zjgcainiao/new_place_at_76
internal_users/middlewares.py
middlewares.py
py
3,585
python
en
code
0
github-code
36
[ { "api_name": "django.urls.reverse", "line_number": 20, "usage_type": "call" }, { "api_name": "django.urls.reverse", "line_number": 21, "usage_type": "call" }, { "api_name": "django.urls.resolve", "line_number": 25, "usage_type": "call" }, { "api_name": "internal_...
6674627865
import torch from dace.transformation import transformation from dace.properties import make_properties from dace.sdfg.utils import node_path_graph from dace import nodes, SDFG, SDFGState, registry, Memlet from typing import Dict, Union from daceml import onnx as donnx from daceml.transformation.constant_folding impor...
spcl/daceml
daceml/transformation/pad_conv_fusion.py
pad_conv_fusion.py
py
3,630
python
en
code
69
github-code
36
[ { "api_name": "dace.transformation.transformation.SingleStateTransformation", "line_number": 14, "usage_type": "attribute" }, { "api_name": "dace.transformation.transformation", "line_number": 14, "usage_type": "name" }, { "api_name": "dace.transformation.transformation.PatternNo...
26648319096
import os import sys from glob import glob from json2mongo import WriteToDataBase import argparse import configparser filename = "last_run_context_numbers.txt" # argument to be provided to the process manager parser = argparse.ArgumentParser( description="process manager" ) # need this to read the ini file config = co...
ShanJ35/XOM_master
backend/write_json_to_db.py
write_json_to_db.py
py
6,424
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "configparser.ConfigParser", "line_number": 12, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path....
4828550972
from concurrent.futures import process from matplotlib.pyplot import cla import numpy as np, pandas as pd import re from scipy import rand dataset = pd.read_csv("../../resources/Part 7 - Natural Language Processing/Section 36 - Natural Language Processing/Python/Restaurant_Reviews.tsv",delimiter="\t", quoting=3) ## ...
ManishLapasi/MLstuff
models/NLP/nlpselect.py
nlpselect.py
py
4,084
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.naive_bayes.GaussianNB", "line_number": 21, "usage_type": "call" }, { "api_name": "sklearn.linear_m...
14029268104
import typing import discord from discord.ext import commands from .general import is_staff, free_category, free_category_create class FreeCategory(commands.Cog): __slots__ = ('client', 'name', 'staff',) permissions_jp = { # 'create_instant_invite': 'ๆ‹›ๅพ…ใ‚’ไฝœๆˆ', 'manage_channels': 'ใƒใƒฃใƒณใƒใƒซใฎ็ฎก็†', ...
Kesigomon/Skyline_py
cogs/freecategory.py
freecategory.py
py
13,622
python
en
code
7
github-code
36
[ { "api_name": "discord.ext.commands.Cog", "line_number": 9, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 9, "usage_type": "name" }, { "api_name": "discord.ext.commands.Bot", "line_number": 38, "usage_type": "attribute" }, { "ap...
37716628062
# Module Imports import mariadb import sys import socket import threading import time # Connect to MariaDB Platform try: db = mariadb.connect( user="user", password="password", host="mariadb", port=3306, database="info801" ) except mariadb.Error as e: print(f"Error ...
visarsylejmani/architecture-logicielle-info801
server/server.py
server.py
py
3,523
python
en
code
0
github-code
36
[ { "api_name": "mariadb.connect", "line_number": 10, "usage_type": "call" }, { "api_name": "mariadb.Error", "line_number": 18, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 20, "usage_type": "call" }, { "api_name": "socket.gethostbyname", ...
5668667396
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from matplotlib.offsetbox import OffsetImage, AnnotationBbox from PIL import Image as pil_image from mosaic impor...
joshloyal/Mosaic
mosaic/histogram.py
histogram.py
py
5,809
python
en
code
0
github-code
36
[ { "api_name": "numpy.histogram", "line_number": 47, "usage_type": "call" }, { "api_name": "PIL.Image.new", "line_number": 57, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 57, "usage_type": "name" }, { "api_name": "numpy.where", "line_numbe...
71798506343
#!/usr/bin/python # python images_for_deep_learning_sv02_create_non_white_space_mapping_file.py -i input_bed -o output_mapping_file # python images_for_deep_learning_sv02_create_non_white_space_mapping_file.py -i non_white_out_all_mgrb_and_isks.txt -o non_white_out_all_mgrb_and_isks_map_350x350.txt # Sort input bed fi...
emmamrath/gene_annotation_of_structural_variants
create_images_for_deep_learning/images_for_deep_learning_sv02_create_non_white_space_mapping_file.py
images_for_deep_learning_sv02_create_non_white_space_mapping_file.py
py
6,428
python
en
code
1
github-code
36
[ { "api_name": "math.ceil", "line_number": 116, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 148, "usage_type": "call" } ]
10179826987
#!/usr/bin/python3 """ Number of subscribers(not active users,total subscribers) for a given subreddit """ import requests def number_of_subscribers(subreddit): """ Number of subscribers for a given subreddit from the Reddit API """ if subreddit is None or not isinstance(subreddit, str): ret...
jamesAlhassan/alx-system_engineering-devops
0x16-api_advanced/0-subs.py
0-subs.py
py
646
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 19, "usage_type": "call" } ]
36839090820
import moviepy.editor as me import numpy as np from bm_analyze import * import time t=open('!r_data.txt') M=t.read().split('\n') t.close() del t M[0]='[empty]' start=36000 end=37000 speed=16 time.sleep(120) render=me.VideoClip(lambda t:np.zeros([1080,1920,3]),duration=(end-start)/speed)#+3*(q+1==k)) clips=[render] prin...
dr2xmillion371/stuff
matrix.py
matrix.py
py
1,876
python
en
code
0
github-code
36
[ { "api_name": "time.sleep", "line_number": 13, "usage_type": "call" }, { "api_name": "moviepy.editor.VideoClip", "line_number": 14, "usage_type": "call" }, { "api_name": "moviepy.editor", "line_number": 14, "usage_type": "name" }, { "api_name": "numpy.zeros", ...
23536887489
import numpy as np from collections import deque import gymnasium as gym from stable_baselines3.common.atari_wrappers import ( ClipRewardEnv, EpisodicLifeEnv, FireResetEnv, MaxAndSkipEnv, NoopResetEnv, ) class Agent: def __init__(self, eval_env): self.eval_env = eval_env def eval...
ZangZehua/rlatari
utils/random_atari.py
random_atari.py
py
2,894
python
en
code
2
github-code
36
[ { "api_name": "numpy.array", "line_number": 21, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 31, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.mean", "lin...
5198901937
#!/usr/bin/env python # -*- coding: utf-8 -*- from datetime import datetime import unittest import yalix.repl as repl import yalix.utils as utils def send_inputs(*args): # count always starts from 1 def invoke(count): try: cmd = args[count - 1] if isinstance(cmd, str): ...
rm-hull/yalix
python/tests/repl_test.py
repl_test.py
py
1,934
python
en
code
5
github-code
36
[ { "api_name": "unittest.TestCase", "line_number": 31, "usage_type": "attribute" }, { "api_name": "yalix.repl.license", "line_number": 34, "usage_type": "call" }, { "api_name": "yalix.repl", "line_number": 34, "usage_type": "name" }, { "api_name": "datetime.datetim...
495434407
from __future__ import print_function import os import string import mock import pytest from click import UsageError from click.testing import CliRunner from dagster import ( DagsterInvariantViolationError, PartitionSetDefinition, RepositoryDefinition, ScheduleDefinition, lambda_solid, pipeli...
helloworld/continuous-dagster
deploy/dagster_modules/dagster/dagster_tests/cli_tests/test_cli_commands.py
test_cli_commands.py
py
31,036
python
en
code
2
github-code
36
[ { "api_name": "dagster.lambda_solid", "line_number": 61, "usage_type": "name" }, { "api_name": "dagster.lambda_solid", "line_number": 66, "usage_type": "name" }, { "api_name": "dagster.pipeline", "line_number": 71, "usage_type": "call" }, { "api_name": "dagster.pi...
13419956267
import pygame,sys from Room import Room,Overworld class Game: def __init__(self) -> None: self.overworld = Overworld(screen,self.start_game) self.status = 'overworld' self.current_room = 0 def start_game(self): self.room = Room(self.current_room, self.create_overworld) ...
NishantK30/projects
text based game/main.py
main.py
py
960
python
en
code
0
github-code
36
[ { "api_name": "Room.Overworld", "line_number": 7, "usage_type": "call" }, { "api_name": "Room.Room", "line_number": 12, "usage_type": "call" }, { "api_name": "Room.Overworld", "line_number": 16, "usage_type": "call" }, { "api_name": "pygame.init", "line_number...
41585308053
from flask.ext.mongokit import MongoKit, Document from datetime import datetime from sensorapp import db, app @db.register class Device(Document): __database__ = app.config["DB_NAME"] __collection__ = "device" structure = { 'name': unicode, 'digit_pin_num': int, 'analog_pin_num': in...
janetyc/SensorIoT
sensorapp/models.py
models.py
py
2,885
python
en
code
0
github-code
36
[ { "api_name": "flask.ext.mongokit.Document", "line_number": 6, "usage_type": "name" }, { "api_name": "sensorapp.app.config", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sensorapp.app", "line_number": 7, "usage_type": "name" }, { "api_name": "date...
15150261198
#Healthy programmer # 9am - 5pm # Water = water.mp3 (3.5 liters)every 40min - Drank - log # Eyes = eyes.mp3 (Every 30 min) - EyesDone - log # Pysical Activity = pysical.mp3 (every 45 min)- ExDone - log # # Rules - pygame module to play audio from pygame import mixer from datetime import datetime from time import time ...
entbappy/My-python-projects
Ex7 Healty programmer50.py
Ex7 Healty programmer50.py
py
1,582
python
en
code
2
github-code
36
[ { "api_name": "pygame.mixer.init", "line_number": 14, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 14, "usage_type": "name" }, { "api_name": "pygame.mixer.music.load", "line_number": 15, "usage_type": "call" }, { "api_name": "pygame.mixer.m...
5850629924
#coding: utf-8 import pygame from block import Block import constants #insert this class in ship method gen_shoot() class Bullet(Block): def __init__(self,x,y, sign, speed, targets_nopoints= None, targets_points=None, point_receptor=None): super(Bullet, self).__init__(x,y,10,10,constants.YELLOW) self.dir_x = 0 ...
RafaelPAndrade/Pixel_Martians
bullet.py
bullet.py
py
1,487
python
en
code
0
github-code
36
[ { "api_name": "block.Block", "line_number": 8, "usage_type": "name" }, { "api_name": "constants.YELLOW", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pygame.sprite", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pygame.sprite", ...
35076398379
"""This file contains the signature validator abstraction""" import base64 import json from cose.headers import KID from cose.keys.keyops import VerifyOp from cose.messages import Sign1Message from cose.keys import CoseKey from cose.algorithms import Es256, Ps256 from cose.keys.keytype import KtyEC2, KtyRSA from cose...
ryanbnl/eu-dcc-diagnostics
classes/SignatureValidator.py
SignatureValidator.py
py
3,969
python
en
code
9
github-code
36
[ { "api_name": "classes.TrustList.TrustList", "line_number": 25, "usage_type": "name" }, { "api_name": "cose.messages.Sign1Message.decode", "line_number": 31, "usage_type": "call" }, { "api_name": "cose.messages.Sign1Message", "line_number": 31, "usage_type": "name" }, ...
38488870579
#!/usr/bin/env python3 # # Bonus. GPE auto-training + GSA using external (from publication) dataset loaded from json file # import os from gpytorch.likelihoods import GaussianLikelihood from gpytorch.means import LinearMean from gpytorch.kernels import MaternKernel, ScaleKernel from GPErks.gp.data.dataset import Data...
stelong/GPErks
examples/example_bonus.py
example_bonus.py
py
3,888
python
en
code
3
github-code
36
[ { "api_name": "GPErks.log.logger.get_logger", "line_number": 22, "usage_type": "call" }, { "api_name": "GPErks.utils.random.set_seed", "line_number": 24, "usage_type": "call" }, { "api_name": "GPErks.gp.data.dataset.Dataset.build_from_file", "line_number": 30, "usage_type...
3419259967
from spectractor import parameters from spectractor.simulation.simulator import AtmosphereGrid, SpectrumSimulatorSimGrid from spectractor.config import load_config from spectractor.simulation.image_simulation import ImageSim from spectractor.logbook import LogBook from spectractor.extractor.extractor import Spectractor...
LSSTDESC/Spectractor
runSimulator.py
runSimulator.py
py
2,608
python
en
code
13
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "spectractor.parameters.VERBOSE", "line_number": 27, "usage_type": "attribute" }, { "api_name": "spectractor.parameters", "line_number": 27, "usage_type": "name" }, { ...
26736973424
import json import re from PyQt5.QtGui import QColor from PyQt5.QtWidgets import QFileDialog, QListWidgetItem, QColorDialog from models.const import * from models import util from uis.main_window import Ui_MainWindow class SettingsController(object): def __init__(self, app=None, ui: Ui_MainWindow = None, main_cont...
freedy82/Comic-Toolbox
models/controllers/settings_controller.py
settings_controller.py
py
14,876
python
en
code
13
github-code
36
[ { "api_name": "uis.main_window.Ui_MainWindow", "line_number": 13, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QFileDialog.getExistingDirectory", "line_number": 69, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QFileDialog", "line_number": 69, "usage_ty...
18174515063
import os import sys import pathlib import pandas as pd import pymrio as pym import pickle as pkl import logging import argparse import json import re from pymrio.core.mriosystem import IOSystem SEC_AGG_ODS_FILENAME = "exiobase3_aggregate_to_7_sectors.ods" PARAMS_ODS_FILENAME ="exiobase3_7_sectors_params.ods" EXIO3_MO...
spjuhel/BoARIO
scripts/generate-example-files.py
generate-example-files.py
py
10,120
python
en
code
6
github-code
36
[ { "api_name": "pymrio.IOSystem", "line_number": 47, "usage_type": "attribute" }, { "api_name": "pymrio.core.mriosystem.IOSystem", "line_number": 82, "usage_type": "argument" }, { "api_name": "pathlib.Path", "line_number": 90, "usage_type": "call" }, { "api_name": ...
9959099201
import random import itertools import math import json from functions.counting import counting from functions.multi_arithematic import multiple_operations_two_ops from functions.single_arithematic import single_arithematic from functions.avg_val import average_point_value from functions.permutation_combination import ...
GVS-007/MLLM_Reasoning
final_data_creation.py
final_data_creation.py
py
7,225
python
en
code
0
github-code
36
[ { "api_name": "functions.clock.generate_clock_time_questions", "line_number": 173, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 196, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 203, "usage_type": "call" }, ...
16620383859
# @Author: Billy Li <billyli> # @Date: 06-05-2022 # @Email: li000400@umn.edu # @Last modified by: billyli # @Last modified time: 06-06-2022 import sys from pathlib import Path import shutil import numpy as np from scipy.stats import uniform data_dir = Path.cwd().parent.joinpath("data") sys.path.insert(1, str(...
billy000400/CircNN
src/features/make_data_single_track.py
make_data_single_track.py
py
2,828
python
en
code
0
github-code
36
[ { "api_name": "pathlib.Path.cwd", "line_number": 16, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 16, "usage_type": "name" }, { "api_name": "sys.path.insert", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.path", "line_nu...
13990400448
from collections import defaultdict from sys import maxint class Solution(object): def getClosest(self, S, t): closest = None minDiff = maxint for k, x in S: diff = abs(t - x) if diff < minDiff: minDiff = diff closest = k, x r...
dariomx/topcoder-srm
leetcode/zero-pass/google/optimal-account-balancing/Solution3.py
Solution3.py
py
1,460
python
en
code
0
github-code
36
[ { "api_name": "sys.maxint", "line_number": 8, "usage_type": "name" }, { "api_name": "collections.defaultdict", "line_number": 22, "usage_type": "call" } ]
23256745509
from flask import Flask, render_template, request, session, redirect, flash, url_for from flask_hashing import Hashing import random import secrets from .utils import * app = Flask(__name__) app.config.from_object('config') hashing = Hashing(app) def before_request(): """fonction qui initialise les sessions de ...
Tezay/conjug
conjugFR/views.py
views.py
py
27,625
python
en
code
6
github-code
36
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "flask_hashing.Hashing", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.session", "line_number": 18, "usage_type": "name" }, { "api_name": "flask.session", "l...
18306688211
from PIL import Image img=Image.open(r"C:\Users\rohan\Downloads\Pictures\IMG_5093.jpg") height=img.height width=img.width print(f"Height:{height} Width:{width}") r,g,b=img.getpixel((100,100)) print(f"R:{r} G:{g} B:{b}") img2=img.convert("L") img2.show() img2=img2.save(r"C:\Users\rohan\Downloads\Pictures\test2.jpeg") i...
rohanxd1/Codes
Python/TEST.py
TEST.py
py
416
python
en
code
0
github-code
36
[ { "api_name": "PIL.Image.open", "line_number": 2, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 2, "usage_type": "name" } ]
1165604872
# https://leetcode.com/problems/subsets/ # Total subsets for an arr of len n is 2 power n # Each subset is represented by binary representation of this total # for ex. if n = 3 # total subsets is 8 viz. 2 power 3 # subset0 would be 000, subset1 = 001, subset2 = 010, subset3 = 011 and so on. # if one is found in b...
acharyarajiv/leetcode
medium/subsets.py
subsets.py
py
1,423
python
en
code
0
github-code
36
[ { "api_name": "typing.List", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 24, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 26, "usage_type": "name" }, { "api_name": "typing.List", "line_number": ...
32487421332
#-*-coding:utf-8 -*- import sys import hmac import hashlib import time import requests import json import urllib import top class ewsServiceApi: ''' Aliyun EWS service api ''' def __init__(self,accesskey,secretkey): self.accesskey = accesskey self.secrekey = secretkey self.tim...
opnms/opnms
base/ewsService.py
ewsService.py
py
2,267
python
en
code
0
github-code
36
[ { "api_name": "time.time", "line_number": 19, "usage_type": "call" }, { "api_name": "hmac.new", "line_number": 32, "usage_type": "call" }, { "api_name": "hashlib.md5", "line_number": 35, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number":...
25163396057
import os from unittest import mock from easul import util from easul.driver import MemoryDriver from easul.visual import Visual from easul.tests.example import diabetes_progression_algorithm, prog_input_data, no_prog_input_data import logging from easul.visual.element import Prediction from easul.visual.element.pr...
rcfgroup/easul
easul/tests/visual/test_prediction.py
test_prediction.py
py
2,967
python
en
code
1
github-code
36
[ { "api_name": "logging.basicConfig", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 15, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "easul.visual....
70231595624
''' Name: Main file for HW2 of FE 595 Intro: This file should load the cleaned data from theyfightcrime.org, sort the data, and return the required info. Author: William Long Date : 09/22/2019 ''' import pandas as pd import numpy as np from textblob import TextBlob import nltk #First, Let's load the data m_raw = pd....
bluefinch83/FE_595_HW2
Main.py
Main.py
py
2,099
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "textblob.TextBlob", "line_number": 25, "usage_type": "call" }, { "api_name": "nltk.word_tokenize"...
19702023558
from flask import Flask, request, send_from_directory, send_file from contracts import DCCInterface from web3 import Web3, HTTPProvider import json import _thread import time import traceback app = Flask(__name__) jobs = [] jobs_details = [] web3 = Web3([HTTPProvider("http://10.8.3.1:8545")]) def thread_prune_entrie...
jimgao1/dcc
src/server.py
server.py
py
1,747
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "web3.Web3", "line_number": 13, "usage_type": "call" }, { "api_name": "web3.HTTPProvider", "line_number": 13, "usage_type": "call" }, { "api_name": "contracts.DCCInterface", ...
72054157543
# Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html # useful for handling different item types with a single interface from datetime import datetime from urllib.parse import urljoin import pymongo imp...
mudssky/myScrapySpiders
getchu/getchu/pipelines.py
pipelines.py
py
3,959
python
en
code
0
github-code
36
[ { "api_name": "pymongo.MongoClient", "line_number": 40, "usage_type": "call" }, { "api_name": "itemadapter.ItemAdapter", "line_number": 47, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 48, "usage_type": "call" }, { "api_name": "dat...
14873664547
import cv2 import yaml from application.main.onnx_model.base_model import BaseModel from typing import Tuple from application.main.onnx_model.util import * class YoloOnnxModel(BaseModel): def __init__(self, cfg_file): super(YoloOnnxModel, self).__init__(cfg_file) self.input_nodes = ["images"] ...
YoungHyuenKim/onnx_fastAPI_example
application/main/onnx_model/yolo_model.py
yolo_model.py
py
2,184
python
en
code
0
github-code
36
[ { "api_name": "application.main.onnx_model.base_model.BaseModel", "line_number": 10, "usage_type": "name" }, { "api_name": "cv2.resize", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 18, "usage_type": "call" }, { "api_name...
74797071465
import scrapy from scrapy.spiders import CrawlSpider, Rule from scrapy.http import Request import re class MySpider(CrawlSpider): name = 'author_scrape' author_name = 'ุงู„ูƒู†ุฏูŠ ูŠุนู‚ูˆุจ' author_eng = 'al-Kindi' start_urls = ['https://ablibrary.net/books/?offset=0&limit=50&author={}&sort=name,asc'.f...
maeirnoam/scrapers
ABLibrary/ablib_scraper/ablib_scraper/spiders/ABLibCrawler.py
ABLibCrawler.py
py
2,051
python
en
code
0
github-code
36
[ { "api_name": "scrapy.spiders.CrawlSpider", "line_number": 6, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 15, "usage_type": "call" }, { "api_name": "re.DOTALL", "line_number": 16, "usage_type": "attribute" }, { "api_name": "re.MULTILINE", ...
34996914416
import numpy as np import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt from numpy import pi inputName = "21cylindrov" fileName = inputName + "-Tphi-all" plotName = fileName + "-smery" data = np.load("./Results/"+fileName+".npz") inputData = np.load("./Inputs/" + inputName + ".npz") n = inputData...
KlaraFickova/Diplomovka
Draw/smery-f.py
smery-f.py
py
919
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.use", "line_number": 3, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.rcParams", "line_n...
21645118091
from datetime import date, datetime, timezone, timedelta import threading import git import os from repoorgui.commands import commandfn # see https://stackoverflow.com/a/39956572 # made changes to return repo object if exits def is_git_repo(path): try: r = git.Repo(path) _ = r.git_dir ret...
abhishekmishra/repoorgui
src/repoorgui/gitworkspace.py
gitworkspace.py
py
4,397
python
en
code
0
github-code
36
[ { "api_name": "git.Repo", "line_number": 13, "usage_type": "call" }, { "api_name": "git.exc", "line_number": 16, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 55, "usage_type": "call" }, { "api_name": "datetime.datetime", "...
38799414939
import discord import bdg import gamelist import random class SurpriseGameCommand(bdg.BdgCommand): header = { 'name': "sortear_jogo", 'description': "Lista de Jogos - Sorteie um jogo aleatรณrio baseado no filtro especificado", } async def on_command(self, i: discord.Interaction, filtro: gamelist.GameFilter): ...
DanielKMach/BotDusGuri
src/commands/gamelist/surprise.py
surprise.py
py
814
python
pt
code
1
github-code
36
[ { "api_name": "bdg.BdgCommand", "line_number": 6, "usage_type": "attribute" }, { "api_name": "discord.Interaction", "line_number": 13, "usage_type": "attribute" }, { "api_name": "gamelist.GameFilter", "line_number": 13, "usage_type": "attribute" }, { "api_name": "...
11685619050
from django.shortcuts import render from django.shortcuts import render,redirect from django.contrib.auth.forms import UserCreationForm,AuthenticationForm # from .models import Device from django.contrib.auth import authenticate from django.contrib.auth import login #from .forms import SignUpForm from django.core.mail ...
sanjolisogani/new_ops
newops/views.py
views.py
py
14,804
python
en
code
0
github-code
36
[ { "api_name": "django.contrib.auth.authenticate", "line_number": 31, "usage_type": "call" }, { "api_name": "django.core.mail.send_mail", "line_number": 32, "usage_type": "call" }, { "api_name": "django.conf.settings.EMAIL_HOST_USER", "line_number": 35, "usage_type": "attr...
41166932292
# pip install requests bs4 lxml # pip install jieba import requests import bs4 import jieba import csv stocks = set() def prepare_stocks(): with open('week3/Stock.csv', encoding='utf-8') as csv_file: csv_reader = csv.reader(csv_file) stock_list = list(csv_reader) for stock in stoc...
andrewintw/learning-python-web-crawler
week3/lab00_ptt_from_teacher.py
lab00_ptt_from_teacher.py
py
2,001
python
en
code
0
github-code
36
[ { "api_name": "csv.reader", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 22, "usage_type": "call" }, { "api_name": "jieba.lcut", "line_numb...
74120599144
from django.db.models import Q from django.shortcuts import render from apps.news.models import News, HeadlineNews, BottomInfo # Views function for home page of site def index(request): # news part latest_news = News.objects.order_by('-published_date')[:3] headlines = HeadlineNews.objects.filter(is_publis...
libomun/crhs
apps/home/views.py
views.py
py
1,287
python
en
code
0
github-code
36
[ { "api_name": "apps.news.models.News.objects.order_by", "line_number": 9, "usage_type": "call" }, { "api_name": "apps.news.models.News.objects", "line_number": 9, "usage_type": "attribute" }, { "api_name": "apps.news.models.News", "line_number": 9, "usage_type": "name" ...
16667044604
import os import pydicom import numpy as np import dicom_numpy from utils import hidden_errors from tf_utils import * from pathlib import Path def read_dicom_folder(dicom_folder, rescale=None): ''' Reads all .dcm files in `dicom_folder` and merges them to one volume Returns: The volume and the affine...
xeTaiz/dvao
volume_loader.py
volume_loader.py
py
2,556
python
en
code
6
github-code
36
[ { "api_name": "pydicom.dcmread", "line_number": 16, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 16, "usage_type": "call" }, { "api_name": "dicom_numpy.combine_slices", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.isdir",...
2051327559
##https://towardsdatascience.com/develop-a-nlp-model-in-python-deploy-it-with-flask-step-by-step-744f3bdd7776 from flask import Flask, request, jsonify,render_template,redirect,flash import pandas as pd import matplotlib.pyplot as plt #from flask_cors import CORS from data_Preprocessing import DataPreprocessing from ve...
Pooja-AI/Email-Classification
file.py
file.py
py
10,841
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 27, "usage_type": "attribute" }, { "api_name": "flask.req...
8591398196
import torch import torch.nn as nn import torch.nn.functional as F import copy import numpy as np from itertools import chain class SurgicalFineTuningBert(nn.Module): def __init__( self, bert_model, ) -> None: super().__init__() self.get_extended_attention_mask = bert_model.get...
AntoineBigeard/NLPSurgicalFineTuning
src/pimped_bert.py
pimped_bert.py
py
4,780
python
en
code
2
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "copy.deepcopy", "line_number": 19, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_n...
11831438569
import discord from discord.ext import commands from discord.commands import Option from commands.funcs.yatta_gif import yatta_gif # List of commands here: # /yattagif class Gif(commands.Cog, description='Gif maker'): def __init__(self, bot): self.bot = bot self.footer = "Developed by jej#6495 for...
jej-v/snowcodes2022
commands/yatta.py
yatta.py
py
1,201
python
en
code
0
github-code
36
[ { "api_name": "discord.ext.commands.Cog", "line_number": 9, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 9, "usage_type": "name" }, { "api_name": "discord.ApplicationContext", "line_number": 17, "usage_type": "attribute" }, { "...
16010531173
''' api_test.py Jeff Ondich, 11 April 2016 Ethan Somes, 13 April, 2017 Revised from Jeff's example for CS 257 Software Design. How to retrieve results from an HTTP-based API, parse the results (JSON in this case), and manage the potential errors. ''' import sys import argparse import...
NylaWorker/TrebuchetPhysicsSimulation
CS257/API.py
API.py
py
5,087
python
en
code
0
github-code
36
[ { "api_name": "urllib.request.request.urlopen", "line_number": 35, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 35, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 35, "usage_type": "name" }, { "api_nam...
11519320722
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import logging from types import FunctionType from fdm import central_fdm from lab import B from plum import Dispatcher, Self, Referentiable, type_parameter, Union from .util import uprank from .input import Input, At, MultiInp...
pb593/stheno
stheno/graph.py
graph.py
py
27,441
python
en
code
null
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 30, "usage_type": "call" }, { "api_name": "input.At", "line_number": 45, "usage_type": "argument" }, { "api_name": "plum.Referentiable", "line_number": 54, "usage_type": "name" }, { "api_name": "plum.Dispatcher", ...
23331748159
import matplotlib.pyplot as plt from utility_functions import * depth = 120 layers = 100 segments = 1 size_classes = 2 lam = 300 simulate = False verbose = True l2 = False min_attack_rate = 10**(-3) mass_vector = np.array([0.05, 20, 6000]) # np.array([1, 30, 300, 400, 800, 16000]) obj = spectral_method(depth, layer...
jemff/food_web
old_sims/other_initial_conditions.py
other_initial_conditions.py
py
1,717
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 42, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 42, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 43, "usage_type": "call" }, { "api_name": "matpl...
19786182992
from keras import Model import numpy as np from scam.exceptions import InvalidState from scam.utils import resize_activations, normalize_activations class ScoreCAM: def __init__(self, model_input, last_conv_output, softmax_output, input_shape, cam_batch_size=None): """ Prepares class activation m...
andreysorokin/scam-net
scam/keras.py
keras.py
py
3,075
python
en
code
9
github-code
36
[ { "api_name": "keras.Model", "line_number": 21, "usage_type": "call" }, { "api_name": "keras.Model", "line_number": 22, "usage_type": "call" }, { "api_name": "scam.utils.resize_activations", "line_number": 32, "usage_type": "call" }, { "api_name": "scam.utils.norm...
70345439783
import os import sys import pdb import torch import numpy as np import pickle as pkl from PIL import Image from random import shuffle from torchvision import datasets, transforms """ Template Dataset with Labels """ class XYDataset(torch.utils.data.Dataset): def __init__(self, x, y, **kwargs): self.x, se...
joey-wang123/DRO-Task-free
data.py
data.py
py
11,866
python
en
code
11
github-code
36
[ { "api_name": "torch.utils", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.Tensor", "line_number": 29, "usage_type": "attribute" }, { "api_name": "PIL.Image.open", "line_number": 32, "usage_type": "call" }, { "api_name": "PIL.Image", "li...
9502049271
from django.db import models from django.contrib.auth.models import AbstractUser from voomsdb.utils.models import PersonalModel, NameTimeBasedModel from voomsdb.utils.choices import AdmissionTypeChoice from voomsdb.utils.media import MediaHelper from voomsdb.utils.strings import generate_ref_no from django.conf import ...
dauntless001/vooms
home/models.py
models.py
py
1,596
python
en
code
0
github-code
36
[ { "api_name": "django.contrib.auth.models.AbstractUser", "line_number": 10, "usage_type": "name" }, { "api_name": "voomsdb.utils.models.PersonalModel", "line_number": 17, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 18, "usage_type": ...
75121574505
import unittest import requests URL = 'http://127.0.0.1:8000/segment' IMAGE_PATH = './data/test_image/' IMAGE_NAME = '0bf631128.jpg' IMAGE_FORMAT = 'image/jpeg' class ImageSegmentationTest(unittest.TestCase): def test_image_segmentation(self): with open(IMAGE_PATH+IMAGE_NAME, 'rb') as image_file: ...
MykytaKyt/airbus-ship-detection
tests/test_app.py
test_app.py
py
994
python
en
code
0
github-code
36
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "requests.post", "line_number": 21, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 34, "usage_type": "call" }, { "api_name": "unittest.main", ...
990448118
import requests import random import time from threading import Thread # Import modules for HTTP flood import tools.randomData as randomData import tools.ipTools as ipTools def HTTP_ATTACK(threads, attack_time, target): # Finish global FINISH FINISH = False if ipTools.isCloudFlare(target): if not ...
Marshmello1912/Git
Impulse/tools/L7/http.py
http.py
py
1,653
python
en
code
0
github-code
36
[ { "api_name": "tools.ipTools.isCloudFlare", "line_number": 14, "usage_type": "call" }, { "api_name": "tools.ipTools", "line_number": 14, "usage_type": "name" }, { "api_name": "tools.randomData.random_useragent", "line_number": 24, "usage_type": "call" }, { "api_na...
25634514682
import claripy import code from hashlib import sha512 import json import sys b = [claripy.BVS('b_%d' % i, 1) for i in range(33896)] s = claripy.Solver() with open("map3.txt", 'r') as f: cipher, chalbox = json.loads(f.read()) length, gates, check = chalbox for i in range(33767,33896): name, args = gates[i-...
posgnu/ctfs
pctf2018/3iscABC/sol.py
sol.py
py
907
python
en
code
1
github-code
36
[ { "api_name": "claripy.BVS", "line_number": 7, "usage_type": "call" }, { "api_name": "claripy.Solver", "line_number": 9, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 12, "usage_type": "call" }, { "api_name": "claripy.BVV", "line_number": ...
18852099221
from os import environ from time import time, sleep import requests import requests.auth from requests_oauthlib import OAuth1 from .exceptions import * class API: def __init__(self, session=None): self.log_function = print self.retry_rate = 5 self.num_retries = 5 s...
kavyamandaliya/SentimentAnalysis
scraper/scrap/apis.py
apis.py
py
13,220
python
en
code
0
github-code
36
[ { "api_name": "requests.exceptions", "line_number": 19, "usage_type": "attribute" }, { "api_name": "requests.exceptions", "line_number": 20, "usage_type": "attribute" }, { "api_name": "requests.exceptions", "line_number": 21, "usage_type": "attribute" }, { "api_na...
43696108113
import os from math import ceil from keras import backend from keras import optimizers from keras.applications.vgg19 import VGG19 from keras.applications.resnet50 import ResNet50 from keras.layers import Dense, Flatten, BatchNormalization, Dropout from keras.models import Sequential, Model from keras.callbacks import...
anson627/kaggle
planet/lib/classifier.py
classifier.py
py
5,485
python
en
code
0
github-code
36
[ { "api_name": "keras.applications.vgg19.VGG19", "line_number": 29, "usage_type": "call" }, { "api_name": "keras.models.Sequential", "line_number": 30, "usage_type": "call" }, { "api_name": "keras.layers.Flatten", "line_number": 32, "usage_type": "call" }, { "api_n...
37980420317
import random from enum import Enum fifth_ed_bad_reactions = ["cringe.jpg", "mike.jpg", "nat1.gif", "nat1.jpg", "jazz.jpg"] fifth_ed_good_reactions = ["heisenberg.gif", "joji.jpg", "mcmahon.gif", "nat20.jpg"] sw_bad_reactions = ["bad1.gif", "bad2.gif", "bad3.gif", "bad4.gif", "bad5.gif", "bad6.jpg...
SPIGS/DiceBot
gamemode.py
gamemode.py
py
1,148
python
en
code
1
github-code
36
[ { "api_name": "enum.Enum", "line_number": 12, "usage_type": "name" }, { "api_name": "random.choice", "line_number": 17, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 19, "usage_type": "call" }, { "api_name": "random.choice", "line_numbe...
23155147064
import logging import os from datetime import datetime file_name=f"{datetime.now().strftime('%d_%m_%Y_%H_%M_%S')}.log" logs_path=os.path.join(os.getcwd(),"logs",file_name) os.makedirs(logs_path,exist_ok=True) logs_file_path=os.path.join(logs_path,file_name) logging.basicConfig(filename=logs_file_path, ...
Hema9121/second-hema-ml-repo
src/logger.py
logger.py
py
500
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.now", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 6, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line...
22541773169
# RA, 2020-10-13 import contextlib import io @contextlib.contextmanager def open_maybe_gz(file, *, mode='r'): """ Open `file` for reading that could be a - file descriptor - path to file - path to gzipped file `mode` is either 'r' or 'rb', and has to be specified. Usage: with...
Luca-Blum/Computational_Biomedicine
project1/solution/humdum/io/gz.py
gz.py
py
891
python
en
code
0
github-code
36
[ { "api_name": "io.IOBase", "line_number": 24, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 29, "usage_type": "call" }, { "api_name": "gzip.open", "line_number": 35, "usage_type": "call" }, { "api_name": "io.TextIOWrapper", "line_nu...
31571764321
# _ __ _ __ # | | /| / /| | /| / / GREEN ANALYTICAL INDEX GENERATOR # | |/ |/ / | |/ |/ / W.Wojnowski 2020 # |__/|__/ |__/|__/ v.0.3 (alpha) # # from tkinter import * import matplotlib.pyplot as plt from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg ...
Casivelaunus/Green_index
Main_window.py
Main_window.py
py
62,363
python
en
code
0
github-code
36
[ { "api_name": "tkinter.filedialog.asksaveasfilename", "line_number": 68, "usage_type": "call" }, { "api_name": "tkinter.filedialog", "line_number": 68, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.savefig", "line_number": 70, "usage_type": "call" }, { ...
30810878899
import serial import KeyConfig as kc import struct import socket IP = '192.168.1.200' PORT = 12345 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) s.setblocking(False) def read_data(): d: bytes = ser.readline() if len(d) > 0: res = d.decode().replace('\r\n', '') r...
AssoAndrea/UE-ArduinoLightController
PythonMiddleware/main.py
main.py
py
1,249
python
en
code
1
github-code
36
[ { "api_name": "socket.socket", "line_number": 10, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 10, "usage_type": "attribute" }, { "api_name": "socket.SOCK_DGRAM", "line_number": 10, "usage_type": "attribute" }, { "api_name": "socket.IPPRO...
2112950145
import json class SettingFile(object): def __init__(self, path, defaults): self._defaults = defaults self._path = path self._data = dict() self._callbacks = dict() for setting in defaults: self._callbacks[setting] = callback_assist() self.load() def...
sdfgeoff/newsscroller
setting_file.py
setting_file.py
py
2,100
python
en
code
0
github-code
36
[ { "api_name": "json.load", "line_number": 17, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 19, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 34, "usage_type": "call" } ]
41341957139
import numpy as np from scipy import signal from scipy.signal import iirfilter from scipy.signal import lfilter def Implement_Notch_Filter(fs: float, band: list, freq: float, ripple: float, order: int, filter_type: str, data: np.array): r""" Args: fs: frequency sampling band: the bandwidth aro...
Mariellapanag/pyiEEGfeatures
src/pyiEEGfeatures/IIR_notch_filter.py
IIR_notch_filter.py
py
2,731
python
en
code
1
github-code
36
[ { "api_name": "numpy.array", "line_number": 6, "usage_type": "attribute" }, { "api_name": "scipy.signal.iirfilter", "line_number": 27, "usage_type": "call" }, { "api_name": "scipy.signal.lfilter", "line_number": 28, "usage_type": "call" }, { "api_name": "scipy.sig...
8785489698
import gymnasium as gym from IPython import display import matplotlib.pyplot as plt from utils.visualize import visualize_policy, visualize_q, visualize_model, visualize_v class JupyterRender(gym.Wrapper): def __init__(self, env): super().__init__(env) self.env = env def render(self, title='En...
moripiri/Reinforcement-Learning-on-FrozenLake
utils/wrapper.py
wrapper.py
py
2,250
python
en
code
4
github-code
36
[ { "api_name": "gymnasium.Wrapper", "line_number": 6, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 24, "usage_type": "name" }, { "api_name": "util...
27052908549
from typing import List class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def levelOrder(self, root: TreeNode) -> List[List[int]]: if root is None: return [] vals = [] current_vals = [] ...
ikedaosushi/leetcode
problems/python/levelOrder.py
levelOrder.py
py
1,094
python
en
code
1
github-code
36
[ { "api_name": "typing.List", "line_number": 12, "usage_type": "name" }, { "api_name": "utils.binary_tree.from_nums", "line_number": 41, "usage_type": "call" } ]
72167483303
""" This file holds the interaction sites class used in simulation.py. """ import warnings from random import random from copy import deepcopy from itertools import combinations from math import comb import numpy as np class InteractionSites: """A class designed to host interactions between persons within specif...
Queens-Physics/quaboom
cv19/interaction_sites.py
interaction_sites.py
py
33,973
python
en
code
4
github-code
36
[ { "api_name": "numpy.zeros", "line_number": 65, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 66, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 74, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_numbe...
37877826411
import os import re import shutil from glob import glob from osrf_pycommon.process_utils import AsyncSubprocessProtocol from catkin_tools.common import mkdir_p from catkin_tools.terminal_color import fmt from .events import ExecutionEvent MAX_LOGFILE_HISTORY = 10 class IOBufferContainer(object): """A simple ...
catkin/catkin_tools
catkin_tools/execution/io.py
io.py
py
9,125
python
en
code
153
github-code
36
[ { "api_name": "os.path.join", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path", "line_number": 37, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path", "line_number": 3...
73971404584
from scripts.util.joystick import Joystick from carla_env import CarlaEnv from wrapped_carla_env import BiasedAction import time import carla import pygame import numpy as np class ManualInterface: def __init__(self, env: CarlaEnv): # create env self.env = env self.obs = None se...
imoneoi/carla_env
scripts/manual_control.py
manual_control.py
py
4,642
python
en
code
3
github-code
36
[ { "api_name": "carla_env.CarlaEnv", "line_number": 13, "usage_type": "name" }, { "api_name": "pygame.init", "line_number": 25, "usage_type": "call" }, { "api_name": "pygame.font.Font", "line_number": 31, "usage_type": "call" }, { "api_name": "pygame.font", "li...
1021810825
import os import cv2 import torch import numpy as np import matplotlib.pyplot as plt model_type = "DPT_Large" midas = torch.hub.load("intel-isl/MiDaS", model_type) device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu") midas.to(device) midas.eval() midas_transforms = torch.hub.load("int...
Roman212Koval/Dual-channel_CNN
monocular.py
monocular.py
py
1,994
python
en
code
1
github-code
36
[ { "api_name": "torch.hub.load", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.hub", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.cuda.is_available", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.cuda", ...
70553071464
import time, datetime import numpy as np import os import os.path as osp import torch import torchvision import matplotlib.pyplot as plt import torchvision.utils as vutils import torch.nn.functional as F import cv2 import glob import random from lib.utils.eval_utils import ( batch_compute_similarity_transform_tor...
JunukCha/SSPSE
utils/trainer_utils.py
trainer_utils.py
py
26,289
python
en
code
6
github-code
36
[ { "api_name": "time.strftime", "line_number": 54, "usage_type": "call" }, { "api_name": "time.gmtime", "line_number": 54, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 62, "usage_type": "call" }, { "api_name": "os.path", "line_number":...
31524108278
""" Test read submittal chain NOTE: this just makes sure the chain executes properly but DOES NOT assess the quality of the agent's analysis. That is done in the ipython notebooks in the evals/ folder """ import pytest from meche_copilot.schemas import Session from meche_copilot.chains.read_submittal_chain import Read...
fuzzy-tribble/meche-copilot
tests/unit_tests/chains/read_submittal_chain_test.py
read_submittal_chain_test.py
py
1,324
python
en
code
1
github-code
36
[ { "api_name": "meche_copilot.chains.read_submittal_chain.ReadSubmittalChain", "line_number": 15, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 13, "usage_type": "call" }, { "api_name": "meche_copilot.schemas.Session", "line_number": 18, "usage_typ...
23882256658
#!/usr/bin/env python3 """ Autonomy node for the TurtleBot3. This script relies on a YAML file of potential navigation locations, which is listed as a `location_file` ROS parameter. Example usage: ros2 run tb3_autonomy autonomy_node.py ros2 run tb3_autonomy autonomy_node.py --ros-args -p location_file:=/path/to...
sea-bass/turtlebot3_behavior_demos
tb3_autonomy/scripts/autonomy_node.py
autonomy_node.py
py
5,578
python
en
code
207
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": "ament_index_python.packages.get_package_share_directory", "line_number": 31, "usage_type": "call" }, { ...
2655039038
import torch import numpy as np import torch.utils.data import matplotlib.pyplot as plt n_train = 1000 class DS(torch.utils.data.Dataset): def __init__(self, n): self.n = n self.y = torch.rand(n)*21-10.5 self.x = torch.sin(0.75*self.y)*7.0+self.y*0.5+torch.randn(n) def __len__(self): ...
nguyenvantui/deepwriting-master-1
github_syn/my_mdn2.py
my_mdn2.py
py
2,177
python
en
code
1
github-code
36
[ { "api_name": "torch.utils", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.rand", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.sin", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.randn", "line_number":...
7755009879
import numpy as np import json import copy import functools from tensorpack.utils import logger from petridish.info.layer_info import LayerInfo, LayerInfoList, LayerTypes class CellNetworkInfo(dict): def __init__(self, master=None, normal=None, reduction=None): super(CellNetworkInfo, self).__init__(loca...
microsoft/petridishnn
petridish/info/net_info.py
net_info.py
py
27,723
python
en
code
111
github-code
36
[ { "api_name": "json.dumps", "line_number": 62, "usage_type": "call" }, { "api_name": "petridish.info.layer_info.LayerTypes.MERGE_WITH_SUM", "line_number": 91, "usage_type": "attribute" }, { "api_name": "petridish.info.layer_info.LayerTypes", "line_number": 91, "usage_type...