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
25725949850
"""Define taskmanager utils tests.""" from django.test import TestCase from taskmanager.models import AppCommand, Report, Task from taskmanager.utils import log_tail class TestUtils(TestCase): """A set of tests for utils.""" def setUp(self): """Prepare initial data for testing.""" self.comm...
openpolis/django-uwsgi-taskmanager
tests/test_utils.py
test_utils.py
py
1,583
python
en
code
22
github-code
18
[ { "api_name": "django.test.TestCase", "line_number": 9, "usage_type": "name" }, { "api_name": "taskmanager.models.AppCommand.objects.get_or_create", "line_number": 14, "usage_type": "call" }, { "api_name": "taskmanager.models.AppCommand.objects", "line_number": 14, "usage...
4365278641
# -*- coding: utf-8 -*- """ Created on Mon Feb 7 22:32:01 2022 @author: franc """ import re import string from nltk.corpus import stopwords stopw = stopwords.words('english') new_stepw = list() for word in stopw: if "'" in word: word_new1 = word.replace("'","’") word_new2 = word.replace("'","‘"...
Fvrneto/Fake-News-Viewer
Modules_User/cleaning.py
cleaning.py
py
944
python
en
code
0
github-code
18
[ { "api_name": "nltk.corpus.stopwords.words", "line_number": 11, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 11, "usage_type": "name" }, { "api_name": "string.punctuation", "line_number": 26, "usage_type": "attribute" }, { "api_nam...
19790287230
import requests, json from bs4 import BeautifulSoup from advanced_expiry_caching import Cache # "crawling" -- generally -- going to all links from a link ... like a spiderweb # its specific def'n varies, but this is approximately the case in all situations # and is like what you may want to do in many cases when scrap...
zeeerglingchen/SI_507_project04
sample_crawling_data.py
sample_crawling_data.py
py
2,648
python
en
code
0
github-code
18
[ { "api_name": "advanced_expiry_caching.Cache", "line_number": 18, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 25, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 36, "usage_type": "call" }, { "api_name": "bs4.Beau...
21724851846
import numpy as np import matplotlib.pyplot as plt import math npr = np.random from rllab.policies.gaussian_mlp_policy import GaussianMLPPolicy import tensorflow as tf from six.moves import cPickle from collect_samples import CollectSamples from get_true_action import GetTrueAction import os import copy from helper_f...
anagabandi/nn_dynamics
mbmf.py
mbmf.py
py
19,856
python
en
code
321
github-code
18
[ { "api_name": "numpy.random", "line_number": 4, "usage_type": "attribute" }, { "api_name": "tensorflow.contrib.layers.xavier_initializer", "line_number": 30, "usage_type": "call" }, { "api_name": "tensorflow.contrib", "line_number": 30, "usage_type": "attribute" }, { ...
12658045445
""" Offline training of one decision tree for all the slices 10/12/2023 _______________ Summary: This script trains one DT for the three slices to have a fair comparison between the explanations obtained from the the DRL agent with SHAP. DISCLAIMER: THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF AN...
wineslab/explora
scripts/dt_train.py
dt_train.py
py
5,504
python
en
code
3
github-code
18
[ { "api_name": "xgboost.DMatrix", "line_number": 84, "usage_type": "call" }, { "api_name": "xgboost.DMatrix", "line_number": 85, "usage_type": "call" }, { "api_name": "xgboost.train", "line_number": 88, "usage_type": "call" }, { "api_name": "sklearn.metrics.accurac...
18336786161
import logging import webapp2 from google.appengine.api import taskqueue from current_stages import get_current_stages TEMPLATE = '''\ <meta http-equiv="refresh" content="30"> <pre> Things started: %s </pre> ''' class RunStagesHandler(webapp2.RequestHandler): def get(self): things_started = [] for stage...
mithro/chrome-buildbot-sprint
appengine/run_stages.py
run_stages.py
py
1,277
python
en
code
2
github-code
18
[ { "api_name": "webapp2.RequestHandler", "line_number": 18, "usage_type": "attribute" }, { "api_name": "current_stages.get_current_stages", "line_number": 21, "usage_type": "call" }, { "api_name": "google.appengine.api.taskqueue.add", "line_number": 23, "usage_type": "call...
24134707342
from django import forms from .models import * from django.core.exceptions import ValidationError from django.contrib.auth.models import User class AddPostForm(forms.ModelForm): class Meta: model = Post fields = ['title', 'slug', 'text', 'photo', 'is_published', 'category'] widgets = { ...
viktordoms/Blog_Django
blog_django/post/forms.py
forms.py
py
925
python
en
code
0
github-code
18
[ { "api_name": "django.forms.ModelForm", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 7, "usage_type": "name" }, { "api_name": "django.forms.TextInput", "line_number": 13, "usage_type": "call" }, { "api_name": "django....
70354261800
import argparse from zquest.extract import ZeldaClassicReader def uncompress_qst(input_path, output_path): reader = ZeldaClassicReader(input_path, {'only_sections': []}) reader.read_qst() reader.save_qst_no_serialize_no_compression(output_path) if __name__ == '__main__': parser = argparse.ArgumentPa...
connorjclark/zquest-data
examples/uncompress.py
uncompress.py
py
545
python
en
code
0
github-code
18
[ { "api_name": "zquest.extract.ZeldaClassicReader", "line_number": 6, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "argparse.ArgumentDefaultsHelpFormatter", "line_number": 13, "usage_type": "attri...
42507321168
from django.conf import settings from django.conf.urls import include, url, patterns from django.contrib import admin from django.views.generic.base import TemplateView from common.decorators import openid_exempt urlpatterns = [ # Examples: # url(r'^$', 'trustwho.views.home', name='home'), # url(r'^blog/',...
likun01/trushwho_wechat
trustwho/urls.py
urls.py
py
1,097
python
en
code
0
github-code
18
[ { "api_name": "django.conf.urls.url", "line_number": 12, "usage_type": "call" }, { "api_name": "django.conf.urls.include", "line_number": 12, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 12, "usage_type": "attribute" }, { "api_...
26890652518
from flask import Flask, request, jsonify, json from flask_api import status from jinja2._compat import izip from datetime import datetime from flask_cors import CORS, cross_origin from flaskext.mysql import MySQL from flask import Blueprint from flask_restplus import Api, Resource, fields import requests ap...
sutandra-coder/myelsa
student_favorite.py
student_favorite.py
py
2,099
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 12, "usage_type": "call" }, { "api_name": "flaskext.mysql.MySQL", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.Blueprint", ...
3086896490
""" Declear class-based view for exposing Chef model """ from django.db.models import Prefetch from rest_framework.viewsets import ReadOnlyModelViewSet from rest_framework.permissions import DjangoModelPermissionsOrAnonReadOnly from community.models import Chef from community.serializers import ChefSerializer, BaseCh...
raviteja2250/tabletop-backend-develop
community/views/chef.py
chef.py
py
1,031
python
en
code
0
github-code
18
[ { "api_name": "rest_framework.viewsets.ReadOnlyModelViewSet", "line_number": 11, "usage_type": "name" }, { "api_name": "community.models.Chef.objects.all", "line_number": 15, "usage_type": "call" }, { "api_name": "community.models.Chef.objects", "line_number": 15, "usage_...
12235712926
import numpy as np from PIL import Image import os from categories import categories, class_dirs class_labels = categories class_dirs = class_dirs class_means = [] class_stds = [] for i, class_dir in enumerate(class_dirs): mean = np.zeros(3) std = np.zeros(3) num_images = 0 for filename in os.listdir...
Duc0509Ngo/Pokemon-classfication
src/mean_std.py
mean_std.py
py
905
python
en
code
0
github-code
18
[ { "api_name": "categories.categories", "line_number": 7, "usage_type": "name" }, { "api_name": "categories.class_dirs", "line_number": 8, "usage_type": "name" }, { "api_name": "categories.class_dirs", "line_number": 12, "usage_type": "argument" }, { "api_name": "n...
4005606714
import fractions # gcd is here for Python versions < 3 import math # Get gcd here for Python versions >= 3 import sys from tensorflow.python.framework import ops from tensorflow.python.framework import tensor_util from tensorflow.python.ops import array_ops from tensorflow.python.ops import math_ops from tensorflow....
tensorflow/tensorflow
tensorflow/python/ops/signal/util_ops.py
util_ops.py
py
1,804
python
en
code
178,918
github-code
18
[ { "api_name": "tensorflow.python.framework.ops.name_scope", "line_number": 27, "usage_type": "call" }, { "api_name": "tensorflow.python.framework.ops", "line_number": 27, "usage_type": "name" }, { "api_name": "tensorflow.python.framework.ops.convert_to_tensor", "line_number":...
29055249863
# coding=utf-8 from collections import defaultdict input_file1 = 'D:/Projects/Pycharm/SIR/Data/info_stat/RepostCountReal.txt' input_file2 = 'D:/Projects/Pycharm/SIR/Data/info_stat/SpreadTree.txt' output_file = 'D:/Projects/Pycharm/SIR/Data/info/big_info/' mid = [] ratio = 0.9 repost_dict = defaultdict(list) ...
max-wayne/NetworkScience
SIR/python/CleanMeme/extract_big_info.py
extract_big_info.py
py
1,294
python
en
code
1
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 10, "usage_type": "call" } ]
17038070392
import os print(os.path.abspath(__file__)) from docx2python import docx2python from Resolution import Resolution with open('resolution.docx', "w") as f: doc = docx2python(f, html = True) print(doc.text) print("---------------------------------") reso = Resolution(doc.text) print(reso) #import json ...
joshua2020181/MUNPartyChat
parseReso.py
parseReso.py
py
1,329
python
en
code
0
github-code
18
[ { "api_name": "os.path.abspath", "line_number": 3, "usage_type": "call" }, { "api_name": "os.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "docx2python.docx2python", "line_number": 10, "usage_type": "call" }, { "api_name": "Resolution.Resolut...
7432298114
#! /usr/bin/python3 import time from flask import Flask, Response, jsonify from flask_socketio import SocketIO, send from transformers import ( AutoTokenizer, AutoModelForCausalLM, TextIteratorStreamer, ) from langchain.llms.base import LLM from langchain.vectorstores.pgvector import PGVector from langcha...
ypwk/Lumi
backend/server_socket.py
server_socket.py
py
8,852
python
en
code
0
github-code
18
[ { "api_name": "langchain.embeddings.HuggingFaceEmbeddings", "line_number": 29, "usage_type": "call" }, { "api_name": "torch.cuda.cuda.is_available", "line_number": 36, "usage_type": "call" }, { "api_name": "torch.cuda.cuda", "line_number": 36, "usage_type": "attribute" ...
18195969963
#!/usr/bin/python3 import signal import keyboard import time from datetime import datetime # CONSTANTS, REPLACE THESE WITH YOUR OWN VARIABLES FOR YOUR OWN KEYBOARD TIMEOUT_SECS = 0.2 LEFT_CTRL_CODE = 44 RIGHT_CTRL_CODE = 53 LEFT_SHIFT_CODE = 42 RIGHT_SHIFT_CODE = 54 LEFT_CTRL_REPLACE = 29 RIGHT_CTRL_REPLACE = 97 LEFT...
underscoreglook/Autohotkey-QMK-Replicator
QMK_Replicator.py
QMK_Replicator.py
py
3,872
python
en
code
2
github-code
18
[ { "api_name": "signal.signal", "line_number": 31, "usage_type": "call" }, { "api_name": "signal.SIGINT", "line_number": 31, "usage_type": "attribute" }, { "api_name": "keyboard.hook", "line_number": 32, "usage_type": "call" }, { "api_name": "time.sleep", "line...
3081634754
import itertools from glob import glob import os from .gmx.rtp import read_rtp from .ffinput import read_ff from . import DATA_PATH FORCE_FIELD_PARSERS = {'.rtp': read_rtp, '.ff': read_ff} class ForceField(object): """ Description of a force field. Attributes ---------- blocks: dict links: l...
brandonwbrown/vermouth-martinize
vermouth/forcefield.py
forcefield.py
py
4,384
python
en
code
null
github-code
18
[ { "api_name": "gmx.rtp.read_rtp", "line_number": 8, "usage_type": "name" }, { "api_name": "ffinput.read_ff", "line_number": 8, "usage_type": "name" }, { "api_name": "os.path.basename", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_n...
16173765152
#pip install gitpython import os import git projectsFolder = '/home/gary/Projects/' repoUrl = input("Repo url:") repoName = repoUrl.split("/")[-1] repoDir = os.path.join(projectsFolder,repoName) print(repoDir) try: repo = git.Repo.init(repoDir) repo.clone_from(repoUrl,repoDir) except: print("Repository i...
masekjakub/GitLoad
GitLoad.py
GitLoad.py
py
342
python
en
code
0
github-code
18
[ { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "git.Repo.init", "line_number": 13, "usage_type": "call" }, { "api_name": "git.Repo", "line_number": 1...
11175640242
import datetime import socket # Import socket module import json from rest_framework import viewsets from rest_framework.response import Response from django.shortcuts import render from django.apps import apps from django.http import JsonResponse from django.views.generic import View from app.words imp...
rafalsiniewicz/scrabble_solver
app/views.py
views.py
py
3,273
python
en
code
0
github-code
18
[ { "api_name": "django.views.generic.View", "line_number": 19, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 21, "usage_type": "call" }, { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 23, "usage_type": "attribute" }...
34385170065
from . import user_admin from django.contrib import admin from api import models from . import inlines @admin.register(models.Subject) class SubjectAdmin(admin.ModelAdmin): inlines = [inlines.CurriculumInline] list_display = ["name", "curriculums"] @admin.display() def curriculums(self, obj): ...
Kwekuasiedu315/aska
api/admin/__init__.py
__init__.py
py
1,581
python
en
code
0
github-code
18
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 9, "usage_type": "name" }, { "api_name": "django.contrib.admin.display", "line_number": 13, "usage_type": "call" }, { ...
6107287674
#!/usr/bin/python3 import datetime import math import sys import epd7in5 from PIL import Image, ImageDraw, ImageFont import ical_worker from config import * #timezone = pytz.timezone(TIMEZONE) #ical_worker.basetime = datetime.datetime.now(timezone) #ical_worker.basetime.astimezone(timezone) fheadline = ImageFont.tr...
dabch/epaper-calendar
beautiful_calendar.py
beautiful_calendar.py
py
6,144
python
en
code
34
github-code
18
[ { "api_name": "PIL.ImageFont.truetype", "line_number": 16, "usage_type": "call" }, { "api_name": "PIL.ImageFont", "line_number": 16, "usage_type": "name" }, { "api_name": "PIL.ImageFont.truetype", "line_number": 17, "usage_type": "call" }, { "api_name": "PIL.Image...
74817242280
import tkinter as tk from tkinter import ttk from tkinter import filedialog from PIL import Image, ImageTk, ImageFilter import tkinter.messagebox import pytesseract import cv2 import numpy as np def extract_text(Image_path): # converts the image to text by taking the image path as an input output_...
bodealamu/OCR_desktop_application
ocr_app.py
ocr_app.py
py
4,372
python
en
code
0
github-code
18
[ { "api_name": "pytesseract.image_to_string", "line_number": 13, "usage_type": "call" }, { "api_name": "tkinter.Tk", "line_number": 17, "usage_type": "attribute" }, { "api_name": "tkinter.Tk.__init__", "line_number": 19, "usage_type": "call" }, { "api_name": "tkint...
9290402335
import numpy as np from numpy import array import matplotlib.pyplot as plt import string import os import glob from PIL import Image from time import time from tensorflow.keras import Input, layers from tensorflow.keras import optimizers from tensorflow.keras.optimizers import Adam from tensorflow.ke...
sharma-prerna/Image-Captioning-Generator
Image_caption_generator.py
Image_caption_generator.py
py
12,341
python
en
code
1
github-code
18
[ { "api_name": "string.punctuation", "line_number": 60, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.imread", "line_number": 77, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 77, "usage_type": "name" }, { "api_name": "ma...
13521261236
import smtplib import os from email.mime.multipart import MIMEMultipart from email.mime.base import MIMEBase from email.mime.text import MIMEText from email.encoders import encode_base64 from email.utils import COMMASPACE, formatdate def mail(sender, pwd, to, subject, text, files=[]): msg = MIMEMultipart() msg...
cwfink/Fink_ay250_homework
hw_3/email_example.py
email_example.py
py
1,089
python
en
code
0
github-code
18
[ { "api_name": "email.mime.multipart.MIMEMultipart", "line_number": 10, "usage_type": "call" }, { "api_name": "email.utils.COMMASPACE.join", "line_number": 12, "usage_type": "call" }, { "api_name": "email.utils.COMMASPACE", "line_number": 12, "usage_type": "name" }, { ...
72213111401
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jan 7 17:33:56 2020 @author: yumin """ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Nov 19 11:08:39 2019 @author: yumin """ def collect_GCM(): import os import glob import shutil variable = 'pr' #'tasmin' #'tasma...
yuminliu/Downscaling
src/prismdata_precipitation.py
prismdata_precipitation.py
py
27,087
python
en
code
8
github-code
18
[ { "api_name": "os.path.exists", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 26, "usage_type": "call" }, { "api_name": "glob.glob", "line_number"...
8210961651
from django.core.paginator import Paginator from django.shortcuts import render, get_object_or_404, redirect from .models import Post, Groups from django.contrib.auth import get_user_model, get_user from .forms import NewPost from django.contrib.auth.decorators import login_required # Create your views here. def fi...
Agiruskiy/yatube
posts/views.py
views.py
py
4,343
python
ru
code
0
github-code
18
[ { "api_name": "models.Post.objects.order_by", "line_number": 13, "usage_type": "call" }, { "api_name": "models.Post.objects", "line_number": 13, "usage_type": "attribute" }, { "api_name": "models.Post", "line_number": 13, "usage_type": "name" }, { "api_name": "dja...
41846848085
from dataclasses import dataclass from datetime import datetime from functools import singledispatchmethod from uuid import UUID import cbaxter1988_utils.log_utils from boe.applications.transcodings import ( TaskEntityTranscoding, TaskStatusEnumTranscoding, BytesTranscoding ) from boe.lib.common_models imp...
byt3-m3/bank_of_excellence
boe/applications/task_domain_apps.py
task_domain_apps.py
py
5,269
python
en
code
0
github-code
18
[ { "api_name": "cbaxter1988_utils.log_utils.log_utils.get_logger", "line_number": 22, "usage_type": "call" }, { "api_name": "cbaxter1988_utils.log_utils.log_utils", "line_number": 22, "usage_type": "attribute" }, { "api_name": "cbaxter1988_utils.log_utils", "line_number": 22, ...
39759233306
# coding=utf-8 import sys import telepot from urllib.request import urlopen from bs4 import BeautifulSoup import pandas as pd import re import webbrowser import traceback import time import spam API_KEY = 'yFY%2BS0tRfVUf8ol%2FUjDARwS71qiyeewzzn7w%2Bv9JEQDV%2FmlRIbfelfcqdu5iTMyIWALgQ4GuFnmxtepshr7maw%3D%3D' TOKEN = '4...
leebyeongcheol/2018-1-Python-bangkang
tele.py
tele.py
py
3,722
python
en
code
0
github-code
18
[ { "api_name": "telepot.Bot", "line_number": 16, "usage_type": "call" }, { "api_name": "traceback.print_exc", "line_number": 48, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 48, "usage_type": "attribute" }, { "api_name": "urllib.request.urlope...
15888921124
import Adafruit_DHT from datetime import datetime class DHT11: # [options] json with 'pin'= pin_number, type= any of '11','22','2302' , add_value = ("INSERT INTO webapp_entry " "(sensor_id, type_id, value, created_at) " "VALUES (%s, %s, %s, %s)") value_names = ['temp', 'humi...
dfmoncada/Raspberry-API
mysite/webapp/classes/sensors/dht11.py
dht11.py
py
1,298
python
en
code
0
github-code
18
[ { "api_name": "Adafruit_DHT.DHT11", "line_number": 17, "usage_type": "attribute" }, { "api_name": "Adafruit_DHT.DHT22", "line_number": 18, "usage_type": "attribute" }, { "api_name": "Adafruit_DHT.AM2302", "line_number": 19, "usage_type": "attribute" }, { "api_name...
73216571241
import uvicorn from fastapi import FastAPI import os app = FastAPI() SECRETS_ROUTE = "/run/secrets/" @app.get("/") async def root(): return {"Response": "App works"} @app.get("/envtest") def envtest(): return {"Environmental variables": os.environ["envFoo"]} @app.get("/secrettest") def secrettest(): ...
danielcastillac/docker-tests
main.py
main.py
py
650
python
en
code
0
github-code
18
[ { "api_name": "fastapi.FastAPI", "line_number": 5, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 29, "usage_type": "call" }, { "api_name": "uvicorn.run", "line_num...
982751427
# -*- coding: utf8 -*- """ Usage: hookit [--scripts=<dir>] [--listen=<address>] [--port=<port>] args: --scripts=<dir> Where to look for hook scripts [default: .] --listen=<address> Server address to listen on [default: 0.0.0.0] --port=<port> Server port to listen on [default: 8000] """ import sys ...
tiwilliam/hookit
hookit/server.py
server.py
py
3,837
python
en
code
5
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 31, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 32, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 33, "usage_type": "call" }, { "api_name": "github3.Git...
71046570919
import os from collections import OrderedDict from configparser import RawConfigParser from monolithe.lib import TaskManager from monolithe.generators.lib import TemplateFileWriter class APIVersionWriter(TemplateFileWriter): """ Provide usefull method to write Objj files. """ def __init__(self, monolith...
nuagenetworks/monolithe
monolithe/generators/lang/objj/writers/apiversionwriter.py
apiversionwriter.py
py
6,462
python
en
code
16
github-code
18
[ { "api_name": "monolithe.generators.lib.TemplateFileWriter", "line_number": 9, "usage_type": "name" }, { "api_name": "os.path.normpath", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path", "line_number": 30, "usage_type": "attribute" }, { "api_name...
8381413579
import os.path import subprocess import shutil from copy import copy from datetime import date, datetime from pickle import dump, load from glob import glob from pelican.utils import slugify import yaml import pdfkit from scribbler.PyPDF2 import PdfFileMerger from .errors import ScribblerWarning, ScribblerError from ...
cmacmackin/scribbler
scribbler/notebook.py
notebook.py
py
23,964
python
en
code
8
github-code
18
[ { "api_name": "os.path.path.normpath", "line_number": 109, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 109, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 109, "usage_type": "name" }, { "api_name": "os.path.path.join"...
71615045800
import unittest import sys, os sys.path.append(os.path.abspath(os.path.join('lib'))) import utils import base64 class UtilsTest(unittest.TestCase): def test_average_hamming_distance(self): cipher_string = "0e3647e8592d35514a081243582536ed3de6734059001e3f535ce6271032\n"\ "334b041de12...
gauravmc/cryptopals
test/utils_test.py
utils_test.py
py
1,646
python
en
code
0
github-code
18
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 3, "usage_type": "call" }, { "api_name": "os.path", "line_number...
70590119400
import json import os import requests from flask import g, render_template, request from flask_login import login_user, logout_user from oauthlib.oauth2 import WebApplicationClient from werkzeug.utils import redirect from keywordmanager import app from keywordmanager.models.login.google_user import GoogleUser from ke...
DatPhamABC/kwm
keywordmanager/views/login.py
login.py
py
3,131
python
en
code
0
github-code
18
[ { "api_name": "oauthlib.oauth2.WebApplicationClient", "line_number": 21, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 22, "usage_type": "attribute" }, { "api_name": "flask.g.user", "line_number": 27, "usage_type": "attribute" }, { "api_name":...
45280539008
import os import os.path as osp import random import re import pickle import argparse import numpy as np from random import randint from collections import defaultdict import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.utils.data import Dataset, DataLoader from to...
sigirace/elmo_clone
paper/01_CNN/source/dataloader.py
dataloader.py
py
4,927
python
en
code
null
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number": 74, "usage_type": "call" }, { "api_name": "gensim.models.KeyedVectors.load_word2vec_format", "line_number": 93, "usage_type": "call" }, { ...
34950497941
"""Wren - An interface for examining data and its relationships in a grid.""" from io import BytesIO import logging import os import sys from PyQt5.QtGui import QImage, QPixmap # -- Globals ------------------------------------------------------------------ log = logging.getLogger('wren') log.setLevel(logging.DEBU...
Lifto/Wren
wren.py
wren.py
py
3,871
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 15, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib...
73899365480
#!/usr/bin/env python3.9 import re import json import os import sys from typing import Any from io import IOBase from scapy.all import PcapReader, IP from datetime import datetime from datetime import timedelta import argparse #============================= # Some General Definitions #============================= ...
Daffc/RECloud
scripts/trace_scripts/converter.py
converter.py
py
13,650
python
en
code
0
github-code
18
[ { "api_name": "os.path.dirname", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime.now", ...
18917522183
from builtins import range import numpy as np import scipy.sparse as sp import scipy.sparse.linalg import time import logging def lm_optimize(eq_func, x0, jac_func, min_chisqr = 0.1, stopping_criteria = 0.001, max_iteration = 50, boost = 2, drop = 3, lambda_initial =0.1): '''This ...
Cartography-jpl/geocal
python/lib/lm_optimize.py
lm_optimize.py
py
3,660
python
en
code
0
github-code
18
[ { "api_name": "time.process_time", "line_number": 24, "usage_type": "call" }, { "api_name": "time.process_time", "line_number": 26, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 28, "usage_type": "call" }, { "api_name": "time.process_ti...
1581435210
import sys import requests import json # init weights weight_title = sys.argv[2] weight_date = sys.argv[3] # preparing query data sys.argv[1] contains the query text query = { "query": { "multi_match": { "query": sys.argv[1], "fields": ["title" + "^" + weight_title, "data" + "^" +...
nlok5923/ir-experiment-4-code
getDataScript.py
getDataScript.py
py
799
python
en
code
1
github-code
18
[ { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "requests.get", "line_numb...
4789889667
import numpy import mnist as mnist from keras.models import Sequential from keras.layers import Dense from keras.utils import np_utils # make seed for cycle results numpy.random.seed(42) # load data (X_train, y_train), (X_test, y_test) = mnist.load_data() # resize data X_train = X_train.reshape(60000, 7...
daryachyruk/3d_images_processing
3d_picture/neir_netw.py
neir_netw.py
py
1,399
python
en
code
0
github-code
18
[ { "api_name": "numpy.random.seed", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 8, "usage_type": "attribute" }, { "api_name": "mnist.load_data", "line_number": 11, "usage_type": "call" }, { "api_name": "keras.utils.np_util...
28941185891
"""Library for multiagent concerns.""" import collections import numpy as np import random from pysc2.lib import actions, features, units from utils import get_entity_obs, get_upgrade_obs, get_gameloop_obs, get_race_onehot, get_agent_statistics from network import EntityEncoder, ScalarEncoder, SpatialEncoder, Core _...
kimbring2/AlphaStar_Implementation
pseudocode/multiagent.py
multiagent.py
py
16,028
python
en
code
162
github-code
18
[ { "api_name": "pysc2.lib.actions.FUNCTIONS", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pysc2.lib.actions", "line_number": 11, "usage_type": "name" }, { "api_name": "pysc2.lib.actions.FUNCTIONS", "line_number": 14, "usage_type": "attribute" }, { ...
9460655031
# module plotter ''' Plots the residual vector vs. the number of iterations. ''' import matplotlib.pyplot as plt import scienceplots # pylint: disable=unused-import import pandas as pd res_data = pd.read_csv('../data/res.csv') frc_data = pd.read_csv('../data/frc.csv') plt.style.use(['science', 'grid']) plt.figure(fi...
amilkyboi/euler
src/plotter.py
plotter.py
py
1,521
python
en
code
1
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style.use", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotli...
24363472839
# this problem is same as the max_sub_arr in same directory where it has been explain using kadan algorithm only differce is here the length of sub arr has been given. # https://www.youtube.com/watch?v=__guhvzO540 # asymtotic function = len of arr * len of win (m*n) def brute_force(arr, win=4): max_sum = 0 for i in...
mushahidmehdi/Data-Structure-Algorithms
Array and Strings/sliding _window.py
sliding _window.py
py
1,156
python
en
code
0
github-code
18
[ { "api_name": "itertools.combinations", "line_number": 35, "usage_type": "call" } ]
4002002114
import functools import sys from absl.testing import parameterized import numpy as np from tensorflow.python import pywrap_tfe from tensorflow.python.eager import backprop from tensorflow.python.eager import backprop_util from tensorflow.python.eager import context from tensorflow.python.eager import def_function fro...
tensorflow/tensorflow
tensorflow/python/eager/backprop_test.py
backprop_test.py
py
68,247
python
en
code
178,918
github-code
18
[ { "api_name": "tensorflow.python.eager.test.TestCase", "line_number": 43, "usage_type": "attribute" }, { "api_name": "tensorflow.python.eager.test", "line_number": 43, "usage_type": "name" }, { "api_name": "absl.testing.parameterized.TestCase", "line_number": 43, "usage_t...
1838488839
""" This file runs the ``Kalmnan-SEM`` function on the CiCMOD netCDF files. The settings will be stored as "settings.yaml" in the ``results_path``. Also multiple plots will be created and stored in the same directory. An example would be : python plot_CiCMOD.py --file_name climate_indices_FOCI.nc --experiment_name FO...
nilsnevertree/reconstruct-climate-indices
results/scripts/plot_CiCMOD.py
plot_CiCMOD.py
py
13,048
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 20, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 27, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 32, "usage_type": "call" }, { "api_name": "pathlib.Path", ...
3822393604
from PyQt5.QtGui import QTextFormat from ..pktk import * EXTRASELECTION_FILTER_KEEP = 0x0001 EXTRASELECTION_FILTER_REMOVE = 0x0002 EXTRASELECTION_FILTER_FCTTRUE = 0x0003 def flatten(items): """Return a flatten list whatever the number of nested level the list have f=flatten([1,2,[3,4],[5,[6,7],[8,[9,10...
Grum999/BuliPy
bulipy/bulipy/pktk/modules/listutils.py
listutils.py
py
4,834
python
en
code
0
github-code
18
[ { "api_name": "PyQt5.QtGui.QTextFormat.UserProperty", "line_number": 74, "usage_type": "attribute" }, { "api_name": "PyQt5.QtGui.QTextFormat", "line_number": 74, "usage_type": "name" }, { "api_name": "PyQt5.QtGui.QTextFormat.UserProperty", "line_number": 83, "usage_type":...
32735581364
# python program to parse json import json import os os.chdir('c:/Users/mayur/OneDrive/Documents/Study Material/Python/Interview/challenge-2/') f = open('response.json', 'r') result = f.read() f.close() my_dict = json.loads(result) # Take key input from user key = input("Enter metadata key") val = my_dict[key]...
mayurk1993/19sept_assignment
challenge-2/challenge-2.py
challenge-2.py
py
338
python
en
code
0
github-code
18
[ { "api_name": "os.chdir", "line_number": 7, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 15, "usage_type": "call" } ]
31229025345
#!/usr/bin/env python # -*- coding: utf-8 # Compute distance between nerve rootlets and PMJ, nerve rootlets and discs along centerline # # For usage, type: python compute_neck_angle.py -h # Authors: Sandrine Bédard import argparse import csv import math from webbrowser import get import numpy as np import nibabel as ...
sct-pipeline/pmj-based-csa
compute_neck_angle.py
compute_neck_angle.py
py
3,777
python
en
code
2
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "nibabel.Nifti1Header", "line_number": 37, "usage_type": "call" }, { "api_name": "nibabel.Nifti1Image", "line_number": 38, "usage_type": "call" }, { "api_name": "niba...
38408073131
import requests from setup import INFO import re from bs4 import BeautifulSoup as Soup class Engine: def __init__(e, name, create_query): e.name = name e.create_query = create_query def get_search_url(e, query): INFO("original query: {}".format(query)) # lower case the query ...
arvindrag/ask.tv
src/engines.py
engines.py
py
1,778
python
en
code
0
github-code
18
[ { "api_name": "setup.INFO", "line_number": 13, "usage_type": "call" }, { "api_name": "setup.INFO", "line_number": 20, "usage_type": "call" }, { "api_name": "setup.INFO", "line_number": 25, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 26...
22011315398
#!/usr/bin/env python # -*- coding: utf-8 -*- # Bot's work modules import replies # send cliched message to a user. import filesoper # save/load operations with files. import lenta_api # requests to lenta.com import os import telegram from telegram import ( InlineKeyboardButton, InlineKeyboardMarkup ) ...
Moleus/LentaBot
Bot.py
Bot.py
py
26,642
python
en
code
0
github-code
18
[ { "api_name": "dotenv.load_dotenv", "line_number": 32, "usage_type": "call" }, { "api_name": "logging.Formatter", "line_number": 44, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 45, "usage_type": "call" }, { "api_name": "os.path.isdir"...
74543977638
from torch import nn import torch from attention import Attention from config import opt class Model(nn.Module): def __init__(self, args): super(Model, self).__init__() self.args = args self.content = nn.GRU(input_size=self.args.embedding_dim, hidden_size=self.args.hidden_dim, bidirectiona...
crystalyue/multi-view-rumor-detection
model.py
model.py
py
3,657
python
en
code
13
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.nn.GRU", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.nn", "line_number"...
39271576748
import torch import torch.nn as nn import graph.mol_features as mol_features import pdb class GraphConv(nn.Module): def __init__(self, args): """Creates graph conv layers for molecular graphs.""" super(GraphConv, self).__init__() self.args = args hidden_size = args.hidden_size ...
benatorc/PA-Graph-Transformer
modules/conv_layer.py
conv_layer.py
py
2,783
python
en
code
40
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "graph.mol_features.N_ATOM_FEATS", "line_number": 15, "usage_type": "attribute" }, { "api_name": "grap...
72394716839
from flask import request, session from auth.auth import is_authenticated, is_admin from flask.json import jsonify from models.patients import Patients, db, ma from models.assessments import Assessments from models.patient_screening_details import PatientsScreeningDetails import pymysql def create_patient(): data...
carloschiongbian/DeployMemores
flask-server/controllers/create_patient.py
create_patient.py
py
2,794
python
en
code
1
github-code
18
[ { "api_name": "flask.request.get_json", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 11, "usage_type": "name" }, { "api_name": "flask.session.get", "line_number": 24, "usage_type": "call" }, { "api_name": "flask.session"...
41495684890
from typing import Dict, Any, List, Set, Optional class FhirMetaDataParser: """ Parses FHIR metadata """ @staticmethod def get_resource_types_from_metadata(metadata: Dict[str, Any]) -> List[str]: """ Gets resource types present in the metadata :param metadata: ...
icanbwell/SparkPipelineFramework
spark_pipeline_framework/utilities/fhir_meta_data_parser/v1/fhir_meta_data_parser.py
fhir_meta_data_parser.py
py
1,003
python
en
code
10
github-code
18
[ { "api_name": "typing.Dict", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.Set", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 20...
23993062702
import hail as hl #Import mt file print("Reading in mts...") pop_strings = ['AFR', 'AJ', 'AMR', 'EAS', 'FIN', 'NFE', 'SAS'] cd_tables = [] ibd_tables = [] uc_tables = [] for pop_string in pop_strings: cd_tables.append(hl.read_matrix_table('gs://ibd-exomes/' + pop_string + '_cd+control.mt')) ibd_tables.append(hl.rea...
iibdgc/Crohn-s-Disease-WES-meta
Hail-scripts/analyses/GWAS/wald_lrt_firth.py
wald_lrt_firth.py
py
1,759
python
en
code
3
github-code
18
[ { "api_name": "hail.read_matrix_table", "line_number": 11, "usage_type": "call" }, { "api_name": "hail.read_matrix_table", "line_number": 12, "usage_type": "call" }, { "api_name": "hail.read_matrix_table", "line_number": 13, "usage_type": "call" }, { "api_name": "...
20429468895
from django.urls import path from apps.banner.views import GetFrontPagelBannerApiView ,GetDescription app_name='banner' urlpatterns = [ path('frontpagebanner/',GetFrontPagelBannerApiView.as_view(),name='frontpage-banner'), path('frontpagedescription/',GetDescription.as_view(),name='frontpagedescription'), ...
taniyaverma524/battle_from_home
applications/apps/banner/urls.py
urls.py
py
322
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "apps.banner.views.GetFrontPagelBannerApiView.as_view", "line_number": 8, "usage_type": "call" }, { "api_name": "apps.banner.views.GetFrontPagelBannerApiView", "line_number": 8, "usa...
17359073375
from django.shortcuts import render, get_object_or_404, redirect from django.http import HttpResponseRedirect from django.contrib.auth.models import User from django.contrib.auth.mixins import ( LoginRequiredMixin, UserPassesTestMixin ) from django.views.generic import ( ListView, DetailView, Crea...
mattguerrero/django-music-blog
blog/views.py
views.py
py
4,762
python
en
code
2
github-code
18
[ { "api_name": "os.environ.get", "line_number": 26, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 26, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 27, "usage_type": "call" }, { "api_name": "os.environ", "line_...
23517777191
from replicate.client import Client from typing import Union from fastapi import FastAPI from googletrans import Translator import uvicorn from starlette.middleware import Middleware from starlette.middleware.cors import CORSMiddleware origins = [ "http://127.0.0.1:5500", ] middleware = [ Middleware(CORSMiddl...
ArditXhaferi/BITI
main.py
main.py
py
843
python
en
code
0
github-code
18
[ { "api_name": "starlette.middleware.Middleware", "line_number": 14, "usage_type": "call" }, { "api_name": "starlette.middleware.cors.CORSMiddleware", "line_number": 14, "usage_type": "argument" }, { "api_name": "fastapi.FastAPI", "line_number": 17, "usage_type": "call" ...
73998202599
import bpy import math import json import copy import time import os.path import pathlib from math import radians, degrees from mathutils import Color, Matrix, Euler, Vector from threading import Thread from bpy.app.handlers import persistent from . import utils class SceneConstructor: def __init__(self, name...
Darkblader24/XPS-XNALara-Scene-Importer
core.py
core.py
py
12,529
python
en
code
13
github-code
18
[ { "api_name": "bpy.data.collections.new", "line_number": 30, "usage_type": "call" }, { "api_name": "bpy.data", "line_number": 30, "usage_type": "attribute" }, { "api_name": "bpy.context.scene.collection.children.link", "line_number": 31, "usage_type": "call" }, { ...
20720074976
# Databricks notebook source # MAGIC %md # MAGIC ##### Welcome to Azurelib Academy By Deepak Goyal # MAGIC ##### You can master the Databricks here: <a href='https://adeus.azurelib.com' target='_blank'>www.adeus.azurelib.com</a> # MAGIC ##### Author of this blog: Arud Seka Berne S <a href="https://www.linkedin.com/in/...
azurelib-academy/azure-databricks-pyspark-examples
43. Pyspark Explode() Function/Pyspark Explode() Function - Notebook.py
Pyspark Explode() Function - Notebook.py
py
3,293
python
en
code
0
github-code
18
[ { "api_name": "pyspark.sql.session.SparkSession.builder.master", "line_number": 26, "usage_type": "call" }, { "api_name": "pyspark.sql.session.SparkSession.builder", "line_number": 26, "usage_type": "attribute" }, { "api_name": "pyspark.sql.session.SparkSession", "line_number...
29527258715
#-*-coding:utf8 -*- import os import time import cmd_tools from config import ConfigParse import log_utils import manifest_utils import my_utils import zip_utils from pack_exception import PackException import pack_exception import file_utils import env from time import sleep class PackManager(o...
huangtao/cloud-test
vendor/RainbowRepacker/src/pack_managers/base_pack_manager.py
base_pack_manager.py
py
14,598
python
en
code
2
github-code
18
[ { "api_name": "os.path.join", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_number": 34, "usage_type": "attribute" }, { "api_name": "env.SUPPORT_DIR", "line_number": 34, "usage_type": "attribute" }, { "api_name": "config.ConfigParse.sha...
6013390442
import numpy as np import matplotlib.pyplot as plt filename = "shifted_sawtooth_part_b.csv" # filename = "sine_part_b.csv" # filename = "chirp_part_b.csv" data = np.loadtxt(filename, delimiter=",") startIndex = int(data[0]) a = data[1] b = data[2] signalList = data[3:] n = np.arange(startIndex, startIndex+len(signa...
gurhanadiguzel/METU-Ceng
CENG384/HW/HW1/Documents/hw1-b.py
hw1-b.py
py
632
python
en
code
0
github-code
18
[ { "api_name": "numpy.loadtxt", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "...
24994299365
import math import os import pickle from enum import Enum import numpy as np from scipy import stats from scipy.stats import norm, poisson from utils.cumulative_distribution import CumulativeDistribution class ParameterMode(Enum): LOG_BASED = "LOG_BASED" MODELED = "MODELED" SIMULATED = "SIMULATED" cla...
beneknopp/OCPS
backend/object_model_generation/generator_parametrization.py
generator_parametrization.py
py
18,792
python
en
code
0
github-code
18
[ { "api_name": "enum.Enum", "line_number": 13, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 19, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 25, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 31, ...
10757896771
import pandas as pd import numpy as np from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import confusion_matrix from sklearn.metrics import precision_score, recall_score, f1_score, accuracy_score import matplotlib.pyplot as plt import seaborn as sns from collections import Counter from s...
LeonardoVilela/toxic-nlp-study
codigos/tf-idf.py
tf-idf.py
py
8,490
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 34, "usage_type": "call" }, { "api_name": "spacy.load", "line_number": 39, "usage_type": "call" }, { "api_name": "unidecode.unidecode", "li...
34358259374
import pathlib import unittest import unittest.mock import gpu_affinity def get_mock_open(files: dict[str, str]): def open_mock(filename, *args, **kwargs): for expected_filename, content in files.items(): if filename == expected_filename: return unittest.mock.mock_open(read_da...
NVIDIA/gpu_affinity
tests/test.py
test.py
py
4,875
python
en
code
2
github-code
18
[ { "api_name": "unittest.mock.mock_open", "line_number": 12, "usage_type": "call" }, { "api_name": "unittest.mock", "line_number": 12, "usage_type": "attribute" }, { "api_name": "unittest.mock.MagicMock", "line_number": 15, "usage_type": "call" }, { "api_name": "un...
21843531956
import numpy as np import argparse import csv import matplotlib.pyplot as plt from data_preprocess import load_data from bayes_optuna_torch import optimizer_optuna, torch_cnn_lstm if __name__ == "__main__": # open file to store the data header = ["Dataset", "Run", "Epoch", "Learning_Rate", "Vali...
Qianli-Wu/EEG_classification
Pytorch/main.py
main.py
py
959
python
en
code
5
github-code
18
[ { "api_name": "csv.writer", "line_number": 15, "usage_type": "call" }, { "api_name": "data_preprocess.load_data", "line_number": 21, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 25, "usage_type": "call" }, { "api_name": "bayes_op...
34856947646
#CECI est un thread qui va tourner de manière indéfénie import serial import time def count_words(a): ser = serial.Serial('/dev/ttyUSB0') while(True): print('TWSS') time.sleep(5) u=ser.readline().decode() print(u) time.sleep(2) return u
kharzi-wissem/2019seecure
tasks.py
tasks.py
py
299
python
fr
code
0
github-code
18
[ { "api_name": "serial.Serial", "line_number": 8, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 11, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 16, "usage_type": "call" } ]
8321711813
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import datetime import functools import jsonschema import pytest from oas.request_body.models import RequestBody from oas.request_body.unmarshal...
grktsh/python-oas
tests/request_body/test_unmarshalers.py
test_unmarshalers.py
py
2,943
python
en
code
4
github-code
18
[ { "api_name": "oas.request_body.models.RequestBody", "line_number": 18, "usage_type": "name" }, { "api_name": "functools.partial", "line_number": 36, "usage_type": "call" }, { "api_name": "oas.request_body.unmarshalers.unmarshal_request_body", "line_number": 36, "usage_ty...
41033852151
from django.core.management.base import BaseCommand from ticket_platform.models import Account class Command(BaseCommand): help = 'Add EUR account' def handle(self, *args, **kwargs): account = Account(currency='EUR') self.stdout.write("EUR account ha been created")
kamil1marczak/ticket-service
project/ticket_platform/management/commands/add_initial_account.py
add_initial_account.py
py
294
python
en
code
1
github-code
18
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 5, "usage_type": "name" }, { "api_name": "ticket_platform.models.Account", "line_number": 9, "usage_type": "call" } ]
24722722339
#!/usr/bin/env python # -*- coding: utf-8 -*- import httplib2 import os import random import sys import time from apiclient.discovery import build from apiclient.errors import HttpError from apiclient.http import MediaFileUpload from oauth2client.client import flow_from_clientsecrets from oauth2client.file import Sto...
raupulus/python-video-publisher
Models/Youtube.py
Youtube.py
py
7,569
python
en
code
1
github-code
18
[ { "api_name": "httplib2.RETRIES", "line_number": 20, "usage_type": "attribute" }, { "api_name": "httplib2.HttpLib2Error", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 51, "usage_type": "call" }, { "api_name": "os....
71829993961
#!/usr/bin/env python import pika def sendErrorToQue(errorCode): connection = pika.BlockingConnection(pika.ConnectionParameters('localhost')) channel = connection.channel() channel.queue_declare(queue='errors') channel.basic_publish(exchange='errors', routing_key='errors', ...
hanstoomassaarest/idu0080
sendToQue.py
sendToQue.py
py
386
python
en
code
0
github-code
18
[ { "api_name": "pika.BlockingConnection", "line_number": 6, "usage_type": "call" }, { "api_name": "pika.ConnectionParameters", "line_number": 6, "usage_type": "call" } ]
37261229463
import os import shutil import time import zipfile if __name__ == "__main__": if os.path.isdir("build"): shutil.rmtree("build") if os.path.isdir("dist"): shutil.rmtree("dist") if os.path.isdir("spellbookrando"): shutil.rmtree("spellbookrando") os.system("pyinstaller spellbookrando.py --onefile") # ugly for...
Logg-y/spellbookrando
setup.py
setup.py
py
752
python
en
code
0
github-code
18
[ { "api_name": "os.path.isdir", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "shutil.rmtree", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_numbe...
74689668521
import asyncio from functools import reduce from http.client import HTTPException from operator import iconcat from httpx import AsyncClient from generator.parsers.parser_type import ParserType from generator.source_type import SourceType from generator.types import RepoData, RepoMeta, WrappedRepoData async def dow...
Crec0/carpet-rules-database
generator/downloader.py
downloader.py
py
2,505
python
en
code
15
github-code
18
[ { "api_name": "httpx.AsyncClient", "line_number": 14, "usage_type": "name" }, { "api_name": "generator.types.RepoData", "line_number": 15, "usage_type": "name" }, { "api_name": "generator.source_type.SourceType", "line_number": 17, "usage_type": "name" }, { "api_n...
8562251439
import unittest from nlu.data import * import sys from contextlib import contextmanager from io import StringIO import re @contextmanager def captured_output(): new_out, new_err = StringIO(), StringIO() old_out, old_err = sys.stdout, sys.stderr try: sys.stdout, sys.stderr = new_out, new_err ...
ciaochiaociao/ner_error_analysis
test/test.py
test.py
py
8,296
python
en
code
2
github-code
18
[ { "api_name": "io.StringIO", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.stdout", "line_nu...
776210609
from celery import shared_task from matches.models import Match, Delivery import logging logger = logging.getLogger(__file__) @shared_task def upload_matches(matches): from matches.service.match_service import MatchService match_list = [] logger.info('Match uploading started') for match in matches: ...
aadil-reckonsys/ipl-statistics
ipl/ipl/apps/storage/tasks.py
tasks.py
py
1,095
python
en
code
1
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 4, "usage_type": "call" }, { "api_name": "matches.models", "line_number": 12, "usage_type": "name" }, { "api_name": "matches.models.Match.objects.filter", "line_number": 13, "usage_type": "call" }, { "api_name": "m...
39890739259
from flask_app.config.mysqlconnection import connectToMySQL from flask import flash class Recipe: db = "recipes_schema" def __init__(self,data): self.id = data['id'] self.name = data['name'] self.description = data['description'] self.instructions = data['instructions'] ...
lisa-chen-58/Py20_Recipes
flask_app/models/recipe.py
recipe.py
py
2,652
python
en
code
0
github-code
18
[ { "api_name": "flask_app.config.mysqlconnection.connectToMySQL", "line_number": 21, "usage_type": "call" }, { "api_name": "flask_app.config.mysqlconnection.connectToMySQL", "line_number": 26, "usage_type": "call" }, { "api_name": "flask_app.config.mysqlconnection.connectToMySQL",...
8321536963
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import falcon from oas import Request from oas import unmarshal_request from oas.schema.unmarshalers import SchemaUnmarshaler from oas.utils import cached_property from s...
grktsh/falcon-oas
src/falcon_oas/middlewares.py
middlewares.py
py
4,050
python
en
code
7
github-code
18
[ { "api_name": "falcon.HTTPBadRequest", "line_number": 25, "usage_type": "attribute" }, { "api_name": "oas.Request", "line_number": 32, "usage_type": "name" }, { "api_name": "oas.utils.cached_property", "line_number": 57, "usage_type": "name" }, { "api_name": "oas....
27644428178
# plots.py from __future__ import division import matplotlib matplotlib.rcParams = matplotlib.rc_params_from_file('../../matplotlibrc') import numpy as np from numpy import array as arr from scipy.interpolate import interp1d from scipy.linalg import solve import matplotlib.pyplot as plt from matplotlib.axis import Axi...
davidkartchner/Labs
Vol4B/FiniteElement/plots.py
plots.py
py
3,993
python
en
code
null
github-code
18
[ { "api_name": "matplotlib.rcParams", "line_number": 4, "usage_type": "attribute" }, { "api_name": "matplotlib.rc_params_from_file", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy...
21100941484
import gc import os import pathlib from collections import OrderedDict import numpy as np import onnx import onnx_graphsurgeon as gs import tensorrt as trt import torch from cuda import cudart from diffusion_models import PipelineInfo from engine_builder import EngineBuilder, EngineType from polygraphy.backend.common ...
microsoft/onnxruntime
onnxruntime/python/tools/transformers/models/stable_diffusion/engine_builder_tensorrt.py
engine_builder_tensorrt.py
py
19,243
python
en
code
9,700
github-code
18
[ { "api_name": "numpy.int32", "line_number": 28, "usage_type": "attribute" }, { "api_name": "numpy.int64", "line_number": 29, "usage_type": "attribute" }, { "api_name": "numpy.float16", "line_number": 30, "usage_type": "attribute" }, { "api_name": "numpy.float32", ...
38374806075
import speech_recognition as sr # pip install SpeechRecognition .. import pyttsx3 # pip install pyttsx3 .. import pywhatkit # pip install pywhatkit .. import pyautogui # pip install pyautogui import wikipedia # pip install wikipedia import pyjokes # pip install pyjokes import requests # pip install requests impo...
MukeshCSK/Voice-Assistant
Alexa.py
Alexa.py
py
20,555
python
en
code
1
github-code
18
[ { "api_name": "speech_recognition.Recognizer", "line_number": 26, "usage_type": "call" }, { "api_name": "pyttsx3.init", "line_number": 27, "usage_type": "call" }, { "api_name": "mysql.connector.connector.connect", "line_number": 36, "usage_type": "call" }, { "api_...
23615303312
from PIL import Image from .quality_constants import ANTIALIASING from .transformation import resize def apply_texture(image, texture): texture = Image.open(texture) texture = resize(texture, (texture.size[0] * ANTIALIASING, texture.size[1] * ANTIALIASING)) texture = texture.point(lambda p: p * 2) fo...
lamanchy/pil_quality_pdf
textures.py
textures.py
py
536
python
en
code
0
github-code
18
[ { "api_name": "PIL.Image.open", "line_number": 8, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 8, "usage_type": "name" }, { "api_name": "transformation.resize", "line_number": 9, "usage_type": "call" }, { "api_name": "quality_constants.ANTIALI...
8263796020
from api import app,mysql from api.models import * from flask import jsonify @app.route("/Quiz") def CreateQuiz(): nom_quiz = Quiz.getNom() questions = Question.getQuestions(1) quiz = {"questions" : questions } y = 0 while y < len(quiz["questions"]): quiz["questions"][y]["choi...
Ineslzr/testProjet
api/views/v1/quiz.py
quiz.py
py
411
python
en
code
0
github-code
18
[ { "api_name": "flask.jsonify", "line_number": 18, "usage_type": "call" }, { "api_name": "api.app.route", "line_number": 6, "usage_type": "call" }, { "api_name": "api.app", "line_number": 6, "usage_type": "name" } ]
31791332261
from Leetcode_Problems_Python.Solver_Interface import Solver from typing import List class BinarySearch_Sovler(Solver): def solve(self, nums: List[int], target: int) -> int: # M: divide search space in half each iteration: i_s = 0 i_e = len(nums)-1 while i_s <= i_e: ...
Bussler/LeetCode_Grind75
Leetcode_Problems_Python/BinarySearch_Solver.py
BinarySearch_Solver.py
py
785
python
en
code
0
github-code
18
[ { "api_name": "Leetcode_Problems_Python.Solver_Interface.Solver", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 7, "usage_type": "name" } ]
3317943117
# -*- coding: utf-8 -*- """ Created on Tue Mar 27 18:14:21 2018 @author: PavitrakumarPC """ import keras import numpy as np import cv2 import os import pandas as pd import matplotlib.pyplot as plt from keras.layers import Conv2D, Dense, Input, Dropout, Flatten, Activation, MaxPooling2D, AveragePooling2D,...
pavitrakumar78/Street-View-House-Numbers-SVHN-Detection-and-Classification-using-CNN
train_digit_detection.py
train_digit_detection.py
py
4,953
python
en
code
59
github-code
18
[ { "api_name": "keras.backend.set_image_dim_ordering", "line_number": 24, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 24, "usage_type": "name" }, { "api_name": "pandas.read_hdf", "line_number": 28, "usage_type": "call" }, { "api_name": "os...
26387095449
#/usr/bin/env python3 #--*--coding:utf-8--*-- ''' /this is for process and plot the forc diagrams, /icluding the conventional and irregualar forc. /author: Jiabo /GFZ potsdam ''' import numpy as np import itertools import matplotlib #matplotlib.use('Agg') from matplotlib import pyplot as plt from lmfit import minimize...
botaoxiongyong/pyFORC
old/pyFORC_rem.py
pyFORC_rem.py
py
10,253
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.pyplot.scatter", "line_number": 37, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 37, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.show", "line_number": 38, "usage_type": "call" }, { "api_name": "ma...
26965359280
from __future__ import annotations import dataclasses as dc import itertools as it import typing as t import heapq as hq import pprint as pp Amphipod = t.Literal["A"] | t.Literal["B"] | t.Literal["C"] | t.Literal["D"] Stack = tuple[Amphipod, Amphipod] PStack = tuple[Amphipod, ...] costs: dict[Amphipod, int] = {"A":...
kwshi/aoc-2021
23/23.py
23.py
py
5,719
python
en
code
0
github-code
18
[ { "api_name": "typing.Literal", "line_number": 10, "usage_type": "attribute" }, { "api_name": "typing.cast", "line_number": 23, "usage_type": "call" }, { "api_name": "typing.cast", "line_number": 29, "usage_type": "call" }, { "api_name": "itertools.permutations", ...
3671137593
# -*- coding: utf8 -*- import os import pytest from flask import Flask from flask_z3950.z3950 import Z3950Manager, Z3950Database from flask_z3950.dataset import Dataset import settings_test as settings @pytest.fixture() def app(): app = Flask(__name__) app.config.from_object(settings) z3950_manager = Z39...
alexandermendes/Flask-Z3950
tests/conftest.py
conftest.py
py
1,552
python
en
code
12
github-code
18
[ { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "flask_z3950.z3950.Z3950Manager", "line_number": 15, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_z3950...
42796272893
# coding=utf-8 from gensim import corpora # 产生对应格式的texts def to_texts(file): datas = open(file, 'r') texts = [[word for word in data.split(',')] for data in datas] return texts # 统计维度,并生成对应的字典(去除停用词以及仅出现一次词的id) def tokens(texts): dictionary = corpora.Dictionary(texts) dictionary.save(...
reflexzj/data.mining
build_corpus/do_corpus.py
do_corpus.py
py
1,852
python
en
code
0
github-code
18
[ { "api_name": "gensim.corpora.Dictionary", "line_number": 13, "usage_type": "call" }, { "api_name": "gensim.corpora", "line_number": 13, "usage_type": "name" }, { "api_name": "gensim.corpora.MmCorpus.serialize", "line_number": 38, "usage_type": "call" }, { "api_na...
14342886595
""" **Notes:** A little less accurate than [ordinary least squares with MFC](3.html) but hard to tell if this is statistically significant. Have a look at [ridge regression](10.html) for some interesting developments. """ from sklearn import linear_model import numpy as np import matplotlib.pyplot as plt import rand...
dharness/sqwak
similarity-service/experiments/regression/ex12/main.py
main.py
py
1,766
python
en
code
1
github-code
18
[ { "api_name": "math.floor", "line_number": 18, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 19, "usage_type": "call" }, { "api_name": "utils.mfc", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number"...
43697059845
from utils.simple_logger import Log from transformers import AutoModelForCausalLM, LlamaTokenizer, LlamaForCausalLM, BitsAndBytesConfig, AutoTokenizer, AutoModel import torch from langchain.embeddings import LlamaCppEmbeddings from langchain.llms import LlamaCpp from langchain import PromptTemplate, LLMChain from lang...
wesleysanjose/ianow
doc_search_llm/modules/model_processor.py
model_processor.py
py
5,159
python
en
code
2
github-code
18
[ { "api_name": "sys.path.append", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 16, "usage_type": "call" }, { "api_name": "utils.simple_logger.Log.ge...
9408617075
import json def format_mapping_dicts(nodes): """ Convert text nodes to integer mappings :param nodes: :return: """ json_key = 'content' output_nodes = load_json("./training_info/nodes.json")[json_key] output_keywords = load_json("./training_info/keywords.json")[json_key] output_...
mjpcollins/yulokudu
utils/t.py
t.py
py
1,851
python
en
code
1
github-code
18
[ { "api_name": "json.load", "line_number": 58, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 64, "usage_type": "call" } ]
7458431632
import os import matplotlib.pyplot as plt plt.rcParams['pdf.fonttype'] = 42 plt.rcParams['ps.fonttype'] = 42 plt.rcParams['font.family'] = 'serif' from scipy.stats import truncnorm import numpy as np # import ipdb import json import torch from torch.nn import init from torchvision.utils import save_image, make_grid ...
mengyu-yang/ISSA
ISSA/util/utils.py
utils.py
py
5,859
python
en
code
1
github-code
18
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 3, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 3, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 4, "usage_type": "attribute" }, { "ap...
32362873871
from django.utils.html import format_html from django.utils.translation import gettext_lazy as _ from cms.toolbar.items import Button, ButtonList from djangocms_versioning.cms_toolbars import VersioningToolbar from djangocms_version_locking.helpers import ( content_is_unlocked_for_user, get_lock_for_content,...
FidelityInternational/djangocms-version-locking
djangocms_version_locking/monkeypatch/cms_toolbars.py
cms_toolbars.py
py
2,569
python
en
code
1
github-code
18
[ { "api_name": "cms.toolbar.items.Button", "line_number": 14, "usage_type": "name" }, { "api_name": "djangocms_version_locking.helpers.content_is_unlocked_for_user", "line_number": 36, "usage_type": "call" }, { "api_name": "djangocms_version_locking.helpers.get_lock_for_content", ...
25073611324
from keras import Sequential from keras.models import Sequential from keras.layers import Dense, Dropout, Flatten, Conv2D, MaxPool2D from keras.datasets import fashion_mnist import numpy as np import matplotlib.pyplot as plt import seaborn as sns from sklearn.metrics import classification_report, confusion_matri...
RS99/Cloth-Detector
asd.py
asd.py
py
1,874
python
en
code
1
github-code
18
[ { "api_name": "keras.datasets.fashion_mnist.load_data", "line_number": 10, "usage_type": "call" }, { "api_name": "keras.datasets.fashion_mnist", "line_number": 10, "usage_type": "name" }, { "api_name": "numpy.expand_dims", "line_number": 14, "usage_type": "call" }, { ...
21259099864
#usage: python3 dnslook.py <domain or ip address> #python3.x import sys import dns.resolver import dns.reversename import argparse import ipaddress parser = argparse.ArgumentParser() parser.add_argument("destination") args = parser.parse_args() dest = args.destination dnsrecords = ["A", "AAAA", "MX", "NS", "SOA", "TXT...
GinjaChris/dnslook
dnslook.py
dnslook.py
py
1,621
python
en
code
1
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "ipaddress.ip_address", "line_number": 18, "usage_type": "call" }, { "api_name": "dns.resolver.reversename.from_address", "line_number": 27, "usage_type": "call" }, { ...
1204498881
from telethon import TelegramClient, sync import os # import socks #如果你不需要通过代理连接Telegram,可以删掉这一行 from telethon.tl.types import InputMessagesFilterPhotos, InputMessagesFilterVideo import json # 读取 config f = open('config.json', 'r') content = f.read() config = json.loads(content) # =============需要被替换的值================...
HyanCat/telegram-dl
download.py
download.py
py
1,828
python
en
code
0
github-code
18
[ { "api_name": "json.loads", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 39, "usage_type": "call" }, { "api_name": "os.path", "line_number": 39, "usage_type": "attribute" }, { "api_name": "telethon.TelegramClient", ...
22904906590
import time import requests import sys import json from datetime import datetime from colorama import Fore, Back, Style, init coinNames = ["BTC-EUR", "ETH-EUR", "LTC-EUR", "BCH-EUR", "LINK-USD"] USDTOEUR = 0.89 MAX_COINS = len(coinNames) def loadCurrencies(): with open("currencies.txt") as file: line = ...
carlos93/cryptotracker
collector.py
collector.py
py
4,567
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 30, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 38, "usage_type": "call" }, { "api_name": "colorama.Fore.GREEN", "line_number": 57, "usage_type": "attribute" }, { "api_name": "colorama.Fore", ...
42610173244
import cv2 import picamera import picamera.array import time with picamera.PiCamera() as camera: with picamera.array.PiRGBArray(camera) as stream: while True: camera.capture(stream, format='bgr') image = stream.array gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) ...
nekonaute/thymioPYPI
OctoPY/rpifiles/tools/camera_tools/show_stream.py
show_stream.py
py
567
python
en
code
1
github-code
18
[ { "api_name": "picamera.PiCamera", "line_number": 6, "usage_type": "call" }, { "api_name": "picamera.array.PiRGBArray", "line_number": 7, "usage_type": "call" }, { "api_name": "picamera.array", "line_number": 7, "usage_type": "attribute" }, { "api_name": "cv2.cvtC...