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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
39457474627 | import argparse
import importlib
import json
import os
import pathlib
from pymo.writers import BVHWriter
from srf_reference_implementations.interfaces.transcripts import GeneaTranscript
from srf_reference_implementations.interfaces.marshalling import mocap_data_to_json
def main() -> None:
parser = argparse.Argum... | TomKingsfordUoA/social-reward-function-reference-implementations | srf_reference_implementations/cli.py | cli.py | py | 3,989 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "os.path.i... |
6714635914 | # bibliotecas necessarias
import pandas as pd
import numpy as np
from sklearn.model_selection import cross_validate, cross_val_score
from sklearn.feature_selection import VarianceThreshold
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.neighbors impo... | dudinhadnm/CMI104Projeto | cross_validation.py | cross_validation.py | py | 4,005 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "random.seed",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
... |
555232623 | from django.shortcuts import render
from django import forms
from django.http import HttpResponseRedirect
from django.urls import reverse
import re
import random
import markdown2
from . import util
# Form to add a new encyclopedia page
class newPageForm(forms.Form):
title = forms.CharField(label="", widget=forms.... | lucascorumba/cs50-web | wiki/encyclopedia/views.py | views.py | py | 3,519 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.forms.Form",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.for... |
38593029501 | import math
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
np.set_printoptions(threshold=np.inf)
# Low- and High-Dim distance getters
def get_matrix_pca_dists():
low_dim_points = np.arange(0.01, 0.5, 0.01)
low_dim_points = np.expand_dims(low_dim_points, 1)
low_dim_dists = get_pairwise... | Andrew-Draganov/GiDR-DUN | GDR/experiment_utils/grad_analysis.py | grad_analysis.py | py | 11,214 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "numpy.arange",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.expand_dims",
... |
17622316914 | from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponseRedirect
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.decorators import login_required
from django.contrib.auth import login, authenticate, logout
from .forms import SignupForm,Update... | p-koskey/mtaani | hood/views.py | views.py | py | 4,844 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.shortcuts.render",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.decorators.login_required",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "forms.SignupForm",
"line_number": 16,
"usage_type": "call"
},
{... |
14769109062 | #!/usr/bin/python
import sys
import heapq
import xml.etree.ElementTree as ET
h = []
counter = 0
for line in sys.stdin:
line = ET.fromstring(line.strip()).attrib
if line["PostTypeId"] == "1":
count = int(line["ViewCount"])
if counter < 10:
heapq.heappush(h, (count, line["Id"]))
... | patchgreen99/extreme_ass2 | task2/mapper.py | mapper.py | py | 528 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.stdin",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "xml.etree.ElementTree.fromstring",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": ... |
18148340857 | import tempfile
try:
# new location for sip
# https://www.riverbankcomputing.com/static/Docs/PyQt5/incompatibilities.html#pyqt-v5-11
from PyQt5 import sip
except ImportError:
import sip
sip.setapi('QDate', 2)
sip.setapi('QDateTime', 2)
sip.setapi('QString', 2)
sip.setapi('QTextStream', 2)
sip.setapi('QT... | Fluorescence-Tools/quest | quest/quest_gui.py | quest_gui.py | py | 1,130 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sip.setapi",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sip.setapi",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sip.setapi",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sip.setapi",
"line_number": 11,
... |
31465460320 | import json
from shutil import rmtree
from unittest.util import safe_repr
import jsonschema
from django.conf import settings
from django.test.testcases import TestCase as BaseTestCase
from mixer.backend.django import mixer
from rest_framework.test import APITestCase as BaseAPITestCase
from commons.tests.faker import ... | arturgoms/billogram-challenge | src/commons/tests/base.py | base.py | py | 5,342 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "django.test.testcases.TestCase",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "commons.tests.faker.faker",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "mixer.backend.django.mixer",
"line_number": 22,
"usage_type": "name"
},
{
... |
20117727518 | # Chinese Remainder theorem from:
# https://rosettacode.org/wiki/Chinese_remainder_theorem#Python_3.6
from functools import reduce
def chinese_remainder(n, a):
sum = 0
prod = reduce(lambda a, b: a * b, n)
for n_i, a_i in zip(n,a):
p = prod // n_i # Modified to return an int
sum += a_i * mu... | rubengrootroessink/AdventOfCode | 2020/13/2.py | 2.py | py | 1,159 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "functools.reduce",
"line_number": 8,
"usage_type": "call"
}
] |
14983924476 | #
# Model Training and Dumping for use on another app
#
import numpy as np
import pandas as pd
from sklearn.neighbors import KNeighborsClassifier
path = 'data/appdata.csv'
train = pd.read_csv(path, sep=',')
# remove the time and category
del train['time']
del train['category']
# place the label on a different ... | cadrev/smart-home-appliance-recognition | model_training/model_training.py | model_training.py | py | 648 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.neighbors.KNeighborsClassifier",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sklearn.externals.joblib.dump",
"line_number": 32,
"usage_type": "call"
},
{
... |
18210022562 | from django.shortcuts import render
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.db import transaction
from django.http import HttpResponseRedirect, HttpResponse, JsonResponse, Htt... | Paulsqapp/Excel-Upload-to-Django-Models-the-Easy-way-updated | excelupload/core/views.py | views.py | py | 4,798 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.contrib.auth.mixins.LoginRequiredMixin",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.mixins.UserPassesTestMixin",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "django.views.generic.edit.CreateView",
"line_num... |
71002159734 | # -*- coding: utf-8 -*-
import json
from db.mall import models as mall_models
from behave import *
from features.util import bdd_util
from features.util.helper import WAIT_SHORT_TIME
import steps_db_util
import logging
@then(u"{user}能获取订单")
def step_impl(context, user):
db_order = steps_db_util.get_latest_order()
... | chengdg/apiserver | features/steps/mall_order_steps.py | mall_order_steps.py | py | 6,905 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "steps_db_util.get_latest_order",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "features.util.bdd_util.assert_dict",
"line_number": 23,
"usage_type": "call"
},
{
"api_... |
28546153964 | import os
import json
import random
from PIL import Image
import matplotlib.pyplot as plt
from PIL import Image, ImageDraw, ImageFont
import matplotlib.pyplot as plt
import pylab
from pycocotools.coco import COCO
import numpy as np
random_num = 5
# read test result
test_path = "/liu/code/d2l-zh/pycharm-local/faster_rc... | echo233/mmdetection | faster_rcnn/validation_icme.py | validation_icme.py | py | 1,783 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
... |
2602650800 | from dns import resolver,reversename
import time
import glob
startTime = time.time()
def getip():
tmpIPS = []
path = "./Data/*ipINFO"
for filename in glob.glob(path):
with open(filename, 'r', encoding='utf8') as f:
for i in f:
ip = i.replace('\n', '')
if ip not in tmpIPS:
tmpIPS.append(i... | LouisXVBTW/FORIN-COWRIE | Data/rDNS.py | rDNS.py | py | 853 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "time.time",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "dns.resolver.query",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "dns.resolver",
"line_number"... |
25765831836 | #!/usr/bin/env python3
import re
import enum
import os
SAMPLE_SIZE = 500
EMPTY_RE = r"\s*>"
BOOL_RE = r"(\s)*(0|1)(\s)*>"
INT_RE = r"(\s)*(-|\+)?\d*(\s)*>"
FLOAT_RE = r"(\s)*(-|\+)?\d*\.?\d*(\s)*>"
STRING_RE = r"(\s)*(?:(?!>)(\S))*(\s)*>"
STRING_RE_QUOTES = r"(\s)*\"(?:(?!>).)*\"(\s)*>"
class Types(enum.Enum):
e... | oriasm/swdev-assignment1 | part1/sorer_helper.py | sorer_helper.py | py | 5,042 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "enum.Enum",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "re.match",
"line_number": 96,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 100,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 104,
... |
7905722012 | import requests
import spotipy
from bs4 import BeautifulSoup
from spotipy.oauth2 import SpotifyOAuth
billboard_url = "https://www.billboard.com/charts/hot-100/"
Client_ID = "Client ID"
Client_Secret = "Client Secret"
redirect_URI = "http://example.com"
date = input("Which year do you want?Type the date in t... | Phurinsri/Top-Playlist-musical | main.py | main.py | py | 1,826 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "spotipy.oauth2.SpotifyOAuth",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "spotipy.oa... |
28479398843 | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import print_function
from six.moves import range
usage = \
"""
Reads in ULTRACAM/SPEC raw data files and writes out to FITS files. The
output files can be one per exposure, or in the case of multi-CCD formats, one
per CCD per exposure. """... | trmrsh/trm-ultracam | scripts/tofits.py | tofits.py | py | 11,294 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
... |
20542820327 | #!/usr/bin/python
"""
Unittests
http://stackoverflow.com/questions/4904096/whats-the-difference-between-unit-functional-acceptance-and-integration-test
"""
import unittest
import importlib
import os
import GoogleScraper
import configparser
class ConfigTest(unittest.TestCase):
"""Test the three different levels o... | sih4sing5hong5/GoogleScraper | tests/tests.py | tests.py | py | 1,903 | python | en | code | null | github-code | 21 | [
{
"api_name": "unittest.TestCase",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "importlib.reload",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "Goo... |
71126311732 | #! /usr/bin/env python3
import argparse
import difflib
import filecmp
import glob
import os
import subprocess
import sys
# Test convert4qmc for GAMESS output files
# Each test directory contains
# *.inp - Gamess input file. Not strictly necessary for this test, but useful for reproducing the run
# *.out - Gamess ou... | QMCPACK/qmcpack | tests/converter/converter_test.py | converter_test.py | py | 6,442 | python | en | code | 261 | github-code | 21 | [
{
"api_name": "filecmp.cmp",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "difflib.unified_diff",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
... |
15336335991 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import unittest
class NewVisitorTest(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
self.browser.implicitly_wait(3)
#def tearDown(self):
#self.browser.quit()
def test_can_start_notetaker_and_retireve_log... | valllichidambaram/clinic | functional_tests3.py | functional_tests3.py | py | 1,140 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "unittest.TestCase",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "sel... |
30502367690 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import datetime
import myapp.models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('myapp', '0001_initial'),
]
operations = [
migratio... | AkshataGutti/Projectgit | Projects/myapp/migrations/0002_board_thumbnail.py | 0002_board_thumbnail.py | py | 601 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AddField",
"line_number": 17,
"usage_type": "call"
},
{... |
32078688780 | import scrapy
import json
import datetime
import re
class GoveestatsInstallationsSpider(scrapy.Spider):
name = 'goveestats-installations'
#allowed_domains = ['analytics.home-assistant.io']
start_urls = ['https://analytics.home-assistant.io/custom_integrations.json']
def parse(self, response):
... | LaggAt/actions | goveestats_installations.py | goveestats_installations.py | py | 970 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "scrapy.Spider",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"li... |
20006272830 | import random
import math
import matplotlib.pyplot as plt
length = 10
shots = 10000
hits = 0.0
def shoot(squareLength) :
return random.random() * squareLength, random.random() * squareLength
for i in range(shots) :
x, y = shoot(length)
distance = math.sqrt(x*x+y*y)
if distance <= leng... | volv/volv.org | shootpi.py | shootpi.py | py | 564 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "random.random",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",... |
1283579540 | #------------------------------------------------------------------------------
#
# Edge Detection Demo
#
# This script will detect prominent edges in the video stream of a connected
# camera. Execute the script from the command line prompt [$] as shown below:
#
# ~/demos $ python module-4-demo-edge-detection.py
#
#... | kromydas/STEM-Kit | demos/module-4-demo-edge-detection.py | module-4-demo-edge-detection.py | py | 2,300 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FRAME_WIDTH",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name":... |
13413588645 | """cache.py"""
import asyncio
from datetime import timedelta
from functools import partial, update_wrapper, wraps
from http import HTTPStatus
from typing import Union
from fastapi import Response
from fastapi_redis_cache.client import FastApiRedisCache
from fastapi_redis_cache.util import (
deserialize_json,
... | a-luna/fastapi-redis-cache | src/fastapi_redis_cache/cache.py | cache.py | py | 4,560 | python | en | code | 128 | github-code | 21 | [
{
"api_name": "typing.Union",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "fastapi_redis_cache.util.ONE_YEAR_IN_SECONDS",
"line_number": 22,
"usage_type": "name"
},
{
"api_... |
71815228534 | from __future__ import print_function
import matplotlib
matplotlib.use('Agg')
import argparse
import pickle as pkl
import math
import sys
import json
import os
import re
from time import time
from os.path import dirname, join, exists
from collections import OrderedDict, defaultdict
import torch
from torch import opt... | ChenRocks/image_captioning | main.py | main.py | py | 11,667 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "matplotlib.use",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional.cross_... |
3123668833 | from itertools import chain
import numpy
from veles import error
from veles.loader.base import LoaderMSEMixin, TARGET
from veles.loader.image import ImageLoader
from veles.loader.file_image import FileImageLoader
class ImageLoaderMSEMixin(LoaderMSEMixin):
hide_from_registry = True
"""
Implementation of I... | Samsung/veles | veles/loader/image_mse.py | image_mse.py | py | 4,167 | python | en | code | 903 | github-code | 21 | [
{
"api_name": "veles.loader.base.LoaderMSEMixin",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "veles.loader.base.TARGET",
"line_number": 29,
"usage_type": "argument"
},
{
"api_name": "veles.error.BadFormatError",
"line_number": 32,
"usage_type": "call"
},
... |
37169312204 | import numpy as np
import math
import matplotlib.pyplot as plt
x_train = np.array([1.0, 1.7, 2.0, 2.5, 3.0, 3.2])
y_train = np.array([250, 300, 480, 430, 630, 730])
#Function to calculate the cost
def compute_cost(x, y, w, b):
m = x.shape[0]
cost = 0
for i in range(m):
f_wb = w * x[i] + b... | Ziyu-Tian/Codes | Codes/Python/gradientDescent/main.py | main.py | py | 3,696 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "numpy.array",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_... |
34675935062 | from bs4 import ResultSet
def extract_tags(divs: ResultSet[str]) -> list[str]:
"""Loops through a ResultSet of div tags and returns data about matches.
:param divs: A ResultSet of div tags to be looped through
:return: A list of data about matches
"""
match_data: list[str] = []
for tag in di... | TheAlchemyIndex/sports-results-scraper | srs/premiership/main/wikipedia/scraper/pageHtml/TagExtractor.py | TagExtractor.py | py | 700 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "bs4.ResultSet",
"line_number": 4,
"usage_type": "name"
}
] |
20114389401 | from hyperopt import STATUS_OK,hp,tpe,Trials,fmin
from hyperopt.pyll import scope
import numpy as np
tabnet_large_space={
"lookahead": hp.choice("lookahead",[False,True]),
"optimizer": hp.choice('optimizer',[
{
"opttype":"Adam",
"wd":hp.loguniform('wdadam', np.log(0.0001), np.l... | erudic/mt-tabnet-xgboost-model-comparison | model_trainer/tabnet/spaces.py | spaces.py | py | 943 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "hyperopt.hp.choice",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "hyperopt.hp",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "hyperopt.hp.choice",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "hyperopt.hp",
"lin... |
1740893165 | from secrets import choice
from tqdm import tqdm
import os
import json
from functools import partial
import argparse
import torch
import torchvision
from datetime import datetime
import numpy as np
from cfg import DefaultConfig
from dataset import get_dataset
from models import get_model
from util impo... | stevebottos/gans | train.py | train.py | py | 4,969 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.dump",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "torch.optim.Adam",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "torch.optim",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "cfg.g_lr",
"line_numb... |
10915138072 | # forward greedy search with feature cluster
import numpy as np
import torch
from train_utils import timeit
# @timeit
def get_predictions(model, valids, repeat, masks, njobs=20):
n = valids[0].shape[0]
data = []
for mask in masks:
data.append(np.hstack([valids[int(mask[i])][:,i].reshape(-1, 1)
... | marrvolo/HSAV | src/feature_selection_sup.py | feature_selection_sup.py | py | 3,435 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "numpy.hstack",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.vstack",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.nn.BCELoss",
"line_nu... |
31512193780 | import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy.signal import argrelextrema
import random
import src.passingObjectClass as pasObject
from src import redshiftFinder
color = ['red', 'green', 'black', '#783BA1', '#FFAA1D', '#FA02F2', '#B8B48A']
#ke... | SumithKuttiyil/FindRedshifts | src/main.py | main.py | py | 6,820 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "numpy.max",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.shape",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.annotate",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
30974519180 | #TODO
#???
#contains units?
#groups of units
#current selected group
#resource stats
#available units ("tech level"
import pygame
import units
import math
import random
class Player:
def __init__(self, graphics, world,team=1):
self.leaves = 100 #collect leaves to feed fungus!
self.units = pygam... | MatMoore/hacks | pyweek-8/gamelib/player.py | player.py | py | 5,115 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.sprite.Group",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.Group",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pygame.spr... |
2656910620 | from bs4 import BeautifulSoup
import requests
from pyecharts.charts import Bar
weathers = []
def parse_page(url):
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987'
'.149 Safari/537.36'
}
response = r... | q654528967/python | beatiful_soup/demo03_weather.py | demo03_weather.py | py | 1,664 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 16,
"usage_type": "call"
}
] |
38322001324 | import numpy as np
import time
import cv2
import pylab
from imutils import face_utils
import os
import sys
def resource_path(relative_path):
""" Get absolute path to resource, works for dev and for PyInstaller """
try:
# PyInstaller creates a temp folder and stores path in _MEIPASS
base_path =... | Kartos102/artificial-intelligence | Cheek color detection in python/lib/processors_noopenmdao.py | processors_noopenmdao.py | py | 5,718 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys._MEIPASS",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"li... |
18508174090 | import subprocess
from math import ceil
from get_model import get_model
import os
import cv2
import numpy as np
import datetime
class VideoAnalysis:
def __init__(self, _in_path, _out_path, _expec_reso, _ori_reso, _ori_fr, _expec_fr, **kwargs):
self.in_path = _in_path
self.out_path = _out_path
... | kgong0704/Traffic_Project | TrafficProject/Mask-RCNN/video_analysis.py | video_analysis.py | py | 10,632 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.array",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.int32",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "math.ceil",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "subprocess.check_output",
... |
34008416941 | from typing import List
RAW = """\
00100
11110
10110
10111
10101
01111
00111
11100
10000
11001
00010
01010
"""
INPUT_DEMO = RAW.strip().split("\n")
def most_common_bit(input: List[str]) -> str:
lenght = len(input[0])
c = [0] * lenght
for e in input:
for i in range(lenght):
if e[i] ==... | RDelg/adventofcode | 2021/03.py | 03.py | py | 1,516 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 33,
"usage_type": "name"
}
] |
71126605812 | #! /usr/bin/env python3
import xml.etree.ElementTree as ET
import os.path
import sys
import os
# Read timing information from the .info.xml file and output highlights
# in a form that can be read by CDash.
def get_timer_from_list(timers, timer_names):
for timer_name in timer_names:
for timer in timers:
... | QMCPACK/qmcpack | tests/performance/NiO/process_perf.py | process_perf.py | py | 2,654 | python | en | code | 261 | github-code | 21 | [
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 60,
"usage_type": "call"
},
{
"api... |
5788866858 | ########################################################
# import packages
import json
import pandas as pd
########################################################
# get data
with open("data/data_Mining/funcParams.json") as file:
funcParams = json.load(file)
url = funcParams["brl"]["bonds"]["url"]
df = pd.rea... | thegitofdaniel/fx-tracker | data/data_Mining/get_bonds_brl.py | get_bonds_brl.py | py | 2,520 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
... |
7555298570 | ''' @ MLSys23 Artifacts Evaluation
This code is to check the sparse convolutional results of PCEngine.
PCEngine Dataflow: Gather-GEMM-Scatter, Fetch-on-Demand (Heuristic
dataflow selects between the two dataflows).
Standards: SpConv (v2.2.6) results.
Types: Submanifold & downsamp... | hkeee21/PCEngine-AE | correctness.py | correctness.py | py | 11,834 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "lib.PCEngine.datasets.ModelNet40.ModelNet40Dataset",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "lib.PCEngine.datasets.S3DIS.S3DISDataset",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "lib.PCEngine.datasets.KITTI.KITTIDataset",
"line_... |
15948571843 | """
Author: Awni Hannun
This is an example CTC decoder written in Python. The code is
intended to be a simple example and is not designed to be
especially efficient.
The algorithm is a prefix beam search for a model trained
with the CTC loss function.
For more details checkout either of these references:
https://d... | Ephrem-ETH/E2E-ASR-on-Librispeech | ctc_decoder.py | ctc_decoder.py | py | 8,699 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "utils.word_to_characters.lexicon_dic",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "arpa.loadf",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "editdistance.eval",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "col... |
34261596882 | # page 226 27 min
# My solution
import sys
from collections import deque
n, m = map(int, sys.stdin.readline().split())
coins = []
for _ in range(n):
coins.append(int(sys.stdin.readline()))
coins.sort(reverse=True)
count = [0] * (m + 1)
queue = deque()
queue.append(0)
while queue:
x = queue.popleft()
if x == ... | deepredpark/algorithm | book/coding-test/dynamic_programming/page226.py | page226.py | py | 1,073 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.stdin.readline",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.readline",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"l... |
39923336804 | import requests
import urllib.parse
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
class Browser:
def __init__(self, url, params=None):
self.app = QApplication([])
self.win = QWidget()
self.win.setWindowTitle('Authorization')
self.layout = QVBox... | nkruglikov/data-aggregator | browser.py | browser.py | py | 1,096 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.Session",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "urllib.parse.parse.urldefrag",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "urllib.parse.parse",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": ... |
21257795252 | #!/usr/bin/env python3
import argparse
import os
import subprocess
import sys
import tempfile
import traceback
DESCRIPTION = "Combine audio, cue sheet, and cover (optional) into a single file using ffmpeg"
def main():
parser = argparse.ArgumentParser(description=DESCRIPTION)
parser.add_argument("audio_file... | drodda/audiobook_converter | audiobook_convert.py | audiobook_convert.py | py | 6,576 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
... |
32722782468 | __author__ = 'richardliu'
import requests
from requests_oauthlib import OAuth1
import json
from pymongo import MongoClient
from TwitterFunctions import *
def requestTrendsAtLocation(location):
ckey = 'oZCz1zkJwn3MaCgF9U33CQsK3'
csecret = 'DkTjEPefQMnSpcxMofq5UkII4XEZajAE9d9w7ojweZIFYKAkQT'
atok... | richrliu/TwitterGame | ApiManagement.py | ApiManagement.py | py | 1,703 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests_oauthlib.OAuth1",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "requests_oauthlib.OA... |
1796503530 | # -*- coding: utf-8 -*-
"""Unit tests for the neutrino submodule.
"""
import unittest
from snewpy.neutrino import Flavor
from snewpy.models.loaders import Nakazato_2013, Tamborra_2014, OConnor_2013, OConnor_2015, \
Sukhbold_2015, Bollig_2016, Walk_2018, \
... | SNEWS2/snewpy | python/snewpy/test/test_02_models.py | test_02_models.py | py | 13,675 | python | en | code | 21 | github-code | 21 | [
{
"api_name": "unittest.TestCase",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "snewpy._model_urls.model_urls",
"line_number": 23,
"usage_type": "argument"
},
{
"api_name": "snewpy.models.loaders.Nakazato_2013",
"line_number": 33,
"usage_type": "call"
... |
17621149366 | '''
part1: #998 19:53
part2: #952 23:22
'''
from collections import deque
DIRS = [(0, 1), (0, -1), (1, 0), (-1, 0)]
def add(t1, t2):
return tuple(map(lambda x, y: x + y, t1, t2))
with open("day12.in") as f:
data = f.read().strip()
data = [[c for c in r] for r in data.split("\n")]
m = len(data)
n = len(data... | seetohjinwei/adventofcode | year2022/day12.py | day12.py | py | 1,816 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.deque",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 37,
"usage_type": "call"
}
] |
7543255274 | import matplotlib as mpl
mpl.use('agg')
import pylab as plt
import os
import argparse
import numpy as np
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf
from tensorflow.keras.models import Model,load_model
from tensorflow.keras.layers import BatchNormalizat... | vafaei-ar/RFI-mitigation | trash/run.py | run.py | py | 8,977 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "matplotlib.use",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat.v1.disable_v2_behavior",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat.v1",
"line_number": 11,
"usage_type": "name"
},
{
"api_n... |
2028521239 | # -*- coding: utf-8 -*-
"""
Created on Fri May 31 09:56:52 2019
@author: gazkune
"""
from __future__ import print_function
from collections import Counter
from collections import defaultdict
import sys
import os
from pprint import pprint
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from ke... | gazkune/generic_ar | experiments/cross_dataset/cross_lstm_regression.py | cross_lstm_regression.py | py | 18,122 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "matplotlib.use",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.seed",
... |
35531753185 | # 2.4. Porovnávanie dát. Vyhľadávanie podobných objektov
# Podobnosť dvojstavových premenných [0; 1]
from enum import Enum
from Statistics.Coincidence import Coincidence
class Item:
def __init__(self, name: str, isTycinka: bool, isDezert: bool, isKolac: bool):
self.name = name
self.isTycinka = isTycinka
self.is... | spietre/DAZZ | Prednaska_2_4.py | Prednaska_2_4.py | py | 2,933 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "enum.Enum",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "Statistics.Coincidence.Coincidence.russel",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "Statistics.Coincidence.Coincidence",
"line_number": 57,
"usage_type": "name"
},
{... |
21626414194 | from django.conf import settings
from django.shortcuts import redirect
from django.urls import reverse
from django_filters.rest_framework import DjangoFilterBackend
from drf_yasg2.utils import swagger_auto_schema
from rest_framework import viewsets, mixins, status, pagination
from rest_framework.decorators import actio... | nab5m/herren_coding_test | api/v2/mailing/viewsets.py | viewsets.py | py | 4,173 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.viewsets.GenericViewSet",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "apps.mailing.models.MailHistory.objects.success",
"line_number": 23,
... |
29359978581 | #!/usr/bin/env python
# solve aeg on pwnable.kr with esilsolve
# its faster than manticore and angr
# so thats cool
from esilsolve import ESILSolver
import z3
import r2pipe
from struct import pack, unpack
path = "test/tests/aeg_program"
r2p = None
def esilsolve_execution(targets):
esilsolver = ESILSolver(r2p, d... | radareorg/esilsolve | test/aeg_r2.py | aeg_r2.py | py | 4,162 | python | en | code | 148 | github-code | 21 | [
{
"api_name": "esilsolve.ESILSolver",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "z3.BitVec",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "z3.Concat",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "struct.pack",
"line_numb... |
41219096269 | import re
import attr
UNMATCHABLE = "$."
@attr.s(cmp=False, hash=False, slots=True, frozen=True)
class Service(object):
"""
An instance of this class correspond to specific family of AppScale services.
e.g.: taskqueue, datastore, application (user application), cassandra, ...
It's able to recognize itself ... | HafeezRai/appscale | Hermes/appscale/hermes/stats/unified_service_names.py | unified_service_names.py | py | 7,262 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "attr.ib",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "attr.ib",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "attr.ib",
"line_number": 28,
... |
8650817216 | # noqa
import functools
import sys
import time
import redis
from fta import constants, settings
from fta.utils import get_list, logging
logger = logging.getLogger('root')
class RedisIndexException(Exception):
pass
class InstanceCache(object):
@classmethod
def instance(cls):
if not hasattr(... | mycyzs/fta | server/fta/storage/cache.py | cache.py | py | 7,262 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "fta.utils.logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "fta.utils.logging",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "time.time",
... |
3850837528 | import boto3
import json
import os
class ApiClient():
def __init__(self):
apiId = os.environ['WEBSOCKET_API_ID']
region = os.environ['AWS_REGION']
stage = os.environ['STAGE']
url = f'https://{apiId}.execute-api.{region}.amazonaws.com/{stage}'
self.client = boto... | ZagaUS/event-driven-color-chooser | src/modules/api_client.py | api_client.py | py | 735 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "boto3.client",
"line... |
8141204606 | import time
import json
import numpy as np
import pandas as pd
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
import apikey
json_file = open('setting.json', 'r')
setting = json.load(json_file)
def main():
set_tempo = setting['set_tempo']
set_tempo_range = setting['set_temp... | feruworld/anisong_bpm | 03_BPMenergy_playlist.py | 03_BPMenergy_playlist.py | py | 2,295 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "spotipy.oauth2.SpotifyClientCredentials",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "apikey.my_id",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "a... |
8570359222 | """This is a cog for a discord.py bot.
It adds the purge command to the bot that can be used to delete messages
Commands:
purge <n> Delete the last n messages
purge_user <User> [n] Delete all messages of <User> within the last
[n] Messages (Default 100)
Only... | nikplus-yt/Generic-Discord-Bot | cogs/purge.py | purge.py | py | 4,430 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.has_permissions",
"line_number": 24,
"usage_type": "call"
},
... |
72575770614 | from tkinter import *
import requests
import pyperclip
def url_shortner():
Api = '909fb5772552d48ae1be06daf7f41c7f21aef'
base_url = 'https://cutt.ly/api/api.php'
parameters = {'key': Api, 'short': url.get()}
request = requests.get(base_url, params=parameters)
data = request.json()
t... | akashthakur4553/Url_Shortner | Url_shortner.py | Url_shortner.py | py | 2,046 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pyperclip.copy",
"line_number": 22,
"usage_type": "call"
}
] |
266724746 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 19 14:22:00 2021.
@author: michael
"""
# Standard modules
from tqdm import tqdm
import numpy as np
import pandas as pd
def _is_inbox(x: float, y: float, box: list):
"""Answer True if the point (x,y) is inside the 'box'."""
if x > box[0, ... | Michael-Perna/Data-Analysis-MovingLab | lib/geolib/find_tramway.py | find_tramway.py | py | 4,469 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.matrix",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.matrix",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.matrix",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.matrix",
"line_numbe... |
28573809770 | from PIL import Image, ImageChops
from functions import arr2img, watercolorize, get_outlines, get_shadows, simplemask, get_color_masks
import json
import TileStache
from TileStache.Providers import Mapnik
from ModestMaps.Core import Point
import os
import numpy
import tempfile
from urlparse import urljoin, urlparse
fro... | stamen/watercolor | Handmaps/__init__.py | __init__.py | py | 8,834 | python | en | code | 30 | github-code | 21 | [
{
"api_name": "os.path.realpath",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "ModestMaps.Core.Point",
... |
6687353764 | import random, pygame
from arbalet.core import Application, Pixel, Rate
import argparse # For argument parsing
def gen_sweep_async(n_frames, n_frames_fade, n_frames_rand, colors):
# TODO randomization to change to avoid overlapping of farthest colors
"""
This generator generates sweeping colors with a un... | wookenny/zTables | colors.py | colors.py | py | 7,228 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "arbalet.core.Pixel",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "arbalet.core.Pixel",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "arbalet.core.Pix... |
5632174363 | import logging
import torch
import os
from dataset import *
from model import *
from PIL import Image
import math
import argparse
img_except_h, img_except_w = 32,512 # 32,512
def get_charsDict_and_model(dict_path, model_path):
# device
# deviceName = 'cpu'
deviceName = 'cuda' if torch.cuda.is_available() ... | D641593/STDSTR | STR/demo.py | demo.py | py | 2,610 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.join",
... |
345366724 | from paths import FIGURES_HOME
import os
basePath = "/checkpoint/mhahn/trajectories/"
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import numpy as np
#for language in ["Japanese", "Sesotho", "Indonesian"]:
if True:
prefix = "char-lm-ud-stationary-separate-bidir-with-spaces-probe-baseli... | m-hahn/tabula-rasa-rnns | 4.1_morphology/createVisualizationsGermanGender.py | createVisualizationsGermanGender.py | py | 1,393 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "matplotlib.use",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
22618876246 | from django import template
from django.contrib.auth.models import User
from wizcardship.models import WizConnectionRequest, Wizcard, UserBlocks
register = template.Library()
class AddToWizConnectionsNode(template.Node):
def __init__(self, target_user, current_user='user',
template_name='... | wizcarder/wizcard-server | wizcardship/templatetags/friends_tags.py | friends_tags.py | py | 6,192 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "django.template.Library",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.template.Node",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django... |
13438387755 | from pydantic import EmailStr
from pathlib import Path
import binascii
import codecs
from core.exceptions import NotFoundException, BadRequestException
from app.schemas import Usuario, UsuarioCreate, UsuarioUpdate
from app.models import Usuario as ormUsuario
class ControladorUsuario:
def __init__(self, session):... | a-lvaro/Wydra-construcaoSoftware | server/app/controllers/usuario.py | usuario.py | py | 2,997 | python | pt | code | 2 | github-code | 21 | [
{
"api_name": "app.models.Usuario",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": "app.models.Usuario.id",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "app.models.Usuario",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "... |
71401158133 | import pickle
imdb_path = '/Users/yiwenwang/Documents/CMU/20 Spring/ML/imdb/'
import string
# from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
# stopwords_nltk = set(stopwords.words('english'))
stop = set()
for i in string.punctuation:
stop.add(i)
entries = pickle.load(open(imdb_path... | zhaiyue1002/IMDB-Analysis-for-Machine-Learning-10701 | process.py | process.py | py | 2,025 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "string.punctuation",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "string.punctuation",
"... |
33452463795 | import rclpy
from rclpy.node import Node
from sensor_msgs.msg import Image
from std_msgs.msg import Float32
import cv2 as cv
from cv_bridge import CvBridge
import numpy as np
from geometry_msgs.msg import Point
from std_msg.msg import Bool
import time
import os
import json
NODE_NAME = 'find_ball_node'
CAMERA_TOPIC_NAM... | gshabtai/ece148-team1 | packages/seeker/disabled/find_ball_node.py | find_ball_node.py | py | 1,916 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "rclpy.node.Node",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "std_msg.msg.Bool",
"line_number": 22,
"usage_type": "argument"
},
{
"api_name": "geometry_msgs.msg.Point",
"line_number": 23,
"usage_type": "argument"
},
{
"api_name": "sens... |
35571807190 | from keras.engine.topology import Layer
from tensorflow.keras.initializers import RandomUniform
from sklearn.utils.validation import check_array
import tensorflow as tf
import numpy as np
from sklearn.utils.multiclass import unique_labels
class SOMLayer(Layer):
"""Self Organizing Map Layer.
This layer implem... | Pseudotetraden/scikit_contrib | skltemplate/layer/som.py | som.py | py | 9,235 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "keras.engine.topology.Layer",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "tensorflow.keras.initializers.RandomUniform",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "tensorflow.constant",
"line_number": 44,
"usage_type": "call"
},... |
21655622125 | # -*- coding: utf-8 -*-
from datetime import datetime
import time
# input mapping
raw_output = "data/raw/vnCovid19raw.csv"
dataframe_output = "data/vnCovid19data.csv"
covid_map = "map/map.html"
# today date
today = datetime.today().strftime("%d-%m-%Y")
# dataframe column
columns = ["Thời gian",
... | chungtd89/ncov_moh_retrieve | function/miscellaneous.py | miscellaneous.py | py | 1,246 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datetime.datetime.today",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "time.time",
"... |
17520083374 | import fastentrypoints
import setuptools
import versioneer
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="jktool",
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
author="leoetlino",
author_email="leo@leolam.fr",
description="L... | leoetlino/jktool | setup.py | setup.py | py | 994 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "setuptools.setup",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "versioneer.get_version",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "versioneer.get_cmdclass",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "setupt... |
44008960007 | import matplotlib.pylab as plt
import time
from midi.utils import midiwrite
#Import model
from keras.models import load_model
model = load_model('LSTM_2x128.h5')
for temperature in [0.3,0.5,0.8,1.0,1.2]:
probroll = []
sampleroll = []
pressedroll = []
#Start with silence
x = np.zeros((1, maxlen, notes))
#Sta... | EBjerrum/LSTM_music | Sample.py | Sample.py | py | 2,208 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "keras.models.load_model",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "midi.utils.midiwrite",
"line_number": 67,
"usage_type": "call"
}
] |
75023918453 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
import os.path
import shutil
import string
import argparse
import subprocess
from . import template
def convert(problem, options=None):
if options is None:
options = ConvertOptions()
problem = os.path.realpath(problem)
problembase = os.path.splitext... | Kattis/problemtools | problemtools/problem2pdf.py | problem2pdf.py | py | 2,537 | python | en | code | 96 | github-code | 21 | [
{
"api_name": "os.path.path.realpath",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "os.path.path.splitext... |
21578316817 | #%%----------------------------------------------------------------------------
# Finds all TDMS files in /measurements/organized by ticket number/
# and updates faDatabase.xlsx
#
# NOTE: If USNR or SensorNr already found in xlsx file, data will be reused.
# Deleting the xlsx file forces the rebuilding o... | Azrishere/FA_Eval | BMI284_database2p0.py | BMI284_database2p0.py | py | 3,758 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "nptdms.TdmsF... |
72552161973 | from flask import Blueprint, redirect, flash, render_template, url_for
from flask_login import current_user
from jobplus.decorators import company_required
from jobplus.forms import CompanyProfileForm
company = Blueprint('company', __name__, url_prefix='/company')
@company.route('/admin/profile', methods=['GET', 'PO... | LouPlus/jobplus6-14 | jobplus/handlers/company.py | company.py | py | 760 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Blueprint",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "jobplus.forms.CompanyProfileForm",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask_login.current_user.company",
"line_number": 13,
"usage_type": "attribute"
},
{
... |
31633991513 | import numpy as np
from keras.layers import Dense, Input, Convolution1D, MaxPooling1D, Flatten, Activation
from keras.layers import Merge, Embedding
from keras import backend as K
from keras.models import Model, Sequential
vobabsize = 1000
embedding_size = 256
max_pos = 1000
data_len = 200
dim_pose = 100
num_filters = ... | quanap5/Multi-word-embedding-CNN | app/merge_try.py | merge_try.py | py | 1,579 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "numpy.random.random",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.random",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.rando... |
544970102 | import time
import click
import structlog
from powerbi_cli.client import get_client
@click.command(name="query")
@click.option(
"-w",
"--workspace",
type=str,
default=None,
envvar="WORKSPACE_ID",
show_default=True,
show_envvar=True,
)
@click.option(
"-d",
"--dataset",
type=st... | lgrosjean/powerbi-cli | powerbi_cli/dataset/query.py | query.py | py | 923 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "powerbi_cli.client.get_client",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "time.perf_counter",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "time.perf_counter",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "cli... |
7014759128 | #Written to solve https://www.hackerrank.com/challenges/python-time-delta/problem
import datetime
formatString = "%a %d %b %Y %H:%M:%S %z"
testCases = int(input())
for t in range(testCases):
t1 = str(input())
t2 = str(input())
formatT1 = datetime.datetime.strptime(t1, formatString)
formatT2 = dateti... | mikem2314/PythonExercises | TimeDelta.py | TimeDelta.py | py | 436 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 13,
"usage_type": "call"
},
{
"api_... |
11545574546 | import traceback
from common import Common
from extractor import Extractor
SHOW_TOP_CONTEXTS = 10
MAX_PATH_LENGTH = 8
MAX_PATH_WIDTH = 2
JAR_PATH = 'JavaExtractor/JavaExtractor_ori.jar'
class InteractivePredictor:
exit_keywords = ['exit', 'quit', 'q']
def __init__(self, config, model):
model.predic... | limjintack/Type-based-code-analyze | src/interactive_predict.py | interactive_predict.py | py | 2,708 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "extractor.Extractor",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "common.Common.parse_results",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "common.Common",
"line_number": 47,
"usage_type": "name"
}
] |
27944578590 | #!/usr/bin/env python3
import sys
from collections import defaultdict
class Machine:
def __init__(self, memory):
self.funs = {
1: lambda: self.bi_func(lambda x, y: x + y),
2: lambda: self.bi_func(lambda x, y: x * y),
3: lambda: self.input(),
4: lambda: sel... | janosgyerik/advent-of-code | 2019/day17/part1.py | part1.py | py | 4,790 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.defaultdict",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sys.stdin.read",
"line_number": 175,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 175,
"usage_type": "attribute"
}
] |
41525430953 | from qiime2.plugin import (Str, Plugin, Metadata, Choices, Bool, Citations,
Int, MetadataColumn, Numeric, Range)
from .mapper import (draw_map, geodesic_distance, euclidean_distance,
draw_interactive_map)
import q2_coordinates
import importlib
from q2_types.sample_data im... | bokulich-lab/q2-coordinates | q2_coordinates/plugin_setup.py | plugin_setup.py | py | 9,778 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "qiime2.plugin.Citations.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "qiime2.plugin.Citations",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "qiime2.plugin.Plugin",
"line_number": 18,
"usage_type": "call"
},
{
"api_nam... |
75021674933 | from typing import List
from math import floor
def _tick(grid: List[int]):
for i in range(len(grid)):
grid[i] += 1
def _flash(grid: List[int]) -> int:
should_flash = []
flashed = []
check = True
while check:
# Process the should_flash octopi
for s in should_flash:
... | alyons/aoc_python | src/AoC2021/day_11.py | day_11.py | py | 1,516 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "math.floor",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 38,... |
21667121963 | from __future__ import print_function
from apiclient import discovery
from httplib2 import Http
from oauth2client import file, client, tools
import json
SCOPES = 'https://www.googleapis.com/auth/calendar'
store = file.Storage('storage.json')
creds = store.get()
if not creds or creds.invalid:
flow = client.flow_fr... | acozzi/classroomCalendarApi | getEventsList.py | getEventsList.py | py | 1,786 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "oauth2client.file.Storage",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "oauth2client.file",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "oauth2client.client.flow_from_clientsecrets",
"line_number": 12,
"usage_type": "call"
},
{
... |
40015111534 | #dyna agent without backward search control heuristic
import numpy as np
from time import sleep
import matplotlib.pyplot as plt
import random
rows = 16
cols = 19
start = (2,0)
goal = (0,18)
blocks = [(1,1),(2,1),(3,1),(4,1),(5,1)]
BEHAVIORS = ('U','D','L','R')
class Environment:
def __init__(self):
self.... | mateo3264/RL | linear_agent.py | linear_agent.py | py | 6,347 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.random.randn",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "numpy.sqrt",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"li... |
2702753777 | #!/usr/bin/env python
#
# Author: Qiming Sun <osirpt.sun@gmail.com>
#
'''
Non-relativistic restricted Hartree Fock with symmetry.
The symmetry are not handled in a separate data structure. Note that during
the SCF iteration, the orbitals are grouped in terms of symmetry irreps.
But the orbitals in the result are so... | sunchong137/pyscf_2017 | scf/hf_symm.py | hf_symm.py | py | 33,155 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "pyscf.lib.logger.DEBUG",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "pyscf.lib.logger",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "pyscf.lib.logger.Logger",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "... |
39601933001 | #!/usr/bin/python
# -*- coding:utf-8 -*-
from django.conf.urls import patterns, url
from system import views
urlpatterns = patterns('',
# user
url(r'^u/login/$', views.user_login, name='user_login'),
url(r'^u/logout/$', views.user_logout, name='user_... | SRELabs/pureftp | system/urls.py | urls.py | py | 1,557 | python | en | code | 7 | github-code | 21 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "system.views.user_login",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name... |
19889744721 | import json
from channels.generic.websocket import WebsocketConsumer
from asgiref.sync import async_to_sync
class AppConsumer(WebsocketConsumer):
def connect(self):
self.room_group_name = 'test'
async_to_sync(self.channel_layer.group_add)(
self.room_group_name,
self.channe... | karl-kaarel/DJangoApiSpotify | src/SpotifyCloneApp/consumers.py | consumers.py | py | 2,251 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "channels.generic.websocket.WebsocketConsumer",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "asgiref.sync.async_to_sync",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 17,
"usage_type": "call"
},
{
"... |
24672123480 | import os
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from loko.conf import get_configs
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
config = get_configs()
def get_tables_metadata():
sorted_tables = Base.metadata.sorted_tables
return s... | mcflyhalf/loko | loko/models/__init__.py | __init__.py | py | 1,733 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "loko.conf.get_configs",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 14,
"usage_type": "call"
},
... |
11081979942 | from influxdb import InfluxDBClient
import paho.mqtt.client as mqtt
import json
import logging
from configparser import ConfigParser
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.DEBUG)
logger = logging.getLogger(__file__)
# Read config file
config = ConfigParser()
... | sensemakersamsterdam/simple-iot-platform | python/mqtt_to_influx.py | mqtt_to_influx.py | py | 2,610 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "logging.basicConfig",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "configparser.Co... |
34319453487 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# =============================================================================
__author__ = 'Harold Snyers'
__course__ = 'Micro Courses'
# __teammates__ = ['Jeromie Kirchoff']
__assessment__ = 'Coding 1'
__title__ = 'Measuring time execution'
__date__ = '2020/01/12'
__des... | haroldsnyers/microCourses | PythonOpti/Coding1/coding1.py | coding1.py | py | 3,764 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 66,
"usage_type": "name"
},
{
"api_name": "timeit.Timer",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "timeit.Timer"... |
23842866595 | from django.test import TestCase
from .models import *
from django.urls import reverse
from rest_framework import status as httpStatus
# Create your tests here.
class StatusPayableTestCase(TestCase):
model = StatusPayable
def setUp(self):
self.model.objects.create(name="Paid")
self.model.obje... | fernandohernandezpaz/desafio_backend | payment_tax_service/tests.py | tests.py | py | 2,695 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.test.TestCase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.test.TestCase",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "django.test.TestCase",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "django.... |
3575397666 | import streamlit as sl
import pickle
import requests
def fetch_poster(id):
response=requests.get('https://api.themoviedb.org/3/movie/{}?api_key=4477c8b9dd6f7ef02a3ca3be5abfa767&language=en-US'.format(id))
data=response.json()
print(data)
return 'https://image.tmdb.org/t/p/original/'+data['poster_path']
... | AnirudhNambi/Movie-Recommendation-System | RecommendationSystem/app.py | app.py | py | 1,671 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_numbe... |
23159278236 | # process functions for hugggingface datasets map.
from typing import List, Dict, Union
from transformers import AutoTokenizer, PreTrainedTokenizer, PreTrainedTokenizerFast
from datasketch import MinHash, MinHashLSH, LeanMinHash
from .utils import ngrams
def get_minhash(
data:Dict[str, Union[str, List]],
... | DataLama/neardup | neardup/process.py | process.py | py | 2,584 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.Dict",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number"... |
29385490367 | from transformers import BertTokenizer, Wav2Vec2Processor, Wav2Vec2Model, HubertModel
from args_setting import args
import torch
import librosa
import numpy as np
"""
** 获取音频、文本的各个特征输入
"""
def text_bert(text):
"""text_ids = []
text_attention_mask = []
text_token_type_ids = []"""
tokenizer = BertToke... | Little-rookie-ee/Emocap_emotion | get_audio_text_input.py | get_audio_text_input.py | py | 4,127 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "transformers.BertTokenizer.from_pretrained",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "transformers.BertTokenizer",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "args_setting.args.bert_path",
"line_number": 17,
"usage_type": "att... |
70016927412 | from __future__ import print_function
import argparse
import inspect
import os
import pdb
import pickle
import random
import re
import shutil
import time
from collections import *
import ipdb
import numpy as np
# torch
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.nn.functional... | line/Skeleton-Temporal-Action-Localization | train.py | train.py | py | 24,376 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "torch.cuda.manual_seed_all",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "torch.manual_seed",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.ra... |
73880148533 | from pymongo import MongoClient
client = MongoClient("mongodb://plant:plant2022@localhost:27017/plant",authSource="admin")
db = client.plant
sensorsDB = db.sensors
settingsDB = db.settings
chatbotdb = client.chatbot
chatbotDB = chatbotdb.chatbot
menuDB = chatbotdb.menu
orderDB = chatbotdb.order
| aon123/plant | db.py | db.py | py | 299 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 4,
"usage_type": "call"
}
] |
40579430587 | import requests
import json
import sys
import argparse
from netbox_helpers import print_error_msg
debug = True
parser = argparse.ArgumentParser(description='MAC Address OUI Lookup')
parser.add_argument('mac_address', help='MAC Address to be queried')
args = parser.parse_args()
mac_address = args.mac_address
base_u... | ttaylor1972/hands_on_python_neteng | rest_get_mac_info.py | rest_get_mac_info.py | py | 632 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "netbox_helpers.print_error_msg",
"line_number": 30,
"usage_type": "call"
}
] |
23675255210 |
import matplotlib.pyplot as plt
import numpy as np
import cv2,os
import skimage as sk
import imageio
from scipy.stats import linregress
def scratch_process(imagepath,all_parameters=False,save_results=False,print_results=False,plot_resluts=False,coeffients=False,gif=False,report=False):
time_list=... | eyadgad/Image-Processing-and-Analysis-of-the-Scratch-Assay | scratch_main.py | scratch_main.py | py | 4,248 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.listdir",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
... |
73036564853 | """
test_get_figure:
=================
A module intended for use with Nose.
"""
from __future__ import absolute_import
from unittest import TestCase, skipIf
import six
from nose.plugins.attrib import attr
from plotly import exceptions
from plotly.plotly import plotly as py
from plotly.tests.utils import PlotlyTest... | LiuFang816/SALSTM_py_data | python/plotly_plotly.py/plotly.py-master/plotly/tests/test_core/test_get_figure/test_get_figure.py | test_get_figure.py | py | 2,685 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "plotly.tests.utils.PlotlyTestCase",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "plotly.plotly.plotly.sign_in",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "plotly.plotly.plotly",
"line_number": 46,
"usage_type": "name"
},
{
... |
3500779845 | import imp
import inspect
import os
import sys
import tempfile
class Placeholder(object):
"""Base class for json placeholders. Do not use directly."""
def render(self, test_data): # pragma: no cover
"""Return [cmd items]*"""
raise NotImplementedError
def step_finished(self, presentation, step_result, ... | sunny-bay/chromium30 | build/scripts/slave/recipe_api.py | recipe_api.py | py | 8,470 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "tempfile.mkstemp",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.write",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.close",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.unlink",
"line_number": 40,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.