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
74667010345
from math import sqrt, cos, sin, pi import numpy as np import pyvista as pv # Affine rotation #### #' Matrix of the affine rotation around an axis #' @param theta angle of rotation in radians #' @param P1,P2 the two points defining the axis of rotation def AffineRotationMatrix(theta, P1, P2): T = np.vstack( ...
stla/PyVistaMiscellanous
InvertedSolidMobiusStrip.py
InvertedSolidMobiusStrip.py
py
3,809
python
en
code
4
github-code
36
[ { "api_name": "numpy.vstack", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.hstack", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.eye", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": ...
27142738401
from django.shortcuts import render, get_object_or_404 from .models import Animal def index(request): animais = Animal.objects.all() return render(request, 'clientes/index.html', { 'animais': animais }) def ver_animal(request, animal_id): animal = get_object_or_404(Animal, id=animal_id) ...
LorenzoBorges/Projeto-Veterinario
clientes/views.py
views.py
py
406
python
en
code
0
github-code
36
[ { "api_name": "models.Animal.objects.all", "line_number": 6, "usage_type": "call" }, { "api_name": "models.Animal.objects", "line_number": 6, "usage_type": "attribute" }, { "api_name": "models.Animal", "line_number": 6, "usage_type": "name" }, { "api_name": "djang...
38066575543
# import the argmax function from numpy to get the index of the maximum value in an array from numpy import argmax # import the mnist dataset from keras, which contains 60,000 images of handwritten digits for training and 10,000 images for testing from keras.datasets import mnist # import the to_categorical function fr...
mohammadnr2817/digit_classifier
digit_classifier.py
digit_classifier.py
py
11,367
python
en
code
0
github-code
36
[ { "api_name": "keras.datasets.mnist.load_data", "line_number": 42, "usage_type": "call" }, { "api_name": "keras.datasets.mnist", "line_number": 42, "usage_type": "name" }, { "api_name": "keras.utils.to_categorical", "line_number": 47, "usage_type": "call" }, { "ap...
37129616360
import numpy as np import cv2 import NeuralNetwork import json import os import matplotlib.pyplot as plt #defining the initial parameters and the learning rate batch_size = 10 nn_hdim = 2048 learning_rate = 0.1 f1 = "relu" f2 = "sigmoid" threshold = 0.0001 sd_init = 0.01 sd_init_w2 = sd_init def make_json(W1, W2, b1...
leosegre/medic_ip_project
main.py
main.py
py
6,594
python
en
code
0
github-code
36
[ { "api_name": "os.path.join", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path", "line_number": 38, "usage_type": "attribute" }, { "api_name": "json.dump", "line_number": 42, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 5...
29126825853
#Grupo PHP #Kevin Cevallos #María Camila Navarro #Joffre Ramírez import ply.lex as lex reserved = { 'if': 'IF', 'else': 'ELSE', 'elseif': 'ELSEIF', #'boolean': 'BOOLEAN', #'float': 'FLOAT', #'string': 'STRING', 'null': 'NULL', 'array': 'ARRAY', #'object': 'OBJECT', 'break': 'BRE...
keanceva/ProyectoLP
lexicoLP.py
lexicoLP.py
py
6,448
python
en
code
0
github-code
36
[ { "api_name": "ply.lex.lex", "line_number": 366, "usage_type": "call" }, { "api_name": "ply.lex", "line_number": 366, "usage_type": "name" } ]
11539702751
import os import pygame import pygame.color from views.panelview import PanelView class MenuView(PanelView): def __init__(self, config, bus): PanelView.__init__(self, config, bus) self.fntRegText = pygame.font.Font(os.path.join(self.config.script_directory, "assets/Roboto-Regular.ttf"), 16) ...
mcecchi/OctoPiControlPanel
views/menuview.py
menuview.py
py
2,401
python
en
code
1
github-code
36
[ { "api_name": "views.panelview.PanelView", "line_number": 7, "usage_type": "name" }, { "api_name": "views.panelview.PanelView.__init__", "line_number": 9, "usage_type": "call" }, { "api_name": "views.panelview.PanelView", "line_number": 9, "usage_type": "name" }, { ...
74367228902
import json from flask import Flask, render_template, request, jsonify import requests app = Flask(__name__) API_KEY = '0c20320445392a19d9b2a02ae290502c' BASE_URL = 'http://api.weatherstack.com/current' def get_weather(city): params = { 'access_key': API_KEY, 'query': city, } try: ...
ruisu666/WeatherApp-Flask
app.py
app.py
py
2,886
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.exceptions", "line_number": 53, "usage_type": "attribute" }, { "api_name": "flask.request.method...
73923124264
#!/usr/bin/env python3 import requests import json import sys from collections import OrderedDict def get_versions(): url = 'https://api.github.com/repos/jenkinsci/swamp-plugin/releases' versions = set() response = requests.get(url) if response.status_code == 200: response = response.json() ...
vamshikr/swamp-plugin-stats
src/jenkins.py
jenkins.py
py
1,306
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 30, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 37, "usage_type": "call" }, { "api_name": "json.loads", "...
25874083390
#! python3 # scraper for dark souls armor import requests import re import sqlite3 from bs4 import BeautifulSoup import time # connecting to actual database conn = sqlite3.connect("./databases/armor.db") # testing connection # conn = sqlite3.connect(":memory:") c = conn.cursor() with conn: c.execute("""CREAT...
Bipolarprobe/armorcalc
armorscrape.py
armorscrape.py
py
3,289
python
en
code
0
github-code
36
[ { "api_name": "sqlite3.connect", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 43, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 45, "usage_type": "call" }, { "api_name": "re.compile", "line...
33779283072
#!/usr/local/bin/python3.7 ############# # Imports # ############# import globalvars import modules.conf as conf import modules.misc as misc import modules.platform as platform import modules.special as special import modules.subst as subst import configparser import os import shutil import subprocess #############...
kraileth/miniraven
miniraven.py
miniraven.py
py
10,771
python
en
code
1
github-code
36
[ { "api_name": "globalvars.OSNAME", "line_number": 25, "usage_type": "attribute" }, { "api_name": "globalvars.OSVERSION", "line_number": 26, "usage_type": "attribute" }, { "api_name": "globalvars.OSRELEASE", "line_number": 27, "usage_type": "attribute" }, { "api_na...
74436895785
# Author Chaudhary Hamdan from functools import reduce def factors(n): return set(reduce(list.__add__, ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))) t = int(input()) for _ in range(t): n,k = [int(x) for x in input().split()] if k == 0: print(0) ...
hamdan-codes/codechef-unrated-contests
Codingo21_CODINGO01.py
Codingo21_CODINGO01.py
py
536
python
en
code
2
github-code
36
[ { "api_name": "functools.reduce", "line_number": 6, "usage_type": "call" } ]
16968865127
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django import forms from django.contrib.auth import get_user_model from django.contrib.auth.forms import UserChangeForm, UserCreationForm from django.utils.translation import ugettext_lazy as _ USERNAME_FIELD_HELP_TEXT = _( 'Required field. Leng...
infolabs/django-edw
backend/edw/admin/customer/forms.py
forms.py
py
2,967
python
en
code
6
github-code
36
[ { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 9, "usage_type": "call" }, { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 12, "usage_type": "call" }, { "api_name": "django.contrib.auth.forms.UserCreationForm", "line_number": 18, ...
41774888432
import time import sys sys.path.append("../") from Utils_1 import Util import pymysql from lxml import etree import requests import http from Utils_1.UA import User_Agent import random """ 数据来源:中华人民共和国商务部 来源地址:http://femhzs.mofcom.gov.cn/fecpmvc/pages/fem/CorpJWList_nav.pageNoLink.html?session=T&sp=1&sp=S+_t1...
921016124/Spiders
module/对外投资/femhzs_mofcom_gov.py
femhzs_mofcom_gov.py
py
5,506
python
en
code
0
github-code
36
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "Utils_1.Util", "line_number": 54, "usage_type": "call" }, { "api_name": "pymysql.err", "line_numb...
2050897159
from openpyxl import load_workbook, Workbook from django.core.management import BaseCommand from django.db.utils import IntegrityError from nomenclature.models import * SERVICE_TYPES = [ 'Not defined', 'ПРОФ', 'Лабораторное исследование', 'Коммерческий профиль', 'Услуга' ] class Command(BaseComma...
Sin93/lab
nomenclature/management/commands/import.py
import.py
py
9,200
python
en
code
0
github-code
36
[ { "api_name": "django.core.management.BaseCommand", "line_number": 15, "usage_type": "name" }, { "api_name": "openpyxl.load_workbook", "line_number": 28, "usage_type": "call" }, { "api_name": "openpyxl.load_workbook", "line_number": 53, "usage_type": "call" }, { "...
36315576627
from __future__ import print_function import sys import json import collections import getopt g_debug = False g_indent = 4 def debug(s): if g_debug: print("DEBUG> " + s) def usage(s): sys.stderr.write("Usage: %s [-t <indent>] [-d] <[-f <json file>] | txt>\n" % s) sys.stderr...
idorax/vCodeHub
sharpsword/python/jsonfmt.py
jsonfmt.py
py
1,840
python
en
code
1
github-code
36
[ { "api_name": "sys.stderr.write", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 17, "usage_type": "attribute" }, { "api_name": "sys.stderr.write", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.stderr", "l...
35936751903
import covasim as cv import pandas as pd import sciris as sc import pylab as pl import numpy as np from matplotlib import ticker import datetime as dt import matplotlib.patches as patches import seaborn as sns import matplotlib as mpl from matplotlib.colors import LogNorm # Filepaths resultsfolder = 'sweeps' sensfolde...
optimamodel/covid_nsw
1_submission/plot_nsw_sweeps.py
plot_nsw_sweeps.py
py
13,309
python
en
code
2
github-code
36
[ { "api_name": "sciris.tic", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 23, "usage_type": "call" }, { "api_name": "pylab.rcParams", "line_numbe...
17793223864
from dgl.nn.pytorch.conv import SAGEConv import torch import torch.nn as nn import torch.nn.functional as F import time import numpy as np from dgl import DGLGraph from dgl.data import citation_graph as citegrh import networkx as nx class GraphSAGE(nn.Module): def __init__(self, in_feats, ...
Gabtakt/GNN-lab
GraphSAGE.py
GraphSAGE.py
py
2,428
python
en
code
1
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 15, "usage_type": "name" }, { "api_name": "torch.nn.ModuleList", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.nn", "lin...
42222604118
""" new visualizations 2020 Revision ID: 437ffc36a821 Revises: d73f1a3bccf3 Create Date: 2020-07-16 19:48:01.228630 """ from alembic import op from sqlalchemy import String, Integer from sqlalchemy.sql import table, column, text from caipirinha.migration_utils import get_enable_disable_fk_command # revision identi...
eubr-bigsea/caipirinha
migrations/versions/437ffc36a821_new_visualizations_2020.py
437ffc36a821_new_visualizations_2020.py
py
2,171
python
en
code
1
github-code
36
[ { "api_name": "sqlalchemy.sql.table", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.sql.column", "line_number": 23, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 23, "usage_type": "argument" }, { "api_name": "sql...
27702917459
from re import L from flask import Flask from flask import jsonify from flask import request from flask_restful import Api, Resource, reqparse import json import sys from get_details import get_name from process_swipe import process_swipe import requests import random from eventlet import wsgi import eventlet from redi...
mbruty/COMP2003-2020-O
recommender/main.py
main.py
py
5,688
python
en
code
3
github-code
36
[ { "api_name": "pymongo.MongoClient", "line_number": 22, "usage_type": "call" }, { "api_name": "redis_instance.get_instance", "line_number": 25, "usage_type": "call" }, { "api_name": "flask_restful.reqparse.RequestParser", "line_number": 30, "usage_type": "call" }, { ...
28891383601
"""Initializes and checks the environment needed to run pytype.""" import logging import sys from typing import List from pytype.imports import typeshed from pytype.platform_utils import path_utils from pytype.tools import runner def check_pytype_or_die(): if not runner.can_run("pytype", "-h"): logging.critic...
google/pytype
pytype/tools/environment.py
environment.py
py
3,242
python
en
code
4,405
github-code
36
[ { "api_name": "pytype.tools.runner.can_run", "line_number": 13, "usage_type": "call" }, { "api_name": "pytype.tools.runner", "line_number": 13, "usage_type": "name" }, { "api_name": "logging.critical", "line_number": 14, "usage_type": "call" }, { "api_name": "sys....
42469623972
import os import morfeusz2 import pandas as pd from sklearn.metrics import classification_report def lemmatize_text(text): if isinstance(text, str): text = text.split() morf = morfeusz2.Morfeusz(expand_dag=True, expand_tags=True) text_new = [] for word in text: w = morf.analyse(word)[0...
kingagla/reviews_classification
scripts/utils.py
utils.py
py
1,049
python
en
code
3
github-code
36
[ { "api_name": "morfeusz2.Morfeusz", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "...
74779852584
from unittest import TestCase from collections import namedtuple from P2_Sorting.HeapSort.heap_sort import heap_sort class Task(object): def __init__(self, deadline, penalty): assert isinstance(deadline, int) and deadline > 0 assert penalty > 0 self._penalty = penalty self._deadli...
GarfieldJiang/CLRS
P4_AdvancedTech/Greedy/task_scheduling_with_matroid.py
task_scheduling_with_matroid.py
py
4,191
python
en
code
0
github-code
36
[ { "api_name": "P2_Sorting.HeapSort.heap_sort.heap_sort", "line_number": 70, "usage_type": "call" }, { "api_name": "P2_Sorting.HeapSort.heap_sort.heap_sort", "line_number": 83, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 90, "usage_type": "nam...
70942499944
from pyspark.sql import SparkSession from pyspark.sql.functions import col import boto3 session = boto3.Session(profile_name="***_AdministratorAccess",region_name="us-east-1") s3 = boto3.resource('s3') # Inicialize a sessão do Spark spark = SparkSession.builder.getOrCreate() # Leia os arquivos Parquet e crie os dataf...
nataliasguimaraes/compassuol
sprint_09/desafio_etl/processed_trusted/proc_trusted.py
proc_trusted.py
py
2,573
python
pt
code
0
github-code
36
[ { "api_name": "boto3.Session", "line_number": 4, "usage_type": "call" }, { "api_name": "boto3.resource", "line_number": 5, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder.getOrCreate", "line_number": 8, "usage_type": "call" }, { "api_name":...
71967566185
import subprocess import pytest from pipfile2req.requirements import requirement_from_pipfile def compare_requirements(left, right): return len(set(left.splitlines()) - set(right.splitlines())) == 0 @pytest.mark.parametrize( "command,golden_file", [ ("pipfile2req -p tests", "tests/requirements....
frostming/pipfile-requirements
test_pipfile_requirements.py
test_pipfile_requirements.py
py
2,499
python
en
code
49
github-code
36
[ { "api_name": "subprocess.Popen", "line_number": 25, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 26, "usage_type": "attribute" }, { "api_name": "pytest.mark.parametrize", "line_number": 11, "usage_type": "call" }, { "api_name": "pytest....
75071109224
import requests import pandas as pd import numpy as np import seaborn as sns from bs4 import BeautifulSoup import warnings import nltk #import surprise import scipy as sp from sklearn.metrics.pairwise import cosine_similarity from sklearn.feature_extraction.text import CountVectorizer from nltk.corpus import stopword...
Liixxn/MovieMender
generos.py
generos.py
py
7,990
python
es
code
1
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 29, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 34, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 34, "usage_type": "name" }, { "api_name": "pandas.read_c...
17792225774
from __future__ import absolute_import, division, print_function, unicode_literals import logging import os import re from builtins import open from pants.backend.codegen.antlr.java.java_antlr_library import JavaAntlrLibrary from pants.backend.jvm.targets.java_library import JavaLibrary from pants.backend.jvm.tasks.n...
fakeNetflix/twitter-repo-pants
src/python/pants/backend/codegen/antlr/java/antlr_java_gen.py
antlr_java_gen.py
py
6,475
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "pants.java.jar.jar_dependency.JarDependency", "line_number": 22, "usage_type": "call" }, { "api_name": "pants.java.jar.jar_dependency.JarDependency", "line_number": 26, "usage_typ...
70616752744
import constants from flask import jsonify, make_response def getData(request): body = request.json outlook = body['outlook'] temp = body['temp'] humidity = body['humidity'] wind = body['wind'] data = [ constants.OUTLOOK_VALUES[outlook], constants.TEMP_VALUES[temp], con...
mgstabrani/play-tennis-model-service-python
general.py
general.py
py
675
python
en
code
0
github-code
36
[ { "api_name": "constants.OUTLOOK_VALUES", "line_number": 12, "usage_type": "attribute" }, { "api_name": "constants.TEMP_VALUES", "line_number": 13, "usage_type": "attribute" }, { "api_name": "constants.HUMIDITY_VALUES", "line_number": 14, "usage_type": "attribute" }, ...
32203986950
import streamlit as st from recipesnet.api import RecipesApi from recipesnet.st_helpers import recip_ingr_widget st.set_page_config("Recipes net", layout="wide") st.title("Recipes similarity") st.write( """ In this section you can search what recipes are similar to an specific one. """ ) with st.spinner("Lo...
jmorgadov/complex-recipes-net
recipesnet/pages/Similarity.py
Similarity.py
py
1,054
python
en
code
0
github-code
36
[ { "api_name": "streamlit.set_page_config", "line_number": 6, "usage_type": "call" }, { "api_name": "streamlit.title", "line_number": 8, "usage_type": "call" }, { "api_name": "streamlit.write", "line_number": 9, "usage_type": "call" }, { "api_name": "streamlit.spin...
75084616422
""" firebase.py This module caches video information in Firebase using the user's id as the key. Cached video entries include duration, title, channel name, category, and timestamp. The timestamp acts as a TTL of 24 hours, and entries older than the TTL are updated by requesting the video information from the YouTube ...
ractodev/youtube-wrapped-v1
utils/firebase.py
firebase.py
py
4,392
python
en
code
1
github-code
36
[ { "api_name": "sys.path.append", "line_number": 24, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_num...
29073464319
import csv import datetime import pathlib from typing import Generator import click from case_rate._types import Cases, CaseTesting, PathLike from case_rate.sources._utilities import download_file from case_rate.storage import InputSource def _to_date(date: str) -> datetime.date: '''Converts a date string into ...
richengguy/case-rate
src/case_rate/sources/public_health_agency_canada.py
public_health_agency_canada.py
py
4,097
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.strptime", "line_number": 26, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 26, "usage_type": "attribute" }, { "api_name": "datetime.date", "line_number": 13, "usage_type": "attribute" }, { "api_name": "...
73387100264
import time from dataclasses import dataclass from transmitter import sendEmail from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.chrome.options import Options from selenium.webdriver.firefox.options import Options as FFOptions from selenium.webdriver.common....
ghazis/auto_flights
backend/flight_scraper/AutoWeb.py
AutoWeb.py
py
3,652
python
en
code
0
github-code
36
[ { "api_name": "selenium.webdriver.firefox.options.Options", "line_number": 19, "usage_type": "call" }, { "api_name": "selenium.webdriver.chrome.options.Options", "line_number": 19, "usage_type": "call" }, { "api_name": "selenium.webdriver.Firefox", "line_number": 23, "usa...
7431120432
from sqlalchemy import create_engine from constants import get_nutrient_idx def load_cache(): db = create_engine('sqlite:///usda.sql3') cache = {} query = "SELECT food.id,food.long_desc,food_group.name,nutrient.tagname,nutrition.amount,weight.gm_weight,weight.gm_weight*nutrition.amount/100.0 as gm_amount,wei...
sidowsky/sr_takehome
loaders.py
loaders.py
py
1,169
python
en
code
0
github-code
36
[ { "api_name": "sqlalchemy.create_engine", "line_number": 5, "usage_type": "call" }, { "api_name": "constants.get_nutrient_idx", "line_number": 14, "usage_type": "call" } ]
31095405505
#You'r a robot? from random import randint, randrange from PIL import Image, ImageDraw, ImageFont import os import textwrap class CreateCaptcha: def __init__(self): self.valido = False self.l = [] self.width = 300 self.height = 150 self.font_size = 60 # Tamanho ...
Jv131103/ProjectCaptcha
cp.py
cp.py
py
2,968
python
pt
code
0
github-code
36
[ { "api_name": "random.randrange", "line_number": 16, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 19, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 21, "usage_type": "call" }, { "api_name": "random.randint", "...
1395161242
#!/usr/bin/env python # coding: utf-8 # 1. Compare and contrast the float and Decimal classes' benefits and drawbacks. # # floats are faster and more memory-efficient, suitable for a wide range of values, but can have precision and rounding issues. Decimals provide precise decimal arithmetic, accurate representatio...
Rajn013/assignment-020
Untitled83.py
Untitled83.py
py
3,685
python
en
code
0
github-code
36
[ { "api_name": "decimal.Decimal", "line_number": 22, "usage_type": "call" }, { "api_name": "decimal.Decimal", "line_number": 23, "usage_type": "call" }, { "api_name": "decimal.Decimal", "line_number": 38, "usage_type": "call" }, { "api_name": "decimal.Decimal", ...
3974726049
import json import os from datetime import datetime from sys import exit as x from typing import List import cv2 import numpy as np import pandas as pd import printj # pip install printj from jaitool.inference import D2Inferer as inferer from jaitool.inference.models.hook import draw_info_box, draw_inference_on_hook2...
Jitesh17/jaitool
jaitool/inference/models/hook/hook.py
hook.py
py
25,575
python
en
code
0
github-code
36
[ { "api_name": "typing.List", "line_number": 44, "usage_type": "name" }, { "api_name": "annotation_utils.coco.structs.COCO_Dataset.load_from_path", "line_number": 50, "usage_type": "call" }, { "api_name": "annotation_utils.coco.structs.COCO_Dataset", "line_number": 50, "us...
10125696279
#!/bin/bash/env python # coding=UTF-8 # by Tarcisio marinho # github.com/tarcisio-marinho import requests,json,os def minha_localizacao(frase): url = 'http://freegeoip.net/json/' try: requisicao = requests.get('http://freegeoip.net/json/') dicionario = json.loads(requisicao.text) if(fra...
tarcisio-marinho/Eliza
modulos/mapa.py
mapa.py
py
2,562
python
pt
code
11
github-code
36
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 10, "usage_type": "call" }, { "api_name": "os.system", "line_number": 15, "usage_type": "call" }, { "api_name": "os.system", "line_number": 20, ...
19494554547
from jinja2 import Environment, FileSystemLoader, select_autoescape env = Environment( loader=FileSystemLoader('templates'), autoescape=select_autoescape(['html', 'xml']) ) def render_run_plan(workout, routes, sunrise_sunset, forecast, dress): template = env.get_template('run_plan.html') return templ...
csickelco/runforfun
runforfun/util/template_engine.py
template_engine.py
py
452
python
en
code
0
github-code
36
[ { "api_name": "jinja2.Environment", "line_number": 3, "usage_type": "call" }, { "api_name": "jinja2.FileSystemLoader", "line_number": 4, "usage_type": "call" }, { "api_name": "jinja2.select_autoescape", "line_number": 5, "usage_type": "call" } ]
42482969055
from __future__ import print_function import logging from optparse import OptionParser import os import re import subprocess import sys import tempfile from threading import Thread, Lock import time if sys.version < '3': import Queue else: import queue as Queue # Append `SPARK_HOME/dev` to the Python path so ...
TIBCOSoftware/snappydata
python/run-snappy-tests.py
run-snappy-tests.py
py
7,072
python
en
code
1,041
github-code
36
[ { "api_name": "sys.version", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.join", "li...
973355858
from pathlib import Path import unittest from lispy import reader from lispy import rep as step6_file from lispy.env import Env from lispy.mal_types import MalList, MalAtom, MalInt from lispy.mal_types import MalSyntaxException, MalString class TestStep6(unittest.TestCase): def setUp(self) -> None: self....
rectalogic/lispy
tests/test_step6.py
test_step6.py
py
3,164
python
en
code
0
github-code
36
[ { "api_name": "unittest.TestCase", "line_number": 11, "usage_type": "attribute" }, { "api_name": "lispy.rep.init_repl_env", "line_number": 13, "usage_type": "call" }, { "api_name": "lispy.rep", "line_number": 13, "usage_type": "name" }, { "api_name": "lispy.mal_ty...
15724939255
import ast import os # Third party imports from setuptools import find_packages, setup HERE = os.path.abspath(os.path.dirname(__file__)) def get_version(module='spyder_reports'): """Get version.""" with open(os.path.join(HERE, module, '_version.py'), 'r') as f: data = f.read() lines = data.split...
spyder-ide/spyder-reports
setup.py
setup.py
py
1,820
python
en
code
72
github-code
36
[ { "api_name": "os.path.abspath", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
21091300951
import streamlit as st import scraper stock = ['AAPL', 'AMZN', 'INTC', 'GOOG', 'CSCO'] search_btn = False if st.sidebar.checkbox("Deseja procurar alguma ação?"): symbol = st.sidebar.text_input("Dígite o símbolo da ação desejada") if len(symbol) == 4: new_company_info = scraper.fetch_info(symbol) ...
rodrigoaqueiroz/laraia-yahoo-finance
main.py
main.py
py
1,440
python
pt
code
0
github-code
36
[ { "api_name": "streamlit.sidebar.checkbox", "line_number": 9, "usage_type": "call" }, { "api_name": "streamlit.sidebar", "line_number": 9, "usage_type": "attribute" }, { "api_name": "streamlit.sidebar.text_input", "line_number": 10, "usage_type": "call" }, { "api_...
32331250687
#!/usr/bin/python3 """ Script that takes in a letter and sends a POST request to http://0.0.0.0:5000/search_user with the letter as a parameter. """ from sys import argv import requests if __name__ == "__main__": if len(argv) < 2: q = "" else: q = argv[1] values = {'q': q} url = "ht...
ammartica/holbertonschool-higher_level_programming
0x11-python-network_1/8-json_api.py
8-json_api.py
py
617
python
en
code
0
github-code
36
[ { "api_name": "sys.argv", "line_number": 14, "usage_type": "argument" }, { "api_name": "sys.argv", "line_number": 17, "usage_type": "name" }, { "api_name": "requests.post", "line_number": 21, "usage_type": "call" } ]
15772164828
from django.shortcuts import render,redirect from axf.models import SlideShow, Cart,MainDescription, Product,CategorieGroup,ChildGroup,User,Address,Order from django.contrib.auth import logout import random from axf.sms import send_sms from django.http import JsonResponse import uuid # Create your views here. def hom...
qwewangjian/Xgd
axf/views.py
views.py
py
8,953
python
en
code
0
github-code
36
[ { "api_name": "axf.models.SlideShow.objects.all", "line_number": 12, "usage_type": "call" }, { "api_name": "axf.models.SlideShow.objects", "line_number": 12, "usage_type": "attribute" }, { "api_name": "axf.models.SlideShow", "line_number": 12, "usage_type": "name" }, ...
17878539903
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """Helper functions for the workflows""" from distutils.version import StrictVersion from builtins import range def _tofloat(inlist): if isinstance(inlist, (list, tuple)): return [float(el) fo...
pGarciaS/PREEMACS
scripts/mriqc/mriqc/workflows/utils.py
utils.py
py
5,355
python
en
code
8
github-code
36
[ { "api_name": "nibabel.load", "line_number": 19, "usage_type": "call" }, { "api_name": "nipype.interfaces.base.isdefined", "line_number": 22, "usage_type": "call" }, { "api_name": "nipype.interfaces.base.isdefined", "line_number": 27, "usage_type": "call" }, { "ap...
35042458812
import pickle import argparse import pickle parser = argparse.ArgumentParser() parser.add_argument('-f', '--fasta', help='fasta input file') args = parser.parse_args() junction_id_to_seq = {} with open(args.fasta, "r") as f: while True: line1 = f.readline() if not line1: break ...
salzmanlab-admin/DEEPEST-Fusion
reference_files/create_pickle_file.py
create_pickle_file.py
py
471
python
en
code
5
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 21, "usage_type": "call" } ]
3735254268
#!/usr/bin/env python3 # # get_ad_right_matrix.py # Export AD User -> Group Matrix to Excel # Written by Maximilian Thoma 2021 # import json import re import ldap3 import pandas as pd ######################################################################################################################## # NOTE: # --...
lanbugs/get_ad_right_matrix
get_ad_right_matrix.py
get_ad_right_matrix.py
py
4,692
python
en
code
3
github-code
36
[ { "api_name": "ldap3.Server", "line_number": 50, "usage_type": "call" }, { "api_name": "ldap3.Connection", "line_number": 51, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 53, "usage_type": "call" }, { "api_name": "re.findall", "line_numbe...
25108240229
from zigzag.classes.io.onnx.parser import Parser from zigzag.classes.io.onnx.utils import get_node_input_output_dimension_shapes from zigzag.classes.workload.layer_node import LayerNode import logging logger = logging.getLogger(__name__) class SoftmaxParser(Parser): """Parser for ONNX Softmax nodes into...
wangxdgg/zigzag_2
zigzag/classes/io/onnx/softmax2.py
softmax2.py
py
3,148
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "zigzag.classes.io.onnx.parser.Parser", "line_number": 9, "usage_type": "name" }, { "api_name": "zigzag.classes.io.onnx.utils.get_node_input_output_dimension_shapes", "line_number": 50,...
4978717366
#!/usr/bin/python3 from PyQt5 import QtCore from PyQt5.QtCore import QSize, QUrl from PyQt5.QtMultimedia import QMediaContent, QMediaPlayer from PyQt5.QtMultimediaWidgets import QVideoWidget from PyQt5.QtWidgets import * from PyQt5.QtWidgets import QMainWindow,QWidget, QPushButton from PyQt5.QtGui import QIcon, QPixma...
SalomanYu/StudyWithMe
main.py
main.py
py
15,163
python
en
code
1
github-code
36
[ { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 13, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QMainWin...
28853226017
import bpy from bpy.types import Menu brush_icons = {} def create_icons(): global brush_icons icons_directory = bpy.utils.system_resource('DATAFILES', path="icons") brushes = [ "border_mask", "border_hide", "box_trim", "line_project", ] import os for brush in...
jmobley0429/my_pie_menus
menus/sculpt_mode_pies.py
sculpt_mode_pies.py
py
3,776
python
en
code
1
github-code
36
[ { "api_name": "bpy.utils.system_resource", "line_number": 10, "usage_type": "call" }, { "api_name": "bpy.utils", "line_number": 10, "usage_type": "attribute" }, { "api_name": "bpy.app.icons.new_triangles_from_file", "line_number": 22, "usage_type": "call" }, { "ap...
7696440509
from django.conf.urls import patterns, include, url from .views import * urlpatterns = patterns('', url(r'^reservar/(?P<id>\d+)/$',Reservrlibros), url(r'^consultaLibos/$',ConsultaLibros.as_view(), name='ConsultaLibros'), url(r'^reservaExitosa/$',MostrarReservas), #url(r'^Verreservas/$',Verreservas), #url(r'^busq...
juanjavierlimachi/Biblioteca
Biblioteca/Biblioteca/apps/estudiantes/urls.py
urls.py
py
426
python
es
code
0
github-code
36
[ { "api_name": "django.conf.urls.patterns", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "djan...
33136179454
from telebot import types import telebot, wikipedia, re from config import * from base_bot import bot # Test-bot IDLE = 0 LISTENING_TO_COMMANDS = 2 bot_state = IDLE @bot.message_handler(commands=['test']) def start_message(message): markup = telebot.types.InlineKeyboardMarkup() markup.add(telebot.types.Inline...
TheGustOff/telegram_bot_gust_MUIV
test_bot.py
test_bot.py
py
1,635
python
en
code
0
github-code
36
[ { "api_name": "telebot.types.InlineKeyboardMarkup", "line_number": 13, "usage_type": "call" }, { "api_name": "telebot.types", "line_number": 13, "usage_type": "attribute" }, { "api_name": "telebot.types.InlineKeyboardButton", "line_number": 14, "usage_type": "call" }, ...
69822409383
# -*- coding: utf-8 -*- """Subclass of ``BasisSet`` designed to represent an OpenMX configuration.""" import collections import json import pathlib from typing import Sequence from importlib_resources import files from aiida_basis.data.basis import PaoData from ...metadata import openmx as openmx_metadata from ..mixin...
azadoks/aiida-basis
aiida_basis/groups/set/openmx.py
openmx.py
py
8,289
python
en
code
0
github-code
36
[ { "api_name": "collections.namedtuple", "line_number": 16, "usage_type": "call" }, { "api_name": "mixins.RecommendedOrbitalConfigurationMixin", "line_number": 19, "usage_type": "name" }, { "api_name": "basis.BasisSet", "line_number": 19, "usage_type": "name" }, { ...
72692974183
from ast import literal_eval import pymongo # Handles all interactions with the database class DbManager: database = None def __init__(self): # Client instantiation with the MongoDB Client self.client = pymongo.MongoClient( "mongodb+srv://gdp:gdp@propaganda.m00hm.mongodb.net/Tril...
madeleinemvis/original_gdp
BackEnd/functions/dbmanager.py
dbmanager.py
py
5,836
python
en
code
0
github-code
36
[ { "api_name": "pymongo.MongoClient", "line_number": 12, "usage_type": "call" }, { "api_name": "pymongo.errors", "line_number": 27, "usage_type": "attribute" }, { "api_name": "pymongo.errors", "line_number": 34, "usage_type": "attribute" }, { "api_name": "pymongo.e...
1141389329
from werkzeug.security import check_password_hash from db.SedmDb import SedmDB import datetime import os import json import re import pandas as pd import numpy as np import requests import glob import time from decimal import Decimal from bokeh.io import curdoc from bokeh.layouts import row, column from bokeh.models im...
scizen9/sedmpy
web/model.py
model.py
py
117,058
python
en
code
5
github-code
36
[ { "api_name": "pandas.options", "line_number": 29, "usage_type": "attribute" }, { "api_name": "pandas.set_option", "line_number": 33, "usage_type": "call" }, { "api_name": "scheduler.scheduler.ScheduleNight", "line_number": 72, "usage_type": "call" }, { "api_name"...
18039525483
from keras import layers,models,optimizers,losses from keras.datasets import cifar10 import tensorflow as tf import pandas as pd import matplotlib.pyplot as plt (X_train,y_train),(X_test,y_test)=cifar10.load_data() print(X_train.shape) print(y_train.shape) HIDDEN_SIZE=256#要有下划线 NUM_CLASSES=10#要有下划线避免语法...
westbchampion/Python_to_Kaggle
手写卷积神经网络_test.py
手写卷积神经网络_test.py
py
1,540
python
en
code
0
github-code
36
[ { "api_name": "keras.datasets.cifar10.load_data", "line_number": 9, "usage_type": "call" }, { "api_name": "keras.datasets.cifar10", "line_number": 9, "usage_type": "name" }, { "api_name": "keras.models.Sequential", "line_number": 16, "usage_type": "call" }, { "api...
7210833797
# -*- coding: utf-8 -*- from odoo import api, models, fields, registry import odoo from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT import json import logging _logger = logging.getLogger(__name__) class pos_call_log(models.Model): _rec_name = "call_model" _name = "pos.call.log" _description = "Log d...
mahmohammed16881688/odoo_12
addons/pos_retail/models/pos/pos_call_log.py
pos_call_log.py
py
3,733
python
en
code
1
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "odoo.models.Model", "line_number": 11, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 11, "usage_type": "name" }, { "api_name": "odoo.fields.Integ...
74936854824
from loguru import logger import configparser as cfg import os def logger_handler(msg: str, mode=2) -> None: """ Handles logging of messages mode: 0 = debug, 1 = info, 2 = error (default) """ # construct logger _log_constructor(mode) # log message if mode == 0: logger.excepti...
Anton0Lashov/dng_extractor
_logger.py
_logger.py
py
1,503
python
en
code
0
github-code
36
[ { "api_name": "loguru.logger.exception", "line_number": 17, "usage_type": "call" }, { "api_name": "loguru.logger", "line_number": 17, "usage_type": "name" }, { "api_name": "loguru.logger.info", "line_number": 19, "usage_type": "call" }, { "api_name": "loguru.logge...
19634743961
""" Usage: negotiator-cli [OPTIONS] GUEST_UNIX_SOCKET Communicate from a KVM/QEMU host system with running guest systems using a guest agent daemon running inside the guests. Supported options: -c, --list-commands List the commands that the guest exposes to its host. -e, --execute=COMMAND Execute the given ...
htrc/HTRC-DataCapsules
backend/tools/negotiator-cli/negotiator-cli.py
negotiator-cli.py
py
5,639
python
en
code
4
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 37, "usage_type": "call" }, { "api_name": "negotiator_common.NegotiatorInterface", "line_number": 39, "usage_type": "name" }, { "api_name": "socket.socket", "line_number": 52, "usage_type": "call" }, { "api_name": ...
5644011022
import agentpy as ap import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as colors import matplotlib.patches as mpatches import seaborn as sns def status_stackplot(data, ax): """Stackplot of people's condition over time.""" x = data.index.get_level_values("t") y = [data[var] for v...
jacob-evarts/energyshed-simulation
src/plots.py
plots.py
py
3,649
python
en
code
0
github-code
36
[ { "api_name": "numpy.polyfit", "line_number": 32, "usage_type": "call" }, { "api_name": "seaborn.set", "line_number": 50, "usage_type": "call" }, { "api_name": "numpy.polyfit", "line_number": 65, "usage_type": "call" }, { "api_name": "matplotlib.colors.ListedColor...
43965888115
import ast from django.db.models import Q from django.db import transaction from django.core.exceptions import ValidationError as DjangoValidationError from rest_framework.permissions import IsAuthenticated from rest_framework.exceptions import ValidationError from rest_framework.generics import ListAPIView from commo...
BharatPlutus/python-django-sample
services/views/service.py
service.py
py
16,111
python
en
code
0
github-code
36
[ { "api_name": "utils.views.service.ServiceListCreateMixin", "line_number": 27, "usage_type": "name" }, { "api_name": "services.models.service.Service.objects.all", "line_number": 33, "usage_type": "call" }, { "api_name": "services.models.service.Service.objects", "line_number...
26921480455
from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By from selenium import webdriver import time ''' 제가 실행하면 보이나요 python3 test.py 쳐보실래요?? 저만 실행 되나...
sinde530/python
interpark/test.py
test.py
py
4,841
python
en
code
0
github-code
36
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 25, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 25, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 28, "usage_type": "call" }, { "api...
29754454026
import sys from PyQt6 import QtCore, QtGui, QtWidgets from CurConUi import Ui_MainWindow from currency_converter import CurrencyConverter class CurrencyConv(QtWidgets.QMainWindow): def __init__(self): super(CurrencyConv, self).__init__() self.ui = Ui_MainWindow() self.ui.setupUi(self) ...
AdirtKa/CurrencyConverter
main.py
main.py
py
1,476
python
en
code
0
github-code
36
[ { "api_name": "PyQt6.QtWidgets.QMainWindow", "line_number": 7, "usage_type": "attribute" }, { "api_name": "PyQt6.QtWidgets", "line_number": 7, "usage_type": "name" }, { "api_name": "CurConUi.Ui_MainWindow", "line_number": 11, "usage_type": "call" }, { "api_name": ...
18065190929
from __future__ import absolute_import import logging import numpy as np from .import utils from .import sampling from sklearn.preprocessing import MultiLabelBinarizer, LabelBinarizer from sklearn.model_selection import StratifiedShuffleSplit logger = logging.getLogger(__name__) class Dataset(object): def _...
raghakot/keras-text
keras_text/data.py
data.py
py
4,007
python
en
code
422
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 32, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.Multi...
37538329416
import scrapy class CjSpider(scrapy.Spider): name = 'cj' # allowed_domains = ['caijing.com'] start_urls = ['https://www.dyxhw.com/'] def parse(self, response): typess = response.xpath('//div[@class="nav clearfix"]/a[@class="j_ch_nav _block_news_menu"]/@href').getall() for one_type in ...
ykallan/caijingguancha
caijingguancha/caijingguancha/spiders/cj.py
cj.py
py
1,497
python
en
code
0
github-code
36
[ { "api_name": "scrapy.Spider", "line_number": 4, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 13, "usage_type": "call" }, { "api_name": "scrapy.Request", "line_number": 19, "usage_type": "call" }, { "api_name": "scrapy.Request", ...
24011968546
# -------------------------------------------------------- # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- import numpy as np import os import sys from transforms3d.quaternions import * from transforms3d.euler import * from transforms3d.axangles imp...
liruiw/HCG
core/utils.py
utils.py
py
48,148
python
en
code
13
github-code
36
[ { "api_name": "numpy.array", "line_number": 54, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 57, "usage_type": "call" }, { "api_name": "pybullet_utils.bullet_client.BulletClient", "line_number": 85, "usage_type": "call" }, { "api_name": "pyb...
6043631950
from .dbtest import ( DbTest, dbconnect ) import os from psycopg2.extras import ( RealDictCursor, RealDictRow ) PATH_TO_SQL_DIR = os.path.abspath( os.path.join( os.path.dirname(__file__), "..", "sql" ) ) class TestExample(DbTest): @dbconnect def test_select_or...
HaithamKhedrSalem/postgis-practices-solution
test/test_example.py
test_example.py
py
6,115
python
en
code
0
github-code
36
[ { "api_name": "os.path.abspath", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
14183098505
import pygame import config import math from unit import Unit from unit_move import UnitMove class Enemy(Unit): def __init__(self, x, y): super().__init__(x, y) self.start_position = [x, y] self.time_till_damage = 0 self.look = [] # [center_x, center_y, rad...
EdySima/The-Lost-Penguin
enemy.py
enemy.py
py
4,317
python
en
code
0
github-code
36
[ { "api_name": "unit.Unit", "line_number": 8, "usage_type": "name" }, { "api_name": "math.hypot", "line_number": 21, "usage_type": "call" }, { "api_name": "unit_move.UnitMove.LEFT", "line_number": 24, "usage_type": "attribute" }, { "api_name": "unit_move.UnitMove",...
17354358336
import typing as t import numpy as np from emo_utils import convert_to_one_hot from emo_utils import predict from emo_utils import softmax from tensorflow.keras.layers import LSTM from tensorflow.keras.layers import Activation from tensorflow.keras.layers import Dense from tensorflow.keras.layers import Dropout from t...
HarryMWinters/ML_Coursework
Course 6, Sequence Models/Week 2/assignment_2/Emoji_v3a.py
Emoji_v3a.py
py
8,499
python
en
code
0
github-code
36
[ { "api_name": "typing.Any", "line_number": 18, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.ndarray", "line_number": 19, "usage_type": "attribute" }, { "api_name": "numpy.unique", "li...
9910221737
import subprocess import threading import io from fcntl import fcntl, F_GETFL, F_SETFL from os import O_NONBLOCK import sys #from flask_socketio import SocketIO command = "pintos -v -k --qemu --disk cs162proj.dsk -- -q run shell" class Shell(): def set_flags(self, pipe): flags = fcntl(pipe, F_GETFL) ...
dietd/webpintos
shell.py
shell.py
py
1,345
python
en
code
0
github-code
36
[ { "api_name": "fcntl.fcntl", "line_number": 13, "usage_type": "call" }, { "api_name": "fcntl.F_GETFL", "line_number": 13, "usage_type": "argument" }, { "api_name": "fcntl.fcntl", "line_number": 14, "usage_type": "call" }, { "api_name": "fcntl.F_SETFL", "line_n...
38488846369
#!/usr/bin/env python3 # # 10. Bayesian History Matching technique (advanced use) # import os from pathlib import Path import matplotlib.pyplot as plt import numpy as np import json from GPErks.constants import DEFAULT_TMP_OUTFILE_DIR from GPErks.perks.history_matching import Wave from GPErks.serialization.labels imp...
stelong/GPErks
examples/example_10.py
example_10.py
py
9,883
python
en
code
3
github-code
36
[ { "api_name": "GPErks.log.logger.get_logger", "line_number": 33, "usage_type": "call" }, { "api_name": "GPErks.utils.random.set_seed", "line_number": 35, "usage_type": "call" }, { "api_name": "GPErks.serialization.path.posix_path", "line_number": 38, "usage_type": "call" ...
41191349576
import sys sys.path.append('../../preprocess') from make_pca import load_landmarks import numpy as np import tensorflow as tf from pfld import predict_landmarks as pfld_predict_landmarks from pfld_custom import predict_landmarks as pfld_custom_predict_landmarks from skimage.color import rgb2gray import cv2 import dlib ...
vuamitom/shapenet-tensorflow
model/pfld/eval_pfld.py
eval_pfld.py
py
11,142
python
en
code
1
github-code
36
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "matplotlib.use", "line_number": 20, "usage_type": "call" }, { "api_name": "prepare_data.IMAGE_SIZE", ...
38031979552
import click from .core import NmapReportParser, NmapReport, CSVFileParser, JsonOutput, BateaModel, MatrixOutput from defusedxml import ElementTree from xml.etree.ElementTree import ParseError from batea import build_report import warnings warnings.filterwarnings('ignore') @click.command(context_settings=dict(help_op...
delvelabs/batea
batea/__main__.py
__main__.py
py
3,254
python
en
code
287
github-code
36
[ { "api_name": "warnings.filterwarnings", "line_number": 7, "usage_type": "call" }, { "api_name": "batea.build_report", "line_number": 25, "usage_type": "call" }, { "api_name": "core.CSVFileParser", "line_number": 26, "usage_type": "call" }, { "api_name": "core.Nma...
13823383640
import numpy as np import matplotlib.pyplot as plt from shapely import geometry from numpy.linalg import norm from random import * import pickle def reach_set_calc(x_val, reach_range): """ :type x_val: list :type reach_range: float :return: reach_set: Polygon Description: With given x and reach_ra...
DRK98519/aCBC
game_play.py
game_play.py
py
36,021
python
en
code
0
github-code
36
[ { "api_name": "shapely.geometry.Point", "line_number": 17, "usage_type": "call" }, { "api_name": "shapely.geometry", "line_number": 17, "usage_type": "name" }, { "api_name": "shapely.geometry.Point", "line_number": 18, "usage_type": "call" }, { "api_name": "shapel...
35396451951
#!/usr/bin/env python3 # coding=utf-8 '''MDMForm 系统配置主窗口''' import os import sys from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtGui import QPalette, QPixmap, QIcon from PyQt5.QtWidgets import QMainWindow,QMessageBox,QTableWidgetItem,QFileDialog from PyQt5 import QtSql from PyQt5.QtSql import QSqlQuery f...
LeeZhang1979/UniTools
src/MDMForm.py
MDMForm.py
py
19,446
python
en
code
0
github-code
36
[ { "api_name": "warnings.filterwarnings", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path.abspath"...
32041540540
import torch import drjit as dr import mitsuba as mi import sys,os,json import importlib sys.path.append(".") import cv2 import numpy as np if torch.cuda.is_available(): device = torch.device("cuda:0") torch.cuda.set_device(device) else: device = torch.device("cpu") from utils.logger import Logger from util...
jkxing/EPSM_Mitsuba3
EPSM/optim.py
optim.py
py
5,566
python
en
code
4
github-code
36
[ { "api_name": "sys.path.append", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.cuda.is_available", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.cuda", "...
4517993066
import os from django.contrib.auth.views import redirect_to_login from chat.models import * from django.db.models.query_utils import Q from notification.models import * from user.models import * from post.models import * from post.forms import * from group.models import * from django.shortcuts import redirect, render f...
longnp030/SocialNetwork-Py
tomo/views.py
views.py
py
6,784
python
en
code
1
github-code
36
[ { "api_name": "django.shortcuts.redirect", "line_number": 24, "usage_type": "call" }, { "api_name": "django.urls.reverse", "line_number": 24, "usage_type": "call" }, { "api_name": "django.db.models.query_utils.Q", "line_number": 26, "usage_type": "call" }, { "api_...
41744416176
from st7920 import ST7920 from random import randint from time import sleep import curses import collections SCALE = 4 WIDTH = 128/SCALE HEIGHT = 64/SCALE score = 0 alive = True s = ST7920() def newfoodpos(): return [randint(0,WIDTH-1), randint(0,HEIGHT-1)] def update(): global headpos, foodpo...
JMW95/RaspiLCDGames
snake.py
snake.py
py
2,499
python
en
code
3
github-code
36
[ { "api_name": "st7920.ST7920", "line_number": 14, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 17, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 67, "usage_type": "call" }, { "api_name": "curses.KEY_RIGHT", "line_...
42243521560
import numpy as np import matplotlib.pyplot as plt import bead_util as bu import scipy.signal as ss path = "/data/20180927/bead1/spinning/50s_monitor_5min_gaps" files = bu.find_all_fnames(path) index = 0 fdrive = 1210.7 bw = 0.5 bwp = 5. Ns = 250000 Fs = 5000. k = 1e-13*(2.*np.pi*370.)**2 df = bu.DataFile() df.load(f...
charlesblakemore/opt_lev_analysis
scripts/spinning/old_scripts/inst_amp_phase_plot.py
inst_amp_phase_plot.py
py
1,852
python
en
code
1
github-code
36
[ { "api_name": "bead_util.find_all_fnames", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 14, "usage_type": "attribute" }, { "api_name": "bead_util.DataFile", "line_number": 16, "usage_type": "call" }, { "api_name": "scipy.signa...
17285744603
from abc import ABCMeta, abstractmethod import subprocess import io from logging import Logger class Action(metaclass=ABCMeta): def __init__(self, action_id, job, **kwargs): self.id = action_id self.job = job @abstractmethod def to_text(self, logger: Logger) -> str: pass class T...
SuperH-0630/HelloEmail
action.py
action.py
py
1,587
python
en
code
0
github-code
36
[ { "api_name": "abc.ABCMeta", "line_number": 7, "usage_type": "name" }, { "api_name": "logging.Logger", "line_number": 13, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 12, "usage_type": "name" }, { "api_name": "logging.Logger", "li...
7619783575
import time from pathlib import Path import torch import torch.nn as nn from torch.optim import RMSprop, Adam from torch.optim.lr_scheduler import ReduceLROnPlateau from .evaluate import evaluate from .logger import print_logger def train_net(net, dataloaders, device, resul...
kimjh0107/2022_Rayence_Medical_Image_processing
src/train.py
train.py
py
3,042
python
en
code
0
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 16, "usage_type": "name" }, { "api_name": "time.time", "line_number": 27, "usage_type": "call" }, { "api_name": "logger.print_logger", "line_number": 30, "usage_type": "call" }, { "api_name": "torch.optim.RMSprop", ...
41673811681
import os import shutil from object2urdf import ObjectUrdfBuilder from cleanup_tools import get_immediate_subdirectories import argparse import shapenet from glob import glob import point_cloud_utils as pcu import numpy as np import trimesh def as_mesh(scene_or_mesh): # Utils function that returns a mesh from a t...
dexterousrobot/obj_urdfs
obj_urdfs/build_shapenet_urdfs.py
build_shapenet_urdfs.py
py
4,788
python
en
code
2
github-code
36
[ { "api_name": "trimesh.Scene", "line_number": 15, "usage_type": "attribute" }, { "api_name": "trimesh.util.concatenate", "line_number": 16, "usage_type": "call" }, { "api_name": "trimesh.util", "line_number": 16, "usage_type": "attribute" }, { "api_name": "trimesh...
73915422185
from flask import Flask, request import base64 from PIL import Image from preprocess4 import Pr1 from preprocess2 import test_transforms import torch from torchvision import models import torch.nn as nn import numpy as np import cv2 def get_net(): finetune_net = nn.Sequential() finetune_net.features = models.r...
Moezwalha/Alphabet-SL_Prediction_Service
app.py
app.py
py
2,494
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Sequential", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torchvision.models.resnet18", "line_number": 14, "usage_type": "call" }, { "api_name": "torchvision....
24888015371
from typing import Iterable import torch import numpy as np from scipy.spatial.distance import cdist from tqdm import tqdm import ot def cost_matrix( data: np.ndarray, cost: str = 'correlation', normalize_features: bool = True) -> np.ndarray: """Compute an empirical ground cost matrix, i.e. a pairwise distance m...
cantinilab/OT-scOmics
src/otscomics/__init__.py
__init__.py
py
5,668
python
en
code
31
github-code
36
[ { "api_name": "numpy.ndarray", "line_number": 9, "usage_type": "attribute" }, { "api_name": "scipy.spatial.distance.cdist", "line_number": 29, "usage_type": "call" }, { "api_name": "scipy.spatial.distance.cdist", "line_number": 31, "usage_type": "call" }, { "api_n...
36168624616
from enum import Enum, auto from pathlib import Path import numpy as np import pandas as pd import pendulum import pytest from whatsappnalysis.lib.custom_types import ChatDataset, Schema from whatsappnalysis.lib.data_loader import WhatsappLoader class TestWhatsappLoader: """ Tests for ChatDataset """ test_c...
lbartell/whatsappnalysis
tests/test_lib/test_data_loader/test_whatsapp_loader.py
test_whatsapp_loader.py
py
3,175
python
en
code
0
github-code
36
[ { "api_name": "pandas.DataFrame.from_dict", "line_number": 24, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 24, "usage_type": "attribute" }, { "api_name": "pendulum.parse", "line_number": 35, "usage_type": "call" }, { "api_name": "pendu...
32505694658
import streamlit as st # import pandas as pd import numpy as np import pydeck as pdk import plotly.express as px from ParserXML import * from ConverterToHTML import * from VisualTools import * __all__ = [st, pd, np, pdk, px] DATE_TIME = "date/time" local_path = "" file_name = "Datasets/50k_cleaned_from_xml.csv" DATA_...
StopFuture/AnalyzerXML
AnalyzerXML.py
AnalyzerXML.py
py
4,533
python
en
code
1
github-code
36
[ { "api_name": "plotly.express", "line_number": 10, "usage_type": "name" }, { "api_name": "streamlit.title", "line_number": 17, "usage_type": "call" }, { "api_name": "streamlit.markdown", "line_number": 20, "usage_type": "call" }, { "api_name": "streamlit.markdown"...
32568853073
# -*- coding: utf-8 -*- from logbook import Logger import numpy as np import pandas as pd from zipline.data.bundles import register from zipline.utils.calendars import get_calendar EXPORT_FOLDER = '/mnt/data/earnings_calls/export/' log = Logger('zipline_ingest.py') def bundle_hf_data(price_file, debug = False)...
olgsfrt/earningscall
backtest/zipline_ingest.py
zipline_ingest.py
py
4,373
python
en
code
0
github-code
36
[ { "api_name": "logbook.Logger", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.read_hdf", "line_number": 34, "usage_type": "call" }, { "api_name": "pandas.Timedelta", "line_number": 68, "usage_type": "call" }, { "api_name": "zipline.utils.calenda...
3600506632
import cv2 img = cv2.imread("sample1.png") cv2.imwrite("sample2.png", img) img2 = cv2.imread("sample2.png") grayImg = cv2.cvtColor(img2, cv2.COLOR_BGR2GRAY) cv2.imshow("Gray", grayImg) cv2.waitKey(0) cv2.destroyAllWindows()
rohith274/AiGuide
AI/Day1/ReadImage.py
ReadImage.py
py
226
python
en
code
0
github-code
36
[ { "api_name": "cv2.imread", "line_number": 3, "usage_type": "call" }, { "api_name": "cv2.imwrite", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 6, ...
36830649760
# To add a new cell, type '# %%' # To add a new markdown cell, type '# %% [markdown]' # %% [markdown] # # SciKitLearn 机器学习库 # - VScode中, `ctrl + /` 快速注释代码 # %% # Sklearn 通用的学习模式 # 案例1. 本例鸢尾花数据集,使用KNN模块实现分类 import numpy as np from sklearn import datasets # from sklearn.cross_validation import train_test_split # cross...
oca-john/Python3-xi
Python3-ipynb/py3.sklearn.py
py3.sklearn.py
py
7,841
python
zh
code
0
github-code
36
[ { "api_name": "sklearn.datasets.load_iris", "line_number": 17, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 17, "usage_type": "name" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 27, "usage_type": "call" }, { ...
5515751660
import yaml class Config: def __init__(self): self.load_model_epochs = None self.debug = None self.n_epochs = None self.load_g_model_score = None self.load_d_model_score = None self.model_no = None self.batch_size = None self.n_split = None se...
spider-man-tm/pix2pix_gray_to_color
config/config.py
config.py
py
2,313
python
en
code
3
github-code
36
[ { "api_name": "yaml.load", "line_number": 25, "usage_type": "call" }, { "api_name": "yaml.SafeLoader", "line_number": 25, "usage_type": "attribute" }, { "api_name": "yaml.load", "line_number": 57, "usage_type": "call" }, { "api_name": "yaml.SafeLoader", "line_...
41245539467
from pynvml import * import logging from datasets import load_dataset from datasets import ClassLabel from transformers import LukeTokenizer, LukeModel, LukeForEntityPairClassification, TrainingArguments, Trainer import torch from tqdm import trange # construir função que converta spans de relativos a frase para globa...
joseMalaquias/tese
DOCRED/classic_obtainJSON.py
classic_obtainJSON.py
py
17,283
python
en
code
0
github-code
36
[ { "api_name": "torch.utils", "line_number": 20, "usage_type": "attribute" }, { "api_name": "torch.tensor", "line_number": 27, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 168, "usage_type": "call" }, { "api_name": "random.choice", "lin...
4393844283
# 클레어와 물약 # r1 x # https://www.acmicpc.net/problem/20119 # https://welog.tistory.com/256 import sys from collections import deque input = sys.stdin.readline n, m = map(int, input().split()) graph = [set() for _ in range(n + 1)] recipe_dict = {} for _ in range(m): data = list(map(int, input().split())) if d...
sjjam/Algorithm-Python
baekjoon/20119.py
20119.py
py
1,292
python
en
code
0
github-code
36
[ { "api_name": "sys.stdin", "line_number": 9, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 35, "usage_type": "call" } ]
18347648906
import pandas as pd import numpy as np import plotly.graph_objects as go from plotly.subplots import make_subplots import plotly.io as pio from matplotlib import cm # set defaults for charts pio.templates.default = "plotly_white" @np.vectorize def calculate_tax(income): brackets = [9950, 40525, 86375, 164925, 209...
robert-sturrock/financial-projections
financial_projections.py
financial_projections.py
py
5,578
python
en
code
0
github-code
36
[ { "api_name": "plotly.io.templates", "line_number": 9, "usage_type": "attribute" }, { "api_name": "plotly.io", "line_number": 9, "usage_type": "name" }, { "api_name": "numpy.vectorize", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pandas.DataFram...
10731341714
from os.path import isfile import json from db import normalize from itertools import product class Settings: def __init__(self, user_id): self.user_id = user_id self.search = {} self.match = [] @staticmethod def from_dict(settings: dict) -> tuple: return ( se...
rychanya/vkinder
src/vkinder/settings.py
settings.py
py
3,811
python
en
code
0
github-code
36
[ { "api_name": "os.path.isfile", "line_number": 30, "usage_type": "call" }, { "api_name": "json.load", "line_number": 33, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 39, "usage_type": "call" }, { "api_name": "db.normalize.normalize", "line...
29382149888
import json import boto3 from botocore.exceptions import ClientError import os region = os.environ['AWS_REGION'] sess = boto3.session.Session(region_name=region) # def get_bucket_name(): # ssmClient = sess.client('ssm') # response = ssmClient.get_parameter( # Name = 'ProserveProject_S3BucketName',...
ferozbaig96/Proserve-project
lambdas/DeleteS3Object.py
DeleteS3Object.py
py
1,191
python
en
code
0
github-code
36
[ { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "api_name": "boto3.session.Session", "line_number": 7, "usage_type": "call" }, { "api_name": "boto3.session", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.environ", ...
20049305182
import numpy as np import cv2 from scipy import ndimage, interpolate def track(I, J, input_points, total_points, window=(21, 21), min_disp=0.01): output = [] I_gray = cv2.cvtColor(I, cv2.COLOR_BGR2GRAY) J_gray = cv2.cvtColor(J, cv2.COLOR_BGR2GRAY) #normalization I_norm = I_gray/I_gray.max() ...
ocinemod87/Advanced_Topics_Image_Analysis
Assignment_1/Assignment_1.py
Assignment_1.py
py
4,477
python
en
code
0
github-code
36
[ { "api_name": "cv2.cvtColor", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 9, "usage_type": "attribute" }, { "api_name": "cv2.cvtColor", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", ...
30876684301
# This is necessary to find the main code import operator import sys from Bomberman.bomberman.entity import MonsterEntity from Bomberman.bomberman.sensed_world import SensedWorld sys.path.insert(0, '../bomberman') # Import necessary stuff from entity import CharacterEntity from colorama import Fore, Back from queue i...
ifeeney/CS4341-projects
Bomberman/group10/testcharacter.py
testcharacter.py
py
20,664
python
en
code
0
github-code
36
[ { "api_name": "sys.path.insert", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "entity.CharacterEntity", "line_number": 17, "usage_type": "name" }, { "api_name": "math.inf", "li...
38930582027
import torch from torch import nn def conv_block(in_channel, channel, kernel_size=3, stride=1, padding=1, inplace=False): norm = nn.InstanceNorm2d return nn.Sequential( nn.Conv2d(in_channel, channel, kernel_size=kernel_size, stride=stride, padding=padding, bias=True), norm(channel, affine=True,...
QiliangFan/Drive
models/resnetx.py
resnetx.py
py
2,452
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.InstanceNorm2d", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.nn", ...
2063152797
from flask import Flask, render_template, redirect, url_for, flash, request, Blueprint, abort from flask_login import LoginManager, current_user, login_user, logout_user, login_required from flask_migrate import Migrate from werkzeug.urls import url_parse from models import * from forms import * from flask_admin ...
Dimmj/market12
market/app.py
app.py
py
4,672
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 16, "usage_type": "call" }, { "api_name": "flask_migrate.Migrate", "line_number": 24, "usage_type": "call" }, { "api_name": "flask_login.LoginManager", "line_number": 25, "usage_type": "call" }, { "api_name": "flask.rend...
31243963609
import argparse import datetime import pycloudlib CI_DEFAULT_TAG = "uaclient" def get_parser(): parser = argparse.ArgumentParser() parser.add_argument( "-t", "--tag", dest="tag", action="store", default=CI_DEFAULT_TAG, help=( "Tag to determine which instances will be dele...
canonical/server-test-scripts
ubuntu-advantage-client/gcp_cleanup.py
gcp_cleanup.py
py
3,138
python
en
code
8
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "pycloudlib.GCE", "line_number": 49, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 63, "usage_type": "call" }, { "api_name": "dat...
28657759948
from torchvision import transforms from torch.utils.data import dataset, dataloader from torchvision.datasets.folder import default_loader from utils.RandomErasing import RandomErasing from utils.RandomSampler import RandomSampler from opt import opt import glob import pandas as pd import numpy as np import os.path as ...
DavisonHu/AICity-track2-Re-id
loader/Evaluation_AICity_data.py
Evaluation_AICity_data.py
py
4,017
python
en
code
1
github-code
36
[ { "api_name": "torchvision.transforms.Compose", "line_number": 16, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 16, "usage_type": "name" }, { "api_name": "torchvision.transforms.Resize", "line_number": 17, "usage_type": "call" }, { ...