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
41310847925
import os from abc import ABC from keras import Model, layers from keras.layers import Conv2D, BatchNormalization, Add, MaxPool2D, GlobalAveragePooling2D, Flatten, Dense, Rescaling import tensorflow as tf class ResnetBlock(Model, ABC): """ A standard resnet block. """ def __init__(self, channels: in...
beishangongzi/graduation_internship
utils/Resnet.py
Resnet.py
py
3,958
python
en
code
0
github-code
6
[ { "api_name": "keras.Model", "line_number": 9, "usage_type": "name" }, { "api_name": "abc.ABC", "line_number": 9, "usage_type": "name" }, { "api_name": "keras.layers.Conv2D", "line_number": 28, "usage_type": "call" }, { "api_name": "keras.layers.BatchNormalization...
74992084668
import cv2 import numpy as np import os import sys import json import math import time import argparse from enum import Enum import platform class Config: @classmethod def init(cls): if platform.system() == "Windows": cls.QUIT_KEY = ord("q") cls.CONTINUE_KEY = 2555904 #right...
galatolofederico/manim-presentation
manim_presentation/present.py
present.py
py
11,126
python
en
code
153
github-code
6
[ { "api_name": "platform.system", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_...
26552249009
#!/usr/bin/env python3 import fnmatch import os import re import ntpath import sys import argparse # handle x64 python clipboard, ref https://forums.autodesk.com/t5/maya-programming/ctypes-bug-cannot-copy-data-to-clipboard-via-python/m-p/9197068/highlight/true#M10992 import ctypes from ctypes import wintypes CF_UNICO...
acemod/ACE3
tools/search_undefinedFunctions.py
search_undefinedFunctions.py
py
5,461
python
en
code
966
github-code
6
[ { "api_name": "ctypes.WinDLL", "line_number": 16, "usage_type": "call" }, { "api_name": "ctypes.WinDLL", "line_number": 17, "usage_type": "call" }, { "api_name": "ctypes.wintypes.HWND", "line_number": 20, "usage_type": "attribute" }, { "api_name": "ctypes.wintypes...
15873196557
from datetime import datetime def unix_to_dt(time): return datetime.utcfromtimestamp(time).strftime('%Y-%m-%d %H:%M:%S') class event(): def __init__(self, events): self.type = events['type'] self.empty = False if self.type == 'None': self.empty = True elif self.type...
theTrueEnder/GroupMe-Export-Parser
Python_Scripts/events.py
events.py
py
4,193
python
en
code
2
github-code
6
[ { "api_name": "datetime.datetime.utcfromtimestamp", "line_number": 3, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 3, "usage_type": "name" } ]
35817144385
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Automatic electric field computation ------------------------------------ :download:`examples/auto_efield.py` demonstrates how drift can be added self-consistently by calculating the electric field generated from the concentration profile of charged species. :: $ p...
chemreac/chemreac
examples/auto_efield.py
auto_efield.py
py
7,622
python
en
code
14
github-code
6
[ { "api_name": "numpy.pi", "line_number": 51, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number": 62, "usage_type": "attribute" }, { "api_name": "math.exp", "line_number": 64, "usage_type": "call" }, { "api_name": "math.erf", "line_number": 65...
13395399902
from PIL import Image def brighten_Image(pixelList): pix_len = len(pixelList) for i in range(pix_len): #assigns each part of tuple to a variable current_pixel = pixelList[i] #then will brigthen each by 50 red = current_pixel[0] green = current_pixel[1] blue = current_pixel[2] #this is not the best way, ex...
tommulvey/CSC15_python
10_3/brightenImage.py
brightenImage.py
py
1,001
python
en
code
0
github-code
6
[ { "api_name": "PIL.Image.open", "line_number": 22, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 22, "usage_type": "name" } ]
3727746961
### This file is meant to run from pc, *not* from the server. It extracts the # data from the datafile, posts it to the database and finally runs the day # command to add the day to the data. import math import pandas as pd import requests day_of_month = 6 def upload_data(fname): data = extract_data(fname) ...
simgeekiz/ApplabAPI
group2api/utils/UploadData.py
UploadData.py
py
1,592
python
en
code
0
github-code
6
[ { "api_name": "math.isnan", "line_number": 18, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 31, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 38, "usage_type": "call" } ]
72035219069
#!/usr/bin/env python3 from bcc import BPF from http.server import HTTPServer, BaseHTTPRequestHandler import sys import threading clone_ebpf = """ #include <uapi/linux/ptrace.h> #include <linux/sched.h> #include <linux/fs.h> #define ARGSIZE 128 BPF_PERF_OUTPUT(events); struct data_t { u32 pid; // PID as in t...
madhusudanas/ebpf-mac-python
misc/hello_world1.py
hello_world1.py
py
1,927
python
en
code
0
github-code
6
[ { "api_name": "bcc.BPF", "line_number": 48, "usage_type": "call" }, { "api_name": "http.server.BaseHTTPRequestHandler", "line_number": 66, "usage_type": "name" }, { "api_name": "sys.stdout", "line_number": 69, "usage_type": "attribute" }, { "api_name": "threading....
14837490064
from django.urls import path from . import views urlpatterns = [ path('products/', views.product_list, name='product_list'), path('product/<int:product_pk>/', views.product_detail, name='product_detail'), path('basket/', views.product_basket, name='product_basket'), path('product/<int:product_pk>/add_t...
meeeeeeeh/djangoblog
shop/urls.py
urls.py
py
855
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
41945752494
# usually big companies in Hollywood watermark their script with usually an actor's name. # So if that actor leaks the script well they'll know that that person has their name on the script and # they're the ones that leaked it. # so we are going to use this watermark throgh out all the pdf. import PyPDF2 template = ...
hyraja/python-starter
12.scripting python (projects)/pdf with python/03.pdf watermark.py
03.pdf watermark.py
py
702
python
en
code
0
github-code
6
[ { "api_name": "PyPDF2.PdfFileReader", "line_number": 8, "usage_type": "call" }, { "api_name": "PyPDF2.PdfFileReader", "line_number": 9, "usage_type": "call" }, { "api_name": "PyPDF2.PdfFileWriter", "line_number": 10, "usage_type": "call" } ]
22509106375
import numpy as np import logging from pathlib import Path #Output folder setup output = Path('./output/log').expanduser() output.mkdir(parents=True, exist_ok=True) en_log = logging.getLogger(__name__) en_log.setLevel(logging.DEBUG) formatter = logging.Formatter('%(asctime)s:%(name)s:%(message)s') file_handler = logg...
amuthankural/square_cavity_Natural_Convection
energy.py
energy.py
py
4,354
python
en
code
4
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.Formatter", ...
24282938220
from application import app, db from flask import redirect, render_template, request, url_for, flash from application.child.models import Child from application.quotes.models import Quote from application.likes.models import Likes from application.child.forms import ChildForm, MakeSureForm from datetime import datetime...
millalin/Kids-Say-the-Darndest-Things
application/child/views.py
views.py
py
4,587
python
en
code
1
github-code
6
[ { "api_name": "flask.render_template", "line_number": 14, "usage_type": "call" }, { "api_name": "application.child.models.Child.query.all", "line_number": 14, "usage_type": "call" }, { "api_name": "application.child.models.Child.query", "line_number": 14, "usage_type": "a...
25818064734
#!/usr/bin/env python3 # ============================================================================= # Author: Julen Bohoyo Bengoetxea # Email: julen.bohoyo@estudiants.urv.cat # ============================================================================= """ Description: A set of tools for semantic image segmentati...
julenbhy/biomedical_segmentation
tools/segmentation_utils.py
segmentation_utils.py
py
23,075
python
en
code
0
github-code
6
[ { "api_name": "glob.glob", "line_number": 48, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 49, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 49, "usage_type": "call" }, { "api_name": "os.path", "line_number": 49, ...
5528516422
from datetime import datetime from finnhub import Client from settings.constants import FINHUB_API_KEY class FinhubFetcher: def __init__(self, symbol: str) -> None: self.symbol = symbol def _init_client(self) -> None: return Client(FINHUB_API_KEY) def _get_params(self, resolution: str)...
VladisIove/darkstore
portfolio_manager/services/fetchers/finnhub.py
finnhub.py
py
949
python
en
code
0
github-code
6
[ { "api_name": "finnhub.Client", "line_number": 13, "usage_type": "call" }, { "api_name": "settings.constants.FINHUB_API_KEY", "line_number": 13, "usage_type": "argument" }, { "api_name": "datetime.datetime.now", "line_number": 16, "usage_type": "call" }, { "api_na...
37158346153
import squarify import matplotlib.pyplot as plt import matplotlib.cm import numpy as np x = 0. y = 0. width = 950 height = 733 fig = plt.figure(figsize=(15, 12)) ax = fig.add_subplot(111, axisbg='white') values = [285.4, 188.4, 173, 140.6, 91.4, 75.5, 62.3, 39.6, 29.4, 28.5, 26.2, 22.2] labels = ['South Africa', 'Eg...
QiliWu/Python-datavis
datavis/Africa GDP.py
Africa GDP.py
py
1,435
python
en
code
2
github-code
6
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 11, "usage_type": "name" }, { "api_name": "numpy.random.randint", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy...
24930679414
from datetime import datetime, timedelta from email import message from django.contrib.auth.models import User from django.contrib import messages from django.shortcuts import redirect, render from django.contrib.auth.decorators import login_required from django.http import HttpResponseRedirect, JsonResponse from .mode...
SachinBhattarai0/QueAns
answers/views.py
views.py
py
3,662
python
en
code
0
github-code
6
[ { "api_name": "django.core.serializers.serialize", "line_number": 18, "usage_type": "call" }, { "api_name": "django.core.serializers", "line_number": 18, "usage_type": "name" }, { "api_name": "django.http.JsonResponse", "line_number": 19, "usage_type": "call" }, { ...
72789313789
import numpy as np import time from scipy import ndimage from .toolkit import vectools from .toolkit.colors import Colors as _C import matplotlib.pyplot as plt import matplotlib import math import cv2 import sys import os __location__ = os.path.realpath( os.path.join(os.getcwd(), os.path.dirname(__file__))) cla...
lspgl/csat
sectorImage/core/image.py
image.py
py
12,778
python
en
code
0
github-code
6
[ { "api_name": "os.path.realpath", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number...
38504427534
import requests from scraper.get_strava_access_token import refreshed_access_token BASE_URL = 'https://www.strava.com' ACCESS_TOKEN = refreshed_access_token() def get_starred_segments(): print('Getting segement list') request_dataset_url = BASE_URL + '/api/v3/segments/starred' # check https://developers.st...
ADV-111/Srodunia
scraper/request_dataset_through_api.py
request_dataset_through_api.py
py
1,312
python
en
code
0
github-code
6
[ { "api_name": "scraper.get_strava_access_token.refreshed_access_token", "line_number": 6, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 27, "usage_type": "call" } ]
1662811500
import csv import os import numpy as np import json from pyexcel_ods import get_data PATTERN_TYPE = '1' COURSE_TYPE = 'speed' DATA_DIR = os.path.join(PATTERN_TYPE, COURSE_TYPE) fieldnames = ['min_speed','max_speed','delay','spacing','min_angle','max_angle','num_rows','min_b_scale','max_b_scale','clear_threshold','har...
gebgebgeb/bdt
courses/write_speed_courses.py
write_speed_courses.py
py
3,180
python
en
code
0
github-code
6
[ { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pyexcel_ods.get_data", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line...
1720170439
from wazirx_sapi_client.rest import Client from wazirx_sapi_client.websocket import WebsocketClient import time import websocket,json, pprint from websocket import create_connection from time import sleep import logging import pandas as pd import asyncio import socket, threading import json, sys, os, time, csv, reque...
deysanjeeb/wazirX-trailstop
trail.py
trail.py
py
9,134
python
en
code
0
github-code
6
[ { "api_name": "os.path.exists", "line_number": 20, "usage_type": "call" }, { "api_name": "config.API_KEY", "line_number": 23, "usage_type": "attribute" }, { "api_name": "config.SECRET_KEY", "line_number": 24, "usage_type": "attribute" }, { "api_name": "wazirx_sapi...
16838118388
from typing import List from urllib.parse import urlparse import pandas as pd from pathlib import Path from behave import Given, When, Then, Step from csvcubeddevtools.behaviour.file import get_context_temp_dir_path from csvcubeddevtools.helpers.file import get_test_cases_dir from rdflib import Graph from csvcubed.mod...
GDonRanasinghe/csvcubed-models-test-5
csvcubed/tests/behaviour/steps/qbwriter.py
qbwriter.py
py
27,298
python
en
code
0
github-code
6
[ { "api_name": "csvcubeddevtools.helpers.file.get_test_cases_dir", "line_number": 26, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 47, "usage_type": "call" }, { "api_name": "behave.Given", "line_number": 52, "usage_type": "call" }, { "ap...
29965694924
import pyowm import telebot owm = pyowm.OWM('6d00d1d4e704068d70191bad2673e0cc', language = "ru") bot = telebot.TeleBot( "1031233548:AAFfUXO0e8bDuOTWaQbHQCCuA_YJwRbqQlY" ) @bot.message_handler(content_types=['text']) def send_echo(message): observation = owm.weather_at_place( message.text ) w = observation....
Neynara/witherin
Bot.py
Bot.py
py
886
python
ru
code
0
github-code
6
[ { "api_name": "pyowm.OWM", "line_number": 4, "usage_type": "call" }, { "api_name": "telebot.TeleBot", "line_number": 5, "usage_type": "call" } ]
34839501596
import numpy as np import torch import torchvision import PIL import os def save_video(img,outdir, drange,fname="video0.mp4", normalize=True): _, C ,T ,H ,W = img.shape # print (f'Saving Video with {T} frames, img shape {H}, {W}') img = img.cpu().xdetach().numpy() if normalize: lo, hi = drang...
interiit-Team10/HP_BO_DIGAN
src/scripts/__init__.py
__init__.py
py
979
python
en
code
0
github-code
6
[ { "api_name": "numpy.asarray", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.rint", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_n...
22360354761
from dateutil.relativedelta import relativedelta from odoo.tests import common from odoo import fields class TestContractPriceRevision(common.SavepointCase): @classmethod def setUpClass(cls): super(TestContractPriceRevision, cls).setUpClass() partner = cls.env['res.partner'].create({ ...
detian08/bsp_addons
contract-11.0/contract_price_revision/tests/test_contract_price_revision.py
test_contract_price_revision.py
py
2,670
python
en
code
1
github-code
6
[ { "api_name": "odoo.tests.common.SavepointCase", "line_number": 7, "usage_type": "attribute" }, { "api_name": "odoo.tests.common", "line_number": 7, "usage_type": "name" }, { "api_name": "odoo.fields.Date.today", "line_number": 20, "usage_type": "call" }, { "api_n...
2500846027
# author: Tran Quang Loc (darkkcyan) # editorial: https://codeforces.com/blog/entry/8166 # Note: I switched to python for this problem because I want my check function to always use integer number # I tried to solve this problem using C++ and got overflow even with long long number # (and really, never chan...
quangloc99/CompetitiveProgramming
Codeforces/CF319-D1-C.py
CF319-D1-C.py
py
1,270
python
en
code
2
github-code
6
[ { "api_name": "collections.deque", "line_number": 26, "usage_type": "call" } ]
306333387
from fastapi import status, HTTPException, Depends, APIRouter from database import SessionLocal import models, schemas, utils router = APIRouter( prefix="/merchants", tags=['Merchants'] ) @router.post("/", status_code=status.HTTP_201_CREATED, response_model=schemas.MerchantResponse) def create_merchant(merch...
Roshankattel/RFID2
rfiddemo/routers/merchants.py
merchants.py
py
1,553
python
en
code
0
github-code
6
[ { "api_name": "fastapi.APIRouter", "line_number": 6, "usage_type": "call" }, { "api_name": "schemas.MerchantCreate", "line_number": 12, "usage_type": "attribute" }, { "api_name": "utils.hash", "line_number": 14, "usage_type": "call" }, { "api_name": "models.Mercha...
23248264647
# Usage: # python advertising_email.py username email_text.txt csv_of_emails.csv attachment1 attachment2 ... import smtplib from getpass import getpass from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.mime.base import MIMEBase from email import encoders import sys import c...
ngpaladi/PhysGAAP-Tools
mailer/advertising_email.py
advertising_email.py
py
2,321
python
en
code
0
github-code
6
[ { "api_name": "sys.argv", "line_number": 18, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 19, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 26, "usage_type": "attribute" }, { "api_name": "email.mime.base.MIMEBase", ...
17657890511
import time import speech_recognition as sr import pyttsx3 engine = pyttsx3.init() r = sr.Recognizer() voices = engine.getProperty('voices') # to check the voices available in the system '''for voice in voices: print("Voice:") print("ID: %s" %voice.id) print("Name: %s" %voice.name) print("Age:...
prakritisharma/Voice-recognition
voice_recognition.py
voice_recognition.py
py
2,928
python
en
code
0
github-code
6
[ { "api_name": "pyttsx3.init", "line_number": 5, "usage_type": "call" }, { "api_name": "speech_recognition.Recognizer", "line_number": 6, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 33, "usage_type": "call" }, { "api_name": "time.sleep", ...
24247317201
import tkinter import customtkinter import random cards = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 11] def draw(): global player_score global enemy_score win_label.configure(text=" ") randint = random.randint(0, len(cards) - 1) player_cards.append(cards[randint]) player_score += int(cards[randi...
anarkitty8/gui-blackjack
blackjack_gui.py
blackjack_gui.py
py
2,420
python
en
code
0
github-code
6
[ { "api_name": "random.randint", "line_number": 11, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 16, "usage_type": "call" }, { "api_name": "customtkinter.CTk", "line_number": 59, "usage_type": "call" }, { "api_name": "customtkinter.set_app...
19499854601
# -*- coding: utf-8 -*- import pytest from mdye_leetcode.solution_28 import Solution # makes a Solution object b/c that's how leetcode rolls @pytest.fixture(scope="module") def sol(): yield Solution() def test_solution_28_basic(sol: Solution): assert sol.strStr("mississippi", "issip") == 4 assert sol....
michaeldye/mdye-python-samples
src/mdye_leetcode/test/test_solution_28.py
test_solution_28.py
py
513
python
en
code
0
github-code
6
[ { "api_name": "mdye_leetcode.solution_28.Solution", "line_number": 11, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 9, "usage_type": "call" }, { "api_name": "mdye_leetcode.solution_28.Solution", "line_number": 14, "usage_type": "name" } ]
39425074538
import discord class DiscordClient(discord.Client): def __init__(self, channel: int, players: list): self.channel: int = channel self.players: list = players super().__init__() async def on_ready(self): print(f"{self.user} is connected!") channel = self.get_channel(se...
kevinrobayna/rio_discord_bot
rio_discord_bot/discord_client.py
discord_client.py
py
1,073
python
en
code
0
github-code
6
[ { "api_name": "discord.Client", "line_number": 4, "usage_type": "attribute" } ]
28359703116
import csv import DBN import matplotlib.pyplot as plt def getData(inp="../ABP_data_11traces_1min/dataset7.txt"): f = file(inp) lines = f.readlines() data = (map(float,l.split(" ")[:3]) for l in lines) # end = lines.index('\n') # obs = lines[1:end] # data = map(lambda x: tuple(map(float,x.split(','))),obs) retur...
romiphadte/ICU-Artifact-Detection-via-Bayesian-Inference
ABP_DBN/run.py
run.py
py
2,090
python
en
code
0
github-code
6
[ { "api_name": "DBN.DBN", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 45, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 45, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.pl...
16304395489
import cv2 import numpy as np import apriltag import collections apriltag_detect_error_thres = 0.07 def draw_pose(overlay, camera_params, tag_size, pose, z_sign=1, color=(0, 255, 0)): opoints = np.array([ -1, -1, 0, 1, -1, 0, 1, 1, 0, -1, 1, 0, -1, -1, -2 * z_sign, ...
dkguo/Pushing-Imitation
apriltag_detection.py
apriltag_detection.py
py
4,540
python
en
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 38, "usage_type": "call" }, { "api_name": "cv2.Rodrigues", "line_number"...
16194751087
import urllib import json import pandas as pd from pandas.io.json import json_normalize from rdflib import URIRef, BNode, Literal, Graph from rdflib import Namespace from rdflib.namespace import RDF, FOAF, RDFS, XSD from datetime import datetime #api key = 57ab2bbab8dda80e00969c4ea12d6debcaddd956 for jsdeux api #let'...
zhantileuov/rdf_project
generate.py
generate.py
py
5,906
python
en
code
0
github-code
6
[ { "api_name": "rdflib.Namespace", "line_number": 14, "usage_type": "call" }, { "api_name": "rdflib.Namespace", "line_number": 15, "usage_type": "call" }, { "api_name": "rdflib.Namespace", "line_number": 16, "usage_type": "call" }, { "api_name": "rdflib.Namespace",...
42663409589
import copy import math #needed for calculation of weight and bias initialization import numpy as np import pandas as pd from torch.utils.data import Dataset, DataLoader import torch, torch.nn as nn, torch.nn.functional as F import torchvision from torchvision import transforms, models, utils #Set seeds np.random.see...
rachellea/explainable-ct-ai
src/models/custom_models_mask.py
custom_models_mask.py
py
21,512
python
en
code
3
github-code
6
[ { "api_name": "numpy.random.seed", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.manual_seed", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.cuda.manu...
73026312507
from typing import DefaultDict import sys import os import csv sys.path.append(0, os.path.abspath('.')) sys.path.append(0, os.path.abspath('./src')) sys.path.append(0, os.path.abspath('./src/utilities')) from src.utilities import SCRIPT_HOME from src.utilities.post_process import post_proc_timeseries from net_sim impor...
mattall/topology-programming
scripts/TDSC/sim_event.py
sim_event.py
py
3,375
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number...
8708126012
from __future__ import unicode_literals import datetime import logging import os import tweepy as tp from twiker.modules.tauth import Auth class Engine(object): """ The main engine class for the Twiker Bot.This class includes all the api methods Copyright (c) 2021 The Knight All rights reserve...
Twiker-Bot/twiker
twiker/modules/engine.py
engine.py
py
26,243
python
en
code
1
github-code
6
[ { "api_name": "twiker.modules.tauth.Auth", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.path.dirname",...
26039112676
from __future__ import annotations from dataclasses import dataclass from pants.core.goals.package import BuiltPackageArtifact from pants.util.strutil import bullet_list, pluralize @dataclass(frozen=True) class BuiltDockerImage(BuiltPackageArtifact): # We don't really want a default for this field, but the supe...
pantsbuild/pants
src/python/pants/backend/docker/package_types.py
package_types.py
py
1,072
python
en
code
2,896
github-code
6
[ { "api_name": "pants.core.goals.package.BuiltPackageArtifact", "line_number": 10, "usage_type": "name" }, { "api_name": "pants.util.strutil.bullet_list", "line_number": 21, "usage_type": "call" }, { "api_name": "pants.util.strutil.pluralize", "line_number": 27, "usage_typ...
41939702684
# translate exercise in python # translate the file in japanese # so use ' pip install translate' from translate import Translator translator = Translator(to_lang='ja') try: with open('test.txt', mode='r') as my_file: text = my_file.read() translation = translator.translate(text) with ope...
hyraja/python-starter
09.FILE I-O python/03.exercise_translator.py
03.exercise_translator.py
py
481
python
en
code
0
github-code
6
[ { "api_name": "translate.Translator", "line_number": 8, "usage_type": "call" } ]
39920879314
""" This module implement the ServiceProxy class. This class is used to provide a local proxy to a remote service for a ZeroRobot. When a service or robot ask the creation of a service to another robot, a proxy class is created locally so the robot see the service as if it as local to him while in reality the service ...
BolaNasr/0-robot
zerorobot/service_proxy.py
service_proxy.py
py
7,252
python
en
code
0
github-code
6
[ { "api_name": "urllib.parse.urlencode", "line_number": 45, "usage_type": "call" }, { "api_name": "urllib.parse", "line_number": 45, "usage_type": "attribute" }, { "api_name": "zerorobot.template.state.ServiceState", "line_number": 55, "usage_type": "call" }, { "ap...
23313489127
import bpy class SFX_Socket_Float(bpy.types.NodeSocket): '''SFX Socket for Float''' bl_idname = 'SFX_Socket_Float' bl_label = "Float" float: bpy.props.FloatProperty(name = "Float", description = "Float", default = 0.0) ...
wiredworks/wiredworks_winches
sockets/SFX_Socket_Float.py
SFX_Socket_Float.py
py
1,073
python
en
code
12
github-code
6
[ { "api_name": "bpy.types", "line_number": 3, "usage_type": "attribute" }, { "api_name": "bpy.props.FloatProperty", "line_number": 8, "usage_type": "call" }, { "api_name": "bpy.props", "line_number": 8, "usage_type": "attribute" } ]
18003867595
import torch import torch.nn as nn import torch.nn.functional as F from algo.pn_utils.maniskill_learn.networks import build_model, hard_update, soft_update from algo.pn_utils.maniskill_learn.optimizers import build_optimizer from algo.pn_utils.maniskill_learn.utils.data import to_torch from ..builder import MFRL from ...
PKU-EPIC/UniDexGrasp
dexgrasp_policy/dexgrasp/algo/pn_utils/maniskill_learn/methods/mfrl/td3.py
td3.py
py
3,767
python
en
code
63
github-code
6
[ { "api_name": "algo.pn_utils.maniskill_learn.utils.torch.BaseAgent", "line_number": 13, "usage_type": "name" }, { "api_name": "algo.pn_utils.maniskill_learn.networks.build_model", "line_number": 34, "usage_type": "call" }, { "api_name": "algo.pn_utils.maniskill_learn.networks.bui...
20602544780
from sqlalchemy import create_engine, Column, Integer, String, Float from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker engine = create_engine('sqlite:///test.db', echo=True) Base = declarative_base(engine) ############################################################...
BhujayKumarBhatta/flask-learning
flaskr/db/mysqlalchemy.py
mysqlalchemy.py
py
2,971
python
en
code
1
github-code
6
[ { "api_name": "sqlalchemy.create_engine", "line_number": 5, "usage_type": "call" }, { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 6, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 14, "usage_type": "call" }, { ...
23185192152
#!/usr/bin/env python3 """ Download the name of all games in the bundle. Download their info and scrore from opencritic if they exist there. Sort by score. """ import json import urllib.request import urllib.parse from typing import List from bs4 import BeautifulSoup from typing_extensions import TypedDict Game = ...
Hyerfatos/itchio_bundle_games
itch.py
itch.py
py
3,789
python
en
code
0
github-code
6
[ { "api_name": "typing_extensions.TypedDict", "line_number": 18, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 28, "usage_type": "name" }, { "api_name": "bs4.BeautifulSoup", "line_number": 42, "usage_type": "call" }, { "api_name": "typing.List...
28773188393
""" examples @when('the user searches for "{phrase}"') def step_impl(context, phrase): search_input = context.browser.find_element_by_name('q') search_input.send_keys(phrase + Keys.RETURN) @then('results are shown for "{phrase}"') def step_impl(context, phrase): links_div = context.browser.find_element_b...
kevindvaf/rocketmiles
features/steps/search.py
search.py
py
4,218
python
en
code
0
github-code
6
[ { "api_name": "time.sleep", "line_number": 40, "usage_type": "call" }, { "api_name": "selenium.webdriver.common.by.By.XPATH", "line_number": 43, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.common.by.By", "line_number": 43, "usage_type": "name" }, { ...
34421435243
import numpy as np import pandas as pd import json import argparse import catboost from catboost import CatBoostClassifier, Pool, metrics, cv from catboost.utils import get_roc_curve, get_confusion_matrix, eval_metric from sklearn.metrics import accuracy_score, roc_auc_score from sklearn.model_selection import train_...
mihael-tunik/SteppingStonesCatboost
classifier.py
classifier.py
py
4,248
python
en
code
0
github-code
6
[ { "api_name": "catboost.CatBoostClassifier", "line_number": 16, "usage_type": "call" }, { "api_name": "catboost.metrics.Accuracy", "line_number": 17, "usage_type": "call" }, { "api_name": "catboost.metrics", "line_number": 17, "usage_type": "name" }, { "api_name":...
16208817026
#-*- coding: UTF-8 -*- ''' @author: chenwuji 读取原始文件 将脚本保存为按照天的文件 ''' import tools alldata = {} map_dict = {} global_count = 1 def read_data(filename): f = open(filename) for eachline in f: if(len(eachline.split('values (')) < 2): continue eachline = eachline.decode('GBK').encode('U...
chenwuji91/vehicle
src_1_sql_to_day_data/data_process.py
data_process.py
py
1,769
python
en
code
0
github-code
6
[ { "api_name": "tools.writeToFile", "line_number": 41, "usage_type": "call" }, { "api_name": "tools.toFileWithPickle", "line_number": 53, "usage_type": "call" } ]
37056623803
import os import numpy as np from sklearn import datasets from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.model_selection import KFold, GridSearchCV from sklearn.svm import SVC from sklearn.externals import joblib from utils import save_answer BASE_DIR = os.path.dirname(os.path.realpath(__file...
Nick-Omen/coursera-yandex-introduce-ml
lessons/article/main.py
main.py
py
1,903
python
en
code
0
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "lin...
30066696464
import logging import os from PIL import Image from PIL.ExifTags import TAGS class Utils: @staticmethod def extract_exif_data(image: Image) -> {}: map_tag_dict = {} exif_data = image.getexif() for tag_id in exif_data: tag = TAGS.get(tag_id, tag_id) data = exif_...
greencashew/image-captioner
imagecaptioner/utils.py
utils.py
py
1,630
python
en
code
0
github-code
6
[ { "api_name": "PIL.Image", "line_number": 10, "usage_type": "name" }, { "api_name": "PIL.ExifTags.TAGS.get", "line_number": 14, "usage_type": "call" }, { "api_name": "PIL.ExifTags.TAGS", "line_number": 14, "usage_type": "name" }, { "api_name": "os.listdir", "l...
11814433027
from get_url import GetUrl import requests from bs4 import BeautifulSoup class GetText(): def __init__(self, area): self.got_url = GetUrl() self.url = self.got_url.get_url(area) def get_url(self): url = self.url return url def get_text(self): err_text = '以下の地域から選んでください\n北海道\n東北\n関東\n信越・北陸\n東海\n近畿\n中国\n...
yutatakaba/weather_apr
get_text.py
get_text.py
py
761
python
en
code
0
github-code
6
[ { "api_name": "get_url.GetUrl", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 23, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 24, "usage_type": "call" } ]
74160534269
import datetime import enum import os import signal import subprocess import sys import time import typing from logging import getLogger from threading import Thread import requests from slugify import slugify from config import Setting, client_id, client_secret from util import file_size_mb, get_setting logger = ge...
bcla22/twitch-multistream-recorder
twitch.py
twitch.py
py
8,358
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "enum.Enum", "line_number": 21, "usage_type": "attribute" }, { "api_name": "typing.TypedDict", "line_number": 29, "usage_type": "attribute" }, { "api_name": "config.client_...
13412454502
# 自己设计的CNN模型 import torch.nn as nn import torch.nn.functional as F class ConvolutionalNetwork(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(3, 6, 3, 1) # conv1 (RGB图像,输入通道数为3) self.conv2 = nn.Conv2d(6, 16, 3, 1) # conv2 self.fc1 = nn.Linear(54 *...
Tommy-Bie/sign_language_classification
my_CNN.py
my_CNN.py
py
924
python
en
code
1
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 4, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.nn", "line_numbe...
35835057096
from re import compile from utils import BasicError # Class for Tokens class Token(): # Token type will have a name and a value def __init__(self, type_name, value, pos_start, pos_end): self.type = type_name self.value = value self.pos_start = pos_start self.pos_end = pos_end ...
shaleen111/pyqb
lexer.py
lexer.py
py
2,416
python
en
code
0
github-code
6
[ { "api_name": "re.compile", "line_number": 24, "usage_type": "call" }, { "api_name": "utils.BasicError", "line_number": 50, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 71, "usage_type": "call" } ]
11463544163
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed May 11 12:08:53 2022 @author: sampasmann """ import sys sys.path.append("../../") import os from src.init_files.mg_init import MultiGroupInit import numpy as np import matplotlib.pyplot as plt Nx = 1 data12 = MultiGroupInit(numGroups=12, Nx=Nx) data70...
spasmann/iQMC
post_process/plotting/mg_solutions.py
mg_solutions.py
py
1,957
python
en
code
2
github-code
6
[ { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "src.init_files.mg_init.MultiGroupInit", "line_number": 17, "usage_type": "call" }, { "api_name": "s...
39691118341
#!/usr/bin/env python import sys from xml.etree import ElementTree def run(files): first = None for filename in files: data = ElementTree.parse(filename).getroot() if first is None: first = data else: first.extend(data) if first is not None: print(Ele...
cheqd/cheqd-node
.github/scripts/xml_combine.py
xml_combine.py
py
412
python
en
code
61
github-code
6
[ { "api_name": "xml.etree.ElementTree.parse", "line_number": 8, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 8, "usage_type": "name" }, { "api_name": "xml.etree.ElementTree.tostring", "line_number": 14, "usage_type": "call" }, { "ap...
71432253948
import click group = click.Group("jaqsmds") @group.command(help="Run auth server for jaqs.data.DataApi client.") @click.argument("variables", nargs=-1) @click.option("-a", "--auth", is_flag=True, default=False) def server(variables, auth): from jaqsmds.server.server import start_service env = {} for it...
cheatm/jaqsmds
jaqsmds/entry_point.py
entry_point.py
py
642
python
en
code
4
github-code
6
[ { "api_name": "click.Group", "line_number": 4, "usage_type": "call" }, { "api_name": "jaqsmds.server.server.start_service", "line_number": 19, "usage_type": "call" }, { "api_name": "click.argument", "line_number": 8, "usage_type": "call" }, { "api_name": "click.op...
8662253484
import logging import sys import tarfile import tempfile from urllib.request import urlopen from zipfile import ZipFile from pathlib import Path TF = "https://github.com/tensorflow/tflite-micro/archive/80cb11b131e9738dc60b2db3e2f1f8e2425ded52.zip" CMSIS = "https://github.com/ARM-software/CMSIS_5/archive/a75f01746df18b...
alifsemi/alif_ml-embedded-evaluation-kit
download_dependencies.py
download_dependencies.py
py
4,091
python
en
code
1
github-code
6
[ { "api_name": "urllib.request.urlopen", "line_number": 23, "usage_type": "call" }, { "api_name": "tempfile.NamedTemporaryFile", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 24, "usage_type": "call" }, { "api_name": "loggi...
37009441089
# coding=utf-8 import pymysql from com.petstore.dao.base_dao import BaseDao """订单明细管理DAO""" class OrderDetailDao(BaseDao): def __init__(self): super().__init__() def create(self, orderdetail): """创建订单明细,插入到数据库""" try: with self.conn.cursor() as cursor: sql ...
wanglun0318/petStore
com/petstore/dao/order_detail_dao.py
order_detail_dao.py
py
862
python
en
code
0
github-code
6
[ { "api_name": "com.petstore.dao.base_dao.BaseDao", "line_number": 7, "usage_type": "name" }, { "api_name": "pymysql.DatabaseError", "line_number": 21, "usage_type": "attribute" } ]
32915067412
from django.contrib.auth import get_user_model from django.db import models User = get_user_model() class Group(models.Model): title = models.TextField(max_length=200, verbose_name='Название') slug = models.SlugField(unique=True, verbose_name='Идентификатор') description = models.TextField(verbose_name='...
dew-77/api_final_yatube
yatube_api/posts/models.py
models.py
py
2,618
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 4, "usage_type": "call" }, { "api_name": "django.db.models.Model", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 7, "usage_type": "name" }, { "api_...
3400836706
# -*- coding: utf-8 -*- from flask import Flask from pydoc import locate class ConstructApp(object): def __init__(self): self.extensions = {} self.web_app = self.init_web_app() def __call__(self, settings, force_init_web_app=False): if force_init_web_app is True: self.w...
tigal/mooc
application.py
application.py
py
1,660
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 21, "usage_type": "call" }, { "api_name": "pydoc.locate", "line_number": 36, "usage_type": "call" } ]
17016755905
import urllib.request as request import json src="https://padax.github.io/taipei-day-trip-resources/taipei-attractions-assignment.json" with request.urlopen(src) as response: data=json.load(response) spot_data=data["result"]["results"] with open("data.csv","w",encoding="UTF-8-sig") as file: for spot_item...
ba40431/wehelp-assignments
week_3/week_3.py
week_3.py
py
629
python
en
code
0
github-code
6
[ { "api_name": "urllib.request.urlopen", "line_number": 4, "usage_type": "call" }, { "api_name": "urllib.request", "line_number": 4, "usage_type": "name" }, { "api_name": "json.load", "line_number": 5, "usage_type": "call" } ]
74048870269
import pandas as pd import os from calendar import monthrange from datetime import datetime,timedelta import re import numpy as np from models.fed_futures_model.backtestloader import BacktestLoader from models.fed_futures_model.fff_model import FederalFundsFuture class Backtest(): def __init__(self, path): ...
limjoobin/bt4103-rate-decision-index
rate_decision_index/models/fed_futures_model/backtest.py
backtest.py
py
3,664
python
en
code
0
github-code
6
[ { "api_name": "models.fed_futures_model.backtestloader.BacktestLoader", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "name" }, { "api_name": "models.fed_futures_model.fff_model.FederalFundsFuture", "line_number...
10420450933
from __future__ import annotations from typing import TYPE_CHECKING from randovania.games.prime1.layout.hint_configuration import PhazonSuitHintMode from randovania.games.prime1.layout.prime_configuration import ( LayoutCutsceneMode, PrimeConfiguration, RoomRandoMode, ) from randovania.layout.preset_descr...
randovania/randovania
randovania/games/prime1/layout/preset_describer.py
preset_describer.py
py
9,313
python
en
code
165
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 17, "usage_type": "name" }, { "api_name": "randovania.games.prime1.layout.prime_configuration.LayoutCutsceneMode.MAJOR", "line_number": 21, "usage_type": "attribute" }, { "api_name": "randovania.games.prime1.layout.prime_config...
8224455984
# MAC0318 Intro to Robotics # Please fill-in the fields below with every team member info # # Name: José Lucas Silva Mayer # NUSP: 11819208 # # Name: Willian Wang # NUSP: 11735380 # # Any supplemental material for your agent to work (e.g. neural networks, data, etc.) should be # uploaded elsewhere and listed down below...
josemayer/pato-wheels
project/agent.py
agent.py
py
5,379
python
en
code
0
github-code
6
[ { "api_name": "tensorflow.keras.models.load_model", "line_number": 48, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 48, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.models.load_model", "line_number": 51, "usage_type": "call" }...
13438082129
""" Boston house prices dataset """ import sklearn.datasets import numpy as np import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_squared_error, r2_score from sklearn.model_selection import train_test_split from sklearn.preprocessing import PolynomialFeat...
i-hs/lab-python
scratch13/ex05.py
ex05.py
py
6,999
python
en
code
0
github-code
6
[ { "api_name": "sklearn.datasets.datasets.load_boston", "line_number": 15, "usage_type": "call" }, { "api_name": "sklearn.datasets.datasets", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sklearn.datasets", "line_number": 15, "usage_type": "name" }, { ...
9622430105
#!/usr/bin/env python3 import base64 import c3, c5 from itertools import combinations def beautify(candidates: list): ''' Pretty prints the candidates returned ''' s = '' for c in candidates: s += 'Keysize: {}\tHamming Distance: {}\n'.format( c['keysize'], c['normalized_distance']) ret...
oatovar/Cryptopals-Solutions
c06.py
c06.py
py
4,159
python
en
code
0
github-code
6
[ { "api_name": "base64.b64decode", "line_number": 39, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 44, "usage_type": "call" }, { "api_name": "base64.b64decode", "line_number": 67, "usage_type": "call" }, { "api_name": "c3.singlebyt...
5593654816
import telegram import google import logging import base64 import io from requests_html import HTMLSession from google.cloud import firestore from bs4 import BeautifulSoup from PIL import Image from time import sleep from Spider import get_all_course from UESTC_Login import _login, get_captcha def __Bot_t...
mrh929/uestc_calendar_bot
calendar/main.py
main.py
py
6,925
python
en
code
0
github-code
6
[ { "api_name": "base64.b64encode", "line_number": 118, "usage_type": "call" }, { "api_name": "UESTC_Login.get_captcha", "line_number": 123, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 129, "usage_type": "call" }, { "api_name": "base64.b...
12789805626
from errno import EIO, ENOSPC, EROFS import sys import os import traceback import glob from decimal import Decimal, getcontext getcontext().prec = 6 assert sys.platform == 'linux', 'This script must be run only on Linux' assert sys.version_info.major >= 3 and sys.version_info.minor >= 5, 'This script requires Pytho...
skazanyNaGlany/amipi400
amiga_disk_devices.py
amiga_disk_devices.py
py
56,855
python
en
code
0
github-code
6
[ { "api_name": "decimal.getcontext", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.platform", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.version_info", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.geteuid...
34670378486
import sys from math import log from copy import deepcopy from typing import Dict, List from lib.graph import Graph, read_input_csv class TraceNode: def __init__(self, id): self.id = id self.preds = [] def shortest_trace(graph, node): """ Compute the shortest attack trace to the specifi...
pmlab-ucd/IOTA
python/graph_analyzer.py
graph_analyzer.py
py
7,605
python
en
code
1
github-code
6
[ { "api_name": "typing.List", "line_number": 77, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 83, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 83, "usage_type": "name" }, { "api_name": "copy.deepcopy", "line_number"...
34348826764
from datetime import datetime from django.contrib.auth.models import AbstractUser from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models YEAR_VALIDATION_ERROR = 'Нельзя добавить произведение из будущего' SCORE_VALIDATION_ERROR = 'Оценка должна быть от 1 до 10' class Use...
RomanK74/api_yamdb
api/models.py
models.py
py
6,054
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.auth.models.AbstractUser", "line_number": 11, "usage_type": "name" }, { "api_name": "django.db.models.TextField", "line_number": 23, "usage_type": "call" }, { "api_name": "django.db.models", "line_number": 23, "usage_type": "name" }, { ...
20856359623
""" Training code for harmonic Residual Networks. Licensed under the BSD License [see LICENSE for details]. Written by Matej Ulicny, based on pytorch example code: https://github.com/pytorch/examples/tree/master/imagenet """ import argparse import os import random import shutil import time import war...
matej-ulicny/harmonic-networks
imagenet/main.py
main.py
py
13,809
python
en
code
55
github-code
6
[ { "api_name": "models.__dict__", "line_number": 25, "usage_type": "attribute" }, { "api_name": "models.__dict__", "line_number": 27, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 29, "usage_type": "call" }, { "api_name": "ran...
72249954427
import json import atexit import subprocess import yaml import argparse import textwrap from dataclasses import dataclass @dataclass class Config: num_nodes: int config_path: str def __init__(self, n: int, c: str): self.num_nodes = n self.config_path = c self.place_holder_commands...
pesos/heiko
docker-networks.py
docker-networks.py
py
3,338
python
en
code
13
github-code
6
[ { "api_name": "dataclasses.dataclass", "line_number": 10, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 22, "usage_type": "call" }, { "api_name": "textwrap.dedent", "line_number": 24, "usage_type": "call" }, { "api_name": "argpars...
36830731053
import json import time from threading import Thread import pika from pika.exceptions import ConnectionClosed from utils import Logging class RabbitMQClient(Logging): _channel_impl = None def __init__(self, address, credentials, exchange, exchange_type='topic'): super(RabbitMQClient, self).__init__...
deepsense-ai/seahorse
remote_notebook/code/rabbit_mq_client.py
rabbit_mq_client.py
py
4,047
python
en
code
104
github-code
6
[ { "api_name": "utils.Logging", "line_number": 11, "usage_type": "name" }, { "api_name": "threading.Thread", "line_number": 57, "usage_type": "call" }, { "api_name": "pika.BlockingConnection", "line_number": 74, "usage_type": "call" }, { "api_name": "pika.Connectio...
74434743869
from django.shortcuts import render from django.contrib.auth.decorators import login_required from test_generator.models import * # Create your views here. def home(request): if request.user.is_authenticated: status = "You're currently logged in." else: status = "You're not currently logged i...
alenamedzova/final_project
tester_services/views.py
views.py
py
767
python
en
code
0
github-code
6
[ { "api_name": "django.shortcuts.render", "line_number": 14, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 27, "usage_type": "call" }, { "api_name": "django.contrib.auth.decorators.login_required", "line_number": 22, "usage_type": "name" ...
1005006973
import socket import json class pyWave: configStr = "{ 'enableRawOutput': 'enableRawOutput', 'format': 'Json'}" configByte = configStr.encode() val = 0 def __init__(self, _host, _port): self.host = _host self.port = _port def connect(self): # This is a standard connectio...
kittom/Mind-Control-Car
BrainWaveReader/pywave.py
pywave.py
py
1,713
python
en
code
0
github-code
6
[ { "api_name": "socket.socket", "line_number": 19, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 19, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 19, "usage_type": "attribute" }, { "api_name": "json.loads"...
38008765446
""" # Analysis utilities This script belongs to the following manuscript: - Mathôt, Berberyan, Büchel, Ruuskanen, Vilotjević, & Kruijne (in prep.) *Causal effects of pupil size on visual ERPs* This module contains various constants and functions that are used in the main analysis scripts. """ import random import ...
smathot/causal-pupil
analysis_utils.py
analysis_utils.py
py
23,689
python
en
code
2
github-code
6
[ { "api_name": "mne.set_log_level", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 27, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 27, "usage_type": "attribute" }, { "api_name": "sys.argv", ...
10140997594
# -*- coding: utf-8 -*- # @Time : 19-1-24 下午9:35 # @Author : ccs import json from django.http import HttpResponse def calc(request): a = request.GET['a'] b = request.GET['b'] c = request.GET['c'] print(a,b,c) m = a+b+c n = b+a rets = {"m":m,"n":n} retsj = json.dumps(rets) retu...
ccs258/python_code
learn_api.py
learn_api.py
py
348
python
en
code
0
github-code
6
[ { "api_name": "json.dumps", "line_number": 17, "usage_type": "call" }, { "api_name": "django.http.HttpResponse", "line_number": 18, "usage_type": "call" } ]
32108433366
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import logging from temba_client.v2 import TembaClient from django.conf import settings from django.db import migrations from ureport.utils import datetime_to_json_date, json_date_to_datetime logger = logging...
rapidpro/ureport
ureport/polls/migrations/0023_populate_flow_date.py
0023_populate_flow_date.py
py
1,499
python
en
code
23
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "django.db.migrations.Migration", "line_number": 16, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 16, "usage_type": "name" }, { "api_na...
34702779543
from firebase_admin import firestore from sklearn.feature_extraction.text import CountVectorizer from sklearn.metrics.pairwise import cosine_similarity def get_user_skills(userid): item = firestore.client().collection('user').document(userid).get().to_dict()['skills'] user_skill_string = ' '.join(str(e) for e...
prajwol-manandhar/resume-analysis-website
analysis.py
analysis.py
py
869
python
en
code
1
github-code
6
[ { "api_name": "firebase_admin.firestore.client", "line_number": 7, "usage_type": "call" }, { "api_name": "firebase_admin.firestore", "line_number": 7, "usage_type": "name" }, { "api_name": "sklearn.feature_extraction.text.CountVectorizer", "line_number": 14, "usage_type":...
26848770395
import sys from PySide6.QtWidgets import QApplication, QPushButton from PySide6.QtCore import Slot # 这个例子包含Signals and Slots(信号与槽机制) # 使用@Slot()表明这是一个槽函数 # @Slot() 服了,没使用这个居然也能照常运行 def say_hello(): print("Button, clicked, hello!") app = QApplication([]) # QPushButton里面的参数是按钮上会显示的文字 button = QPus...
RamboKingder/PySide6
button-2.py
button-2.py
py
524
python
zh
code
2
github-code
6
[ { "api_name": "PySide6.QtWidgets.QApplication", "line_number": 13, "usage_type": "call" }, { "api_name": "PySide6.QtWidgets.QPushButton", "line_number": 16, "usage_type": "call" } ]
3151231607
import sys import form from PyQt4 import QtCore, QtGui import letters import pygame class ConnectorToMainWindow(QtGui.QMainWindow): def __init__(self, parent = None): super(ConnectorToMainWindow, self).__init__() self.expected_letter = '' self.timer = QtCore.QTimer() self.ui = form...
Tal-Levy/homeSchooling
first_steps.py
first_steps.py
py
3,110
python
en
code
0
github-code
6
[ { "api_name": "PyQt4.QtGui.QMainWindow", "line_number": 8, "usage_type": "attribute" }, { "api_name": "PyQt4.QtGui", "line_number": 8, "usage_type": "name" }, { "api_name": "PyQt4.QtCore.QTimer", "line_number": 12, "usage_type": "call" }, { "api_name": "PyQt4.QtCo...
9721588822
import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk ICONSIZE = Gtk.IconSize.SMALL_TOOLBAR class controlBar(Gtk.HeaderBar): def __init__(self): Gtk.HeaderBar.__init__(self) self.set_show_close_button(True) self.props.title = "PyFlowChart" self.info_bo...
steelcowboy/PyFlowChart
pyflowchart/interface/control_bar.py
control_bar.py
py
3,719
python
en
code
5
github-code
6
[ { "api_name": "gi.require_version", "line_number": 2, "usage_type": "call" }, { "api_name": "gi.repository.Gtk.IconSize", "line_number": 5, "usage_type": "attribute" }, { "api_name": "gi.repository.Gtk", "line_number": 5, "usage_type": "name" }, { "api_name": "gi....
764504946
from sklearn.base import BaseEstimator, ClusterMixin, TransformerMixin from sklearn.cluster import DBSCAN, KMeans, SpectralClustering from sklearn.neighbors import KNeighborsClassifier from sklearn.preprocessing import LabelBinarizer class ClusterTransformer(TransformerMixin, BaseEstimator): """Turns sklearn clus...
x-tabdeveloping/blackbert
blackbert/cluster.py
cluster.py
py
4,673
python
en
code
0
github-code
6
[ { "api_name": "sklearn.base.TransformerMixin", "line_number": 7, "usage_type": "name" }, { "api_name": "sklearn.base.BaseEstimator", "line_number": 7, "usage_type": "name" }, { "api_name": "sklearn.base.ClusterMixin", "line_number": 32, "usage_type": "name" }, { "...
21610135351
import requests import re import json from nonebot import on_command, CommandSession @on_command('lol新闻', aliases=('lol新闻')) async def weather(session: CommandSession): url = "http://l.zhangyoubao.com/news/" headers = { 'User-Agent': 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.6) Ge...
Lmg66/QQrobot
awesome-bot/awesome/plugins/lol.py
lol.py
py
980
python
en
code
3
github-code
6
[ { "api_name": "nonebot.CommandSession", "line_number": 6, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 15, "usage_type": "call" }, { "api_name": "re.findall", "line_...
9766823930
from collections import * import numpy as np from common.session import AdventSession session = AdventSession(day=20, year=2017) data = session.data.strip() data = data.split('\n') p1, p2 = 0, 0 class Particle: def __init__(self, p, v, a, _id): self.p = np.array(p) self.v = np.array(v) ...
smartspot2/advent-of-code
2017/day20.py
day20.py
py
1,196
python
en
code
0
github-code
6
[ { "api_name": "common.session.AdventSession", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", ...
36697678270
#Coded by: QyFashae import os from sklearn.model_selection import train_test_split from sklearn.pipeline import Pipeline from sklearn.feature_extraction.text import HashingVectorizer, TfidfTransformer from sklearn.metrics import accuracy_score, confusion_matrix from sklearn import tree # Paths to the directories cont...
Qyfashae/ML_IDS_EmailSec_Spam
smtp_assasin.py
smtp_assasin.py
py
2,150
python
en
code
1
github-code
6
[ { "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.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 1...
40941005277
# github üzerinden yapılan arama sonuçlarını consola yazdırma from selenium import webdriver from selenium.webdriver.common.keys import Keys import time driver = webdriver.Chrome() url = "https://github.com" driver.get(url) searchInput = driver.find_element_by_name("q") time.sleep(1) print("\n" + driver.titl...
furkan-A/Python-WS
navigate.py
navigate.py
py
588
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 8, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 8, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 16, "usage_type": "call" }, { "api_name": "time.sleep", ...
36659620035
# finding the right modules/packages to use is not easy import os import pyodbc from numpy import genfromtxt import pandas as pd import sqlalchemy as sa # use sqlalchemy for truncating etc from sqlalchemy import Column, Integer, Float, Date, String, BigInteger from sqlalchemy.ext.declarative import declarative_base...
BertrandLeroy/GPXReader
ProcessStravaGPX.py
ProcessStravaGPX.py
py
7,471
python
en
code
0
github-code
6
[ { "api_name": "urllib.parse.quote_plus", "line_number": 37, "usage_type": "call" }, { "api_name": "urllib.parse", "line_number": 37, "usage_type": "attribute" }, { "api_name": "sqlalchemy.create_engine", "line_number": 42, "usage_type": "call" }, { "api_name": "pa...
40615421063
import os import time from collections import Counter import numpy as np from sklearn.preprocessing import MinMaxScaler import core.leading_tree as lt import core.lmca as lm from core.delala_select import DeLaLA_select from utils import common def load_parameters(param_path): dataset = common.load...
alanxuji/DeLaLA
DeLaLA/DeLaLA-Letter.py
DeLaLA-Letter.py
py
7,574
python
en
code
6
github-code
6
[ { "api_name": "utils.common.load_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "utils.common", "line_number": 15, "usage_type": "name" }, { "api_name": "numpy.zeros", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.zeros", "lin...
11275131068
from django.contrib import admin from django.urls import path, include from basesite import views urlpatterns = [ path('', views.index, name='index'), path('academics', views.academics, name='academics'), path('labs', views.labs, name='labs'), path('committee', views.committee, name='committe...
Mr-vabs/GPA
basesite/urls.py
urls.py
py
923
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "basesite.views.index", "line_number": 7, "usage_type": "attribute" }, { "api_name": "basesite.views", "line_number": 7, "usage_type": "name" }, { "api_name": "django.urls.pa...
11169933239
# from django.shortcuts import render from rest_framework import generics from review_app.models import FarmersMarket, Vendor from fm_api.serializers import FarmersMarketSerializer, VendorSerializer # Create your views here. class FarmersMarketListAPIView(generics.ListAPIView): queryset = FarmersMarket.objects.al...
dhcrain/FatHen
fm_api/views.py
views.py
py
783
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.generics.ListAPIView", "line_number": 8, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 8, "usage_type": "name" }, { "api_name": "review_app.models.FarmersMarket.objects.all", "line_number": 9, "usage_typ...
8179016390
import json import logging logger = logging.getLogger() logger.setLevel(logging.INFO) def hello(event, context): logger.info(f"AWS Lambda processing message from GitHub: {event}.") body = { "message": "Your function executed successfully!", "input": event } response = { "st...
Qif-Equinor/serverless-edc2021
aws-demo/handler.py
handler.py
py
396
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 4, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 5, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 19, "usage_type": "call" } ]
1868384059
from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf import settings # Create your models here. class Country(models.Model): name = models.CharField(_("Name"), db_column='name', max_length = 150, null=True, blank=True) code2 = models.CharField(_("Code2"), db_...
amlluch/vectorai
vectorai/restapi/models.py
models.py
py
696
python
en
code
0
github-code
6
[ { "api_name": "django.db.models.Model", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 10, "usage_type": "call" }, { "api_name": ...
70728232508
import frida import sys package_name = "com.jni.anto.kalip" def get_messages_from_js(message, data): print(message) print (message['payload']) def instrument_debugger_checks(): hook_code = """ setTimeout(function(){ Dalvik.perform(function () { var TM ...
antojoseph/frida-android-hooks
debugger.py
debugger.py
py
800
python
en
code
371
github-code
6
[ { "api_name": "frida.get_device_manager", "line_number": 34, "usage_type": "call" }, { "api_name": "sys.stdin.read", "line_number": 38, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 38, "usage_type": "attribute" } ]
36035072095
import tweepy import pandas as pd import re import time from textblob import TextBlob from sqlalchemy import create_engine import yaml import json TWITTER_CONFIG_FILE = '../auth.yaml' with open(TWITTER_CONFIG_FILE, 'r') as config_file: config = yaml.load(config_file) consumer_key = config['twitter']['consumer_key']...
dgletts/project-spirit-bomb
tweets.py
tweets.py
py
2,259
python
en
code
0
github-code
6
[ { "api_name": "yaml.load", "line_number": 13, "usage_type": "call" }, { "api_name": "tweepy.OAuthHandler", "line_number": 20, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 25, "usage_type": "call" }, { "api_name": "tweepy.API", "line_numbe...
39304842298
import os from flask import Flask, jsonify, Blueprint from flask_cors import CORS from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_bcrypt import Bcrypt import flask_restplus from werkzeug.contrib import fixers # instantiate the extensions db = SQLAlchemy() migrate = Migrate() bcry...
guidocecilio/shows-on-demand-users
src/users/__init__.py
__init__.py
py
1,480
python
en
code
0
github-code
6
[ { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 13, "usage_type": "call" }, { "api_name": "flask_migrate.Migrate", "line_number": 14, "usage_type": "call" }, { "api_name": "flask_bcrypt.Bcrypt", "line_number": 15, "usage_type": "call" }, { "api_name": ...
12932593468
from django.db import models class UserMailmapManager(models.Manager): """A queryset manager which defers all :class:`models.DateTimeField` fields, to avoid resetting them to an old value involuntarily.""" @classmethod def deferred_fields(cls): try: return cls._deferred_fields ...
SoftwareHeritage/swh-web
swh/web/mailmap/models.py
models.py
py
3,525
python
en
code
11
github-code
6
[ { "api_name": "django.db.models.Manager", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 4, "usage_type": "name" }, { "api_name": "django.db.models.DateTimeField", "line_number": 16, "usage_type": "attribute" }, { "...
24685520932
from . import views from django.urls import path app_name = 'bankapp' #namespace urlpatterns = [ path('',views.home,name='home'), path('login/',views.login,name='login'), path('register/',views.register,name='register'), path('logout/',views.logout,name='logout'), path('user/',views.user,name='...
simisaby/bank
Bank/bankapp/urls.py
urls.py
py
371
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", ...
20468728047
# sourcery skip: do-not-use-staticmethod """ A module that contains the AIConfig class object that contains the configuration """ from __future__ import annotations import os from typing import Type import yaml class AIConfig: """ A class object that contains the configuration information for the AI At...
badboytuba/nancy
nancy/config/ai_config.py
ai_config.py
py
3,801
python
en
code
0
github-code
6
[ { "api_name": "os.path.join", "line_number": 43, "usage_type": "call" }, { "api_name": "os.path", "line_number": 43, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 43, "usage_type": "call" }, { "api_name": "yaml.load", "line_numbe...
16106061785
def _extend_pre_ranges(df, upstream:int=0, downstream:int=0, start:str="Start", end:str="End", strand:str="Strand"): strand_rm = False if strand not in df.columns: strand_rm = True df[strand] = "+" df.loc[df[strand] == "+", start] -= upstream df.loc[df[strand] == "-", start] -= downstre...
KellisLab/benj
benj/gene_estimation.py
gene_estimation.py
py
11,891
python
en
code
2
github-code
6
[ { "api_name": "numpy.min", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.log1p", "line_number": 33, "usage_type": "call" }, { "api_name": "timer.template", "line_number": 6...