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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
22927926000 | import io
import os
import pytest
import kfserving
from minio import Minio, error
from google.cloud import exceptions
import unittest.mock as mock
STORAGE_MODULE = 'kfserving.storage'
def test_storage_local_path():
abs_path = 'file:///'
relative_path = 'file://.'
assert kfserving.Storage.download(abs_pat... | pydemia/kfserving-templates | kfserving/kfserving/test/test_storage.py | test_storage.py | py | 4,664 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "kfserving.Storage.download",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "kfserving.Storage",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "kfserving.Storage.download",
"line_number": 16,
"usage_type": "call"
},
{
"api_... |
6266391421 | import cx_Oracle
try:
con = cx_Oracle.connect("hr/hr@localhost")
cur=con.cursor()
print("Connected to the DataBase")
cur.execute("create table Employee(id number(5),name varchar(10),salary float(10))")
print("Table created")
n=int(input("Enter the number of employees : "))
rows=[]
... | Vigneshrajvr/Python-Intership-BEST-ENLIST | day20task.py | day20task.py | py | 1,394 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cx_Oracle.connect",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "cx_Oracle.DatabaseError",
"line_number": 31,
"usage_type": "attribute"
}
] |
14245036446 | # -*- coding: utf-8 -*-
import copy
import time
from elasticsearch import Elasticsearch
from elasticsearch import RequestsHttpConnection
from elasticsearch.client import _make_path
from elasticsearch.client import query_params
from elasticsearch.exceptions import TransportError
class ElasticSearchClient(Elasticsearc... | Yelp/elastalert | elastalert/__init__.py | __init__.py | py | 11,791 | python | en | code | 7,937 | github-code | 6 | [
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "elasticsearch.RequestsHttpConnection",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "copy.copy",
"line_number": 31,
"usage_type": "call"
},
{
"api_na... |
20519493680 | """!
@brief Cluster analysis algorithm: SYNC-SOM
@details Implementation based on paper @cite article::syncsom::1.
@authors Andrei Novikov (pyclustering@yandex.ru)
@date 2014-2020
@copyright BSD-3-Clause
"""
from pyclustering.cluster.encoder import type_encoding
from pyclustering.cluster.syncnet impor... | annoviko/pyclustering | pyclustering/cluster/syncsom.py | syncsom.py | py | 9,235 | python | en | code | 1,113 | github-code | 6 | [
{
"api_name": "pyclustering.nnet.som.som",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "pyclustering.nnet.som.type_conn.grid_four",
"line_number": 86,
"usage_type": "attribute"
},
{
"api_name": "pyclustering.nnet.som.type_conn",
"line_number": 86,
"usage_type... |
3648833119 | # -*- coding: utf-8 -*-
"""
Created on Sun Nov 13 05:06:06 2016
@author: JosephNelson
"""
# get dependencies
import pandas as pd
from textblob import TextBlob
import json
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
# read in the data
with open('grant_tweets.json', "r") as f:
data = json.loads(f.read())
... | Grantimus9/gifminute | hackital_final.py | hackital_final.py | py | 2,459 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "textblob.TextBlob"... |
34244341782 | import string
import torch
import numpy as np
"""
The word "token" refers to an atomic string that has a direct mapping to
a token id. Token ids refer to an int id value that can then be used as
an index to an Embedding.
"""
def tokenize(main_string, delimeters={" "},
special_tokens={"\\newl... | grantsrb/dl_utils | tokenizer.py | tokenizer.py | py | 19,840 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "string.whitespace",
"line_number": 62,
"usage_type": "attribute"
},
{
"api_name": "string.whitespace",
"line_number": 142,
"usage_type": "attribute"
},
{
"api_name": "numpy.inf",
"line_number": 419,
"usage_type": "attribute"
},
{
"api_name": "numpy.... |
21415199046 | from pathlib import Path
from typing import List
from platform import system
from dotenv import load_dotenv
from invoke import task
from invoke.runners import Result
if system() == "Windows":
from subprocess import list2cmdline as join
else:
from shlex import join
load_dotenv(".flaskenv")
load_dotenv(".env")... | buehlefs/flask-template | tasks.py | tasks.py | py | 6,557 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "platform.system",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
... |
21937231209 | # -*- coding: utf-8 -*-
# Description: gpu netdata python.d module
# Author:
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import os
import re
import time
from subprocess import Popen, PIPE
from bases.FrameworkServices.SimpleService import SimpleService
update_every = 4
priority = 90000
ORDER = [
'usa... | STMicroelectronics/meta-st-openstlinux | recipes-webadmin/netdata/netdata/gpu.chart.py | gpu.chart.py | py | 2,441 | python | en | code | 64 | github-code | 6 | [
{
"api_name": "subprocess.Popen",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "subprocess.Popen",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
... |
7224257490 | from django.core.management.base import BaseCommand, CommandError
from taxonomy.models import Base, Term, TermParent, BaseTerm, Element
from django.db import connection
class Command(BaseCommand):
help = 'Uninstall the taxonomy app database tables, with further instructions'
def drop(self, dbname):
... | rcrowther/django-category-collection | management/commands/taxonomy_uninstall.py | taxonomy_uninstall.py | py | 1,310 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.connection.cursor",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.db.connection",
"line_number": 13,
"usage_type": "name"
},
... |
23927328251 | #-------------------------------------#
# 调用摄像头检测
#-------------------------------------#
from yolo import YOLO
from PIL import Image
import numpy as np
import cv2
import time
from parallel.model import *
import sys
import os
from pathlib import Path
def init_frame_processors(frame_producer, num_processor, max_i... | SylarWu/CarDetection_YOLOv4 | video.py | video.py | py | 1,785 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"lin... |
13529413008 | import click
from deepdiff import DeepDiff
import json
from jsonschema import validate
from progressbar import ProgressBar, UnknownLength
from pymongo import MongoClient
from pymongo.errors import DuplicateKeyError
from sourmash_lib import MinHash, signature, signature_json
from uuid import uuid4
from zoo.diff import j... | phiweger/zoo | zoo/cli/cell.py | cell.py | py | 13,749 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "zoo.utils.eprint",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"lin... |
32842870500 | import pytest
import unittest
import time
from SeleniumFramework.base.BasePage import BaseClass
from SeleniumFramework.pages.ContactUsFormPage import ContactUsForm
import SeleniumFramework.utilities.CustomLogger as cl
@pytest.mark.usefixtures("beforeClass", "setUp")
class contactFormTest(unittest.TestCase):
@pyt... | candi-project/Selenium | SeleniumFramework/tests/test_ContactFormtest.py | test_ContactFormtest.py | py | 1,007 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "SeleniumFramework.pages.ContactUsFormPage.ContactUsForm",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "SeleniumFramework.base.BasePage.BaseClass",
"line_number": 15,... |
19615185550 | from django.urls import path, include
from .views import TotalPollsView, DetailPollView
extra_urls = [
path("", TotalPollsView.as_view(), name="TotalPollsView"),
path("<int:pk>", DetailPollView.as_view(), name="DetailPollView"),
]
urlpatterns = [
path("", include(extra_urls)),
]
| Nikolay-Yakushev/MiddlewarePractice | backend_app/urls.py | urls.py | py | 294 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.TotalPollsView.as_view",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.TotalPollsView",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "djang... |
37430797378 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
name: TRS was40 tree导航树泄露
referer: http://www.wooyun.org/bugs/wooyun-2013-038875
author: Lucifer
description: 访问was40/tree可查看信息导航树。
'''
import sys
import requests
class trs_was40_tree_disclosure_BaseVerify:
def __init__(self, url):
self.url = url
def... | iceyhexman/onlinetools | scanner/plugins/cms/trs/trs_was40_tree_disclosure.py | trs_was40_tree_disclosure.py | py | 1,091 | python | en | code | 1,626 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 34,
"usage_type": "attribute"
}
] |
2771430441 | from flask import Flask, Response, request
from config import TOKEN
import requests
app = Flask(__name__)
@app.route('/message', methods=["POST"])
def handle_message():
print("got message")
req = request.get_json()
# res = bot(req)
res = "OK"
chat_id = req['message']['chat']['id']
res = reques... | rachel123nkr/healthy_life_bot | server.py | server.py | py | 527 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "requests.get",
"l... |
20327034936 | import argparse
import fileinput
import sys
from dice_roller import __version__
from dice_roller.replace import replace_expression
def make_parser(prog):
parser = argparse.ArgumentParser(
prog=prog,
description="Simple utility to help keep rule logs from dnd sessions.",
)
parser.add_argum... | EJahren/dice_roller | src/dice_roller/__main__.py | __main__.py | py | 930 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "dice_roller.__version__",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "fileinput.FileInput",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "d... |
12991421012 | import requests
from bs4 import BeautifulSoup
ADDRESS = "https://web.archive.org/web/20200518073855/https://www.empireonline.com/movies/features/best-movies-2/"
class EmpireFinder:
def __init__(self):
self.api_link = ADDRESS
def get_data(self, number):
ending = int(number)
... | Nika-Chinchaladze/Web_Scraper_GUI_Application | Empire_Class.py | Empire_Class.py | py | 613 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 15,
"usage_type": "call"
}
] |
26043494686 | from typing import Tuple
import pytest
from pants.engine.fs import PathGlobs, Snapshot
from pants.source.filespec import FilespecMatcher
from pants.testutil.rule_runner import RuleRunner
@pytest.fixture
def rule_runner() -> RuleRunner:
return RuleRunner()
def assert_rule_match(
rule_runner: RuleRunner, gl... | pantsbuild/pants | src/python/pants/source/filespec_test.py | filespec_test.py | py | 3,040 | python | en | code | 2,896 | github-code | 6 | [
{
"api_name": "pants.testutil.rule_runner.RuleRunner",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pants.testutil.rule_runner.RuleRunner",
"line_number": 11,
"usage_type": "name"... |
23019727625 | from torchvision import transforms, datasets
import PyGenBrix.dist_layers.common_layers as dl
import PyGenBrix.dist_layers.spatial_independent as sp
import PyGenBrix.dist_layers.pixelcnn as pixel_cnn
import PyGenBrix.dist_layers.parallelcnn as parallel_cnn
import PyGenBrix.dist_layers.vdvae as vdvae
import PyGenBrix.im... | jfrancis71/PyGenBrix | image_models/parser.py | parser.py | py | 4,600 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torchvision.transforms.Lambda",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "PyGenBrix.dist_layers.common_layers.quantize",
"line_number": 15,
"usage_type": "cal... |
36550223121 | import feedparser
import requests
import os
from celery import Celery
celery = Celery(__name__)
celery.conf.broker_url = os.environ.get("CELERY_BROKER_URL", "redis://localhost:6379")
celery.conf.result_backend = os.environ.get("CELERY_RESULT_BACKEND", "redis://localhost:6379")
@celery.task(name="create_task")
def cra... | mustansirgodhrawala/flask-celery-redis-api | project/server/tasks/crawler.py | crawler.py | py | 1,852 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "celery.Celery",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "celery.conf",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_num... |
73928010428 | import unittest
import mock
from cardboard import events, phases as p
from cardboard.tests.util import GameTestCase
class TestPhase(unittest.TestCase):
def test_init(self):
h = p.Phase("Foo", [1, 2, 3])
self.assertEqual(h.name, "Foo")
self.assertEqual(h.steps, [1, 2, 3])
def test_i... | Julian/cardboard | cardboard/tests/test_phases.py | test_phases.py | py | 6,655 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "cardboard.phases.Phase",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cardboard.phases",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "cardboa... |
17883344787 | import base64
import os
import yaml
from demisto_sdk.commands.common.configuration import Configuration
from demisto_sdk.commands.common.constants import DEFAULT_IMAGE_BASE64
from demisto_sdk.commands.common.legacy_git_tools import git_path
from demisto_sdk.commands.split.ymlsplitter import YmlSplitter
def test_ext... | AdouniH/demisto-sdk | demisto_sdk/commands/split/tests/ymlsplitter_test.py | ymlsplitter_test.py | py | 6,625 | python | en | code | null | github-code | 6 | [
{
"api_name": "demisto_sdk.commands.split.ymlsplitter.YmlSplitter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "demisto_sdk.commands.common.legacy_git_tools.git_path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "demisto_sdk.commands.common.configuratio... |
74977721467 | import tarfile
import re
import logging
from dipper.sources.Source import Source
from dipper.models.assoc.OrthologyAssoc import OrthologyAssoc
from dipper.models.Model import Model
from dipper.models.BiolinkVocabulary import BioLinkVocabulary as blv
__author__ = 'nicole'
LOG = logging.getLogger(__name__)
class Pa... | monarch-initiative/dipper | dipper/sources/Panther.py | Panther.py | py | 13,251 | python | en | code | 53 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "dipper.sources.Source.Source",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "dipper.models.Model.Model",
"line_number": 172,
"usage_type": "call"
},
{
"api_nam... |
20658047550 | import os
import textwrap
import stat
import shutil
import logging
import subprocess
from pathlib import Path
from tempfile import TemporaryDirectory, NamedTemporaryFile
class CDROM:
def __init__(self):
# create cdrom dir
self.cdrom_dir_tmp = TemporaryDirectory()
self.tmp_dir = TemporaryDir... | KVM-VMI/nitro | tests/cdrom.py | cdrom.py | py | 5,057 | python | en | code | 45 | github-code | 6 | [
{
"api_name": "tempfile.TemporaryDirectory",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tempfile.TemporaryDirectory",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.chmod",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "stat... |
8640647294 | import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv('GoogleApps.csv')
d = df.pivot_table(index='Content Rating', columns='Type',
values='Installs', aggfunc='mean')
# subplots - постройка графиков друг под другом
d.plot(kind='barh', subplots=True)
plt.show()
# совмещение графиков:... | PhantomNero/GitHub | GoogleApps/Visualization2.py | Visualization2.py | py | 688 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "matplotlib.py... |
20844738935 | import torch
import torch.nn as nn
from torch.nn.utils import spectral_norm
USE_SN = True
def normalization(module):
return spectral_norm(module) if USE_SN else module
class Discriminator(nn.Module):
def __init__(self, in_channels, image_size, depth=64):
"""
Arguments:
in_chan... | TropComplique/SRFeat-pytorch | discriminator.py | discriminator.py | py | 2,231 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.utils.spectral_norm",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.nn.S... |
39047073117 | from ProjectDepends import ProjectNode, DepGraph # use for pickle
import shelve
from collections import defaultdict
import os
import pickle
import argparse
import sys
def parse_args(args):
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group()
parser.add_argument('--init', help=... | Micha10/SRM-wireguard-cross-compile | pkgscripts-ng/ParallelProjects.py | ParallelProjects.py | py | 5,494 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "sys.setrecursionlimit",
"line_number": 130,
"usage_type": "call"
},
{
"api_name":... |
32346589826 | '''
l(un)dump.py
A Lua5.1 cross-platform bytecode deserializer && serializer. This module pulls int and size_t sizes from the
chunk header, meaning it should be able to deserialize lua bytecode dumps from most platforms,
regardless of the host machine.
For details on the Lua5.1 bytecode format, I ... | CPunch/LuaDecompy | lundump.py | lundump.py | py | 19,771 | python | en | code | 13 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "enum.auto",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "enum.auto",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "enum.auto",
"line_number": 19,
... |
1821855128 | from itertools import combinations
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from utils import dname_from_fpath
import environment_processing as eproc
# from model import MultiLayerPerceptron
# from dataset import AdultDataset
# from util import *
#import matplotlib.... | adragnar/causal_discovery | data_processing.py | data_processing.py | py | 12,739 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "environment_processing.get_environments",
"line_number": 34,
"usage_type": "cal... |
29324272555 | '''
Application for testing ir signals to your tv from python using irsend
irsend : http://www.lirc.org/html/irsend.html
Created by: Lee Assam
www.powerlearningacademy.com
Last Modified: 2018-07-20
'''
import argparse, os, time
'''
-- Program for quickly testing your remote --
#Command line arguments
#Usage: python3... | leeassam/alexa-rpi-tv-control | test.py | test.py | py | 2,360 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_num... |
70285743869 | import jieba
import orjson as js
import json
import torch
import numpy as np
def only_triple():
"""加pad符号后的id"""
klg2id = {}
fw = open("../data/travel/triple2id.txt", 'w', encoding='utf-8')
with open('../data/travel/klg2id.txt', encoding='utf-8') as f:
for i, line in enumerate(f):
... | tigerwww-git/RT-KGD | utils/utils.py | utils.py | py | 10,787 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "orjson.loads",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "orjson.dumps",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "orjson.dumps",
"line_number":... |
16837803658 | from abc import ABC
from enum import Enum
from pathlib import Path
from csvcubed.models.errorurl import HasErrorUrl
class CsvcubedExceptionMsges(Enum):
"""
Error messages for the exceptions thrown in csvcubed.
"""
InputNotSupported = "The input CSV-W json-ld is not supported. The input should be a d... | GDonRanasinghe/csvcubed-models-test-5 | csvcubed/csvcubed/models/csvcubedexception.py | csvcubedexception.py | py | 9,828 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 54,
"usage_type": "name"
},
{
"api_name": "csvcubed.models.errorurl.HasErrorUrl",
"line_number": 102,
"usage_type": "name"
},
{
"api_name": "abc.ABC",
... |
8842335490 | from pytube import YouTube
from youtubesearchpython import VideosSearch
import os
from cleanstring import clean_string
import shutil
from pymediainfo import MediaInfo
def download_mp3(query, sousrep, nomalbumsingle):
# Effectuer la recherche sur YouTube
search = VideosSearch(query.replace("_", " ")+" lyric")
... | Qosip/RemplissageBddSoundisen | downloadmp3.py | downloadmp3.py | py | 1,955 | python | fr | code | 0 | github-code | 6 | [
{
"api_name": "youtubesearchpython.VideosSearch",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pytube.YouTube",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pymediainfo.MediaInfo.parse",
"line_number": 28,
"usage_type": "call"
},
{
"api_n... |
9945404955 | # -*- coding: utf-8 -*-
"""
Created on Fri Jan 13 20:46:41 2023
@author: alex8
"""
import sys
import getopt
import argparse
# Show all arguments
n = len(sys.argv)
print(f"Found {n} argument{'s' if n > 1 else ''}:")
ii = 0
for arg in sys.argv:
print(f"{ii:4d}: {arg}")
ii = ii + 1
# GNU getopt parsing
opts, a... | alessandro-soldati/shrimp | src/opts_test.py | opts_test.py | py | 638 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "getopt.gnu_getopt",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_nu... |
17694487892 | #EXPONENTIAL SIGNAL
import numpy as np #Importing all definitions from the module and shortening as np
import matplotlib.pyplot as mplot #Shortening as mplot ,an alias to call the library name
###CONTINUOUS
x = np.linspace(-1, 2, 100) # 100 linearly spaced numbers from -1 to 2
xCT ... | kanishk333gupta/Elementary-Signals-in-continuous-and-discrete-time | Exponential signal.py | Exponential signal.py | py | 1,765 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.linspace",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
73727740028 | from rest_framework import mixins
from rest_framework.exceptions import *
from rest_framework.permissions import IsAuthenticated
from rest_framework.viewsets import GenericViewSet
from rest_framework.response import Response
from django_filters.rest_framework import DjangoFilterBackend
from django.db.models import Q
f... | bounswe/bounswe2019group5 | backend/api/views/message.py | message.py | py | 1,676 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "rest_framework.mixins.CreateModelMixin",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.mixins",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "rest_framework.mixins.ListModelMixin",
"line_number": 15,
"usage_type":... |
21795535523 | # (c) 2015-2018 Acellera Ltd http://www.acellera.com
# All Rights Reserved
# Distributed under HTMD Software License Agreement
# No redistribution in whole or part
#
import shutil
import subprocess
import os
from tempfile import TemporaryDirectory
from htmd.parameterization.ff import RTF, PRM, AmberRTF, AmberPRM
from ... | abdulsalam-bande/KDeep | training_with_htmd/htmd/parameterization/fftype.py | fftype.py | py | 7,314 | python | en | code | 19 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "shutil.which",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "shutil.which",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "shutil.which",
"line_number":... |
18101035660 | import asyncio
import sys
from idb.grpc.idb_pb2 import LaunchRequest, LaunchResponse
from idb.grpc.stream import Stream
async def drain_launch_stream(stream: Stream[LaunchRequest, LaunchResponse]) -> None:
async for message in stream:
pipe = message.pipe
if pipe:
if message.interface ... | WeilerWebServices/Facebook | idb/idb/grpc/launch.py | launch.py | py | 823 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "idb.grpc.stream.Stream",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "idb.grpc.idb_pb2.LaunchRequest",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "idb.grpc.idb_pb2.LaunchResponse",
"line_number": 8,
"usage_type": "name"
},
{
... |
34226733045 | from django.shortcuts import render, redirect
from dojos_ninjas_app.models import Ninja, Dojo
# Create your views here.
def index(request):
context = {
# 'all_dojos' : Dojo.objects.all()
'all_dojos' : Dojo.objects.all().order_by("city")#makes sure it is in alphabetical order
}
return rende... | qidCoder/python_ORM_dojoAndNinjasWithTemplate | dojos_ninjas_project/dojos_ninjas_app/views.py | views.py | py | 939 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dojos_ninjas_app.models.Dojo.objects.all",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "dojos_ninjas_app.models.Dojo.objects",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "dojos_ninjas_app.models.Dojo",
"line_number": 8,
"usage_... |
12524216541 | # ==============================================================
# 0. 라이브러리 불러오기
# ==============================================================
# --------------------------------------------------------------
# 1) 기본 라이브러리 불러오기
# --------------------------------------------------------------
import os
import argparse... | devappendCBangJ/CV_Block | Data/Image_Label Preprocessing/4_YOLO_Remove_All_ImageTextFile_Except_Specified_Class.py | 4_YOLO_Remove_All_ImageTextFile_Except_Specified_Class.py | py | 4,224 | python | ko | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.unlink",
"line_nu... |
41234449306 | import requests
import psycopg2
import random
from time import sleep
conn = psycopg2.connect(host="localhost",port="5432",dbname="football",user="postgres",password="placeholder")
conn.autocommit = True
if(conn):
print("successfully connected")
headers = {
"placeholder"
}
# populating match table
def populate_ma... | jeevanv26/football-visualizer | data/data_retrieval_two.py | data_retrieval_two.py | py | 4,360 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "psycopg2.connect",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.request",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "requests.request",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"l... |
34579270880 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 29 17:28:46 2020
@author: mattkelsey
"""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat May 9 16:19:37 2020
@author: mattkelsey
"""
# Import preliminary packages used for data import and analysis
import numpy as np
import pan... | wladykam/SpringboardTest | CapstoneProject2/CapstoneProject2FinalCode.py | CapstoneProject2FinalCode.py | py | 32,227 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_nu... |
32754183958 | import sys
from collections import defaultdict
try:
bgsu_csv_file = sys.argv[1]
except:
bgsu_csv_file = 'bgsu_3269_4A.csv'
pdb_chains_dict = defaultdict(list)
classes = []
with open(bgsu_csv_file, 'r') as f:
for line in f.readlines():
eq_class, representative, *_ = line.replace('"','').split(',')
... | baaagr/RNA_knots | 1_prepare.py | 1_prepare.py | py | 913 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "collections.defaultdict",
"line_number": 9,
"usage_type": "call"
}
] |
8125668422 | import yfinance as yf
import pandas as pd
import json
def main():
days_ago_list = [0,1,5,-1]
my_stonks = pd.read_csv('stonks.txt',delimiter='\t')
stonk_list = list_stonks(my_stonks)
stonk_dict = get_stonk_info(stonk_list)
with open('stonk_info.json','w') as outfile:
json.dump(stonk_dict,outfile)
def l... | jeremyjones1017/Mirror | stonks/download_stonk_info.py | download_stonk_info.py | py | 915 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "yfinance.download",
"line_number": 28,
"usage_type": "call"
}
] |
12418962113 | from logging import root
import pika
import os
connection = pika.BlockingConnection(pika.ConnectionParameters(host='trace-link.cloudjiffy.net', port='11362', credentials=pika.PlainCredentials('guest1','guest1') )) # works
#url = os.environ.get('amqps://rfnortyg:PVWhYAeWfb8kMPR2m38g2NycelEHftSO@rattlesnake.rmq.cloud... | capitalch/bika | lab/rabbitmq/python/send.py | send.py | py | 745 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pika.BlockingConnection",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pika.ConnectionParameters",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pika.PlainCredentials",
"line_number": 5,
"usage_type": "call"
}
] |
22207229195 | from collections import namedtuple
import argparse
import sys
manifest_file = namedtuple('manifest_file', ['manifest', 'packages'])
class manifest_package_action(argparse.Action):
def __init__(self, *args, **kwargs):
super(manifest_package_action, self).__init__(*args, **kwargs)
def __call__(self, ... | dglazkov/proto-sdk | sdk/tools/write_manifest.py | write_manifest.py | py | 1,084 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.namedtuple",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "argparse.Action",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sys... |
36965715137 | #coding=utf-8
import requests
import json
import time
import matplotlib.pyplot as plt
from datetime import datetime
import os
def get_config():
config_path = "config.json"
with open(config_path) as f:
config = json.loads(f.read())
return config
if __name__ == '__main__':
user_agent = 'Mozi... | zhuangbefree/interest | object/empy-wb.py | empy-wb.py | py | 2,398 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.ion",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.... |
24336945239 | from functools import reduce
from itertools import chain, combinations
from typing import Sequence
import torch
import torch.nn as nn
from utils import get_mean, kl_divergence
from vis import embed_umap, tensors_to_df
import pytorch_lightning as pl
import torchmoo as moo
from utils import log_mean_exp
def powerse... | adrianjav/impartial-vaes | multi-modal/models/multimodal.py | multimodal.py | py | 16,164 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "itertools.chain.from_iterable",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "itertools.combinations",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "... |
36797453014 | """Argument parser functions."""
import argparse
import sys
from src.config.defaults import get_cfg
from src.utils import pathutils
from src.config import custom_untracked_config, custom_tracked_config
def parse_args():
"""
Parse the following arguments for a default parser for users.
Args:
gpus... | KhaledElTahan/Real-World-Anomaly-Detection | src/utils/parser.py | parser.py | py | 4,894 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "argparse.REMAINDER",
"line_number": 106,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 109,
"usage_type": "attribute"
},
{
"api_name": "sys.a... |
28248277985 | """Converters that should not be used anymore but are
still available for backwards compatibility."""
import io
import numpy as np
from znjson.converter.numpy_converter_base64 import NumpyConverter
class NumpyConverterLatin1(NumpyConverter):
"""Old numpy converter"""
representation = "np.ndarray"
leve... | zincware/ZnJSON | znjson/converter/old_converters.py | old_converters.py | py | 807 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "znjson.converter.numpy_converter_base64.NumpyConverter",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "io.BytesIO",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.save",
"line_number": 18,
"usage_type": "call"
},
{
"api_... |
29650943396 | import sklearn.datasets as sk
import matplotlib.pyplot as plt
import numpy as np
from sklearn.cluster import KMeans
from matplotlib import style
from mpl_toolkits.mplot3d import Axes3D
from sklearn.metrics import f1_score
iris = sk.load_iris()
wine = sk.load_wine()
#print(iris.DESCR)
##############################
##... | ParadaSutachan/Proyecto_IA | KMeans.py | KMeans.py | py | 3,722 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sklearn.datasets.load_wine",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "... |
29591752753 | from typing import Callable, TypeVar, Generic, Optional, Mapping, Sequence, Union, MutableMapping, Tuple, Iterable, MutableSequence
from operator import add, sub, mul, truediv
from itertools import chain, cycle
from attr import attrs, attrib, Factory
T = TypeVar('T')
Instruction = TypeVar('Instruction')
TargetHandler ... | voidpointercast/pyvolution | pyvolution/models/machine/__init__.py | __init__.py | py | 5,300 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.TypeVar",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "typing.TypeVar",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "typing.Callable",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"lin... |
39238076504 | from __future__ import absolute_import
import pytest
import numpy as np
from scipy.spatial.distance import pdist
from nadist.pure import euclidean_pdist
class TestShapes:
def test_wrong_shape(self, dimension):
with pytest.raises(ValueError):
euclidean_pdist(dimension)
def test_mask_sha... | Midnighter/nadist | tests/test_pure_euclidean_pdist.py | test_pure_euclidean_pdist.py | py | 1,429 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pytest.raises",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "nadist.pure.euclidean_pdist",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "nadist.pure.e... |
10356765137 | import torch
import numpy as np
import torch.nn as nn
from torch.utils.data import DataLoader
import torch.nn.functional as F
# pylint: disable=E1101, W0612
class Network(nn.Module):
def __init__(self):
super(Network, self).__init__()
self.bn1 = nn.BatchNorm2d(1)
self.conv1 = nn.Conv2d(1, ... | remit0/SpeechRecognitionProject | legacy/model_4/model_cnn.py | model_cnn.py | py | 3,103 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.nn.BatchNorm2d",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line... |
13282500646 | """Simple folder explorer GUI using kivy. From the selected folder,
it shows the files and subfolders in is as well as the size of the
files and folders.
"""
import os
import logging
from functools import cache
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from k... | JoaoAreias/file-explorer | main.py | main.py | py | 3,550 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.isfi... |
42236705690 | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 4 13:55:16 2019
@author: Håkon Weydahl (weyhak@banenor.no)
Inneholder klasser som kan ta en mengde kodetabeller og hente ut informasjonen.
Bibliotektet som snakker med excel (xlrd) er testet kun på .xls-filer.
Dersom kodetabellen er i det nyere .xlsx-formatet kan kode... | wehak/saktekjoring_materiell | kodetabellHelpers.py | kodetabellHelpers.py | py | 32,372 | python | no | code | 0 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "xlsxwriter.Workbook",
"line_number": 123,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"li... |
9882389015 | import pandas as pd # for working with data in Python
import numpy as np
import matplotlib.pyplot as plt # for visualization
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
from sklearn import linear_model
# use Pandas to read in csv files.... | Ariful491/H-S-Ariful | home.py | home.py | py | 7,101 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib... |
22080656627 | import json, os
#in JSON file, we should have keys representing board; and add them to dict
#if you get to that key in a bigger depth then update it...
file = open('./database.json', 'r')
database = dict(json.load(file))
n, m = 4, 4
starting_depth = 7
def make_str_binary(s : list) -> str:
new_s = ''
for i... | yunusey/game-AIs | TicTacToe/game.py | game.py | py | 5,833 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 209,
"usage_type": "call"
}
] |
25928559063 | #######################################################
# Spiros Daskalakis #
# last Revision: 18/10/2023 #
# Python Version: 3.9 #
# Email: daskalakispiros@gmail.com #
# Website: www.daskalakispiros.... | daskals/AWS-Service-Latency-Diagnostic-Tool | check_latency.py | check_latency.py | py | 8,583 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "boto3.client",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 79... |
30313283333 | import pickle
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import tensorflow as tf
from pylab import rcParams
from scipy import stats
from sklearn import metrics
from sklearn.model_selection import train_test_split
sns.set(style='whitegrid', palette='muted', font_scale=... | SeethalRamakrishnan/Human-activity-recognition-using-smarphone-sensor | HAR.py | HAR.py | py | 6,985 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "seaborn.set",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pylab.rcParams",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "scipy.stats.mode",
"li... |
12576316349 | def fileReader(primerFile):
with open(primerFile,'r') as f:
primerInfo = f.readlines()
print(primerFile)
return primerInfo
def listCreator(primerFiles):
primerDict = {}
primerList = []
primerOrthList = []
for primers in primerFiles:
primerInfo = fileReader(prime... | Slucking/Code_Repository | T3Pio_Accessory/vennDiagram.py | vennDiagram.py | py | 3,028 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 90,
"usage_type": "call"
}
] |
73996828669 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Actor',
fields=[
('id', models.CharField(primar... | jayoshih/fle-starter-project | starter-master/starter/migrations/0001_initial.py | 0001_initial.py | py | 4,422 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.CreateModel",
"line_number": 13,
"usage_type": "call"
},
... |
39748770314 | import logging # to log module processes
from GTT.Ingest.PubMedArticle import PubMedArticle
from GTT.utils import chunks
from GTT.Service import Service
from Bio import Entrez
from datetime import datetime, timedelta
import inspect
from email.utils import parseaddr
class PubMed(Service):
... | sieniven/biobert-service | GTT/Ingest/PubMed.py | PubMed.py | py | 3,893 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "GTT.Service.Service",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "email.utils",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "GTT.Service.Service... |
17811917222 | import flask
from flask_bcrypt import Bcrypt
from flask_login import UserMixin, login_user, LoginManager, login_required, logout_user, current_user
from flask_sqlalchemy import SQLAlchemy
from wtforms.validators import ValidationError
from databases import FeedBackDataBase, ViewsDataBase
import logging
import co... | SS342/Profi | app.py | app.py | py | 4,120 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask_sqlalch... |
8724239036 | #!/usr/bin/env python3
from http.server import BaseHTTPRequestHandler, HTTPServer
hostName = ""
hostPort = 8555
def execute():
print("Script is being executed")
import subprocess
subprocess.call(['sh', './script.sh'])
class MyServer(BaseHTTPRequestHandler):
def do_POST(self):
print("Reques... | polakowo/py-webhook | webhook.py | webhook.py | py | 1,025 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "subprocess.call",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "http.server.BaseHTTPRequestHandler",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "http.se... |
30781251922 | import requests
from bs4 import BeautifulSoup
from fake_useragent import UserAgent
url = "https://www.soriana.com/pechuga-san-rafael-balance-pavo-250-g/2530899.html"
ua = UserAgent()
user_agent = ua.random
# Send an HTTP GET request to the URL
headers = {"User-Agent": user_agent}
response = requests.get(url, headers=... | nadien/front-scrapping | soriana/scraper.py | scraper.py | py | 1,564 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fake_useragent.UserAgent",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 15,
"usage_type": "call"
}
] |
16702999624 | import torch
from transformers import GPTJForCausalLM, GPT2Tokenizer
class InferlessPythonModel:
def initialize(self):
self.model = GPTJForCausalLM.from_pretrained(
"PygmalionAI/pygmalion-6b",
torch_dtype=torch.float16,
low_cpu_mem_usage=True
).cuda()
se... | ujjawalPeak01/Pygmalion | app.py | app.py | py | 928 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "transformers.GPTJForCausalLM.from_pretrained",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "transformers.GPTJForCausalLM",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.float16",
"line_number": 9,
"usage_type": "attribute"
},
... |
19363554878 | import numpy as np
import imageio as io
import cv2
import scipy.ndimage
def grayscale(rgb):
return np.dot(rgb[...,:3],[0.299,0.587,0.114])
def dodge(front,back):
result=front*255/(255-back)
result[result>255]=255
result[back==255]=255
return result.astype('uint8')
img="ankit_test.jpg"
read_img=io... | AnkitM18-tech/Random-Python | image_sketch.py | image_sketch.py | py | 474 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.dot",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "imageio.imread",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scipy.ndimage.ndimage.filters.gaussian_filter",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": ... |
73439284348 | import re
import copy
from utils.couchdb import fetch_doc, push_doc, fetch_docs_of_type
class DataModel():
def __init__(self, base_name):
self._id = type(self)._get_id(base_name)
self.type = type(self)._get_type()
self.ignored_keys = []
self.time = None
self.base_name = base_name
def __setitem__(self, k... | zruan/hotspur_command | data_models/data_model.py | data_model.py | py | 2,035 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "copy.copy",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "utils.couchdb.push_doc",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "utils.couchdb.fetch_doc",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "utils.couchd... |
70704960188 | def best_knn(samples = 500, feats = 5, classes = 2):
from sklearn.neighbors import KNeighborsClassifier
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from sklearn import metrics
import pandas as pd
import numpy as np
# Random state... | tomiiha/Machine_Learning | k_nearest_neighbor.py | k_nearest_neighbor.py | py | 1,857 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.datasets.make_classification",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.neighbors.KNeighborsClassifier",
"line_number": 26,
"usage_type": "call"
},
{... |
1998792616 | # -*- coding: utf-8 -*-
import mysql.connector
import json
with open("data_v2.json", "r", encoding="utf-8") as fp:
Dico = json.load(fp)
def GetGenres():
genre = {}
for i in Dico.values():
if "genres" in i.keys():
for j in i["genres"]:
genre[j["name"]] = int(j['id'])
... | MaximCosta/DBAnimeConstructor | InsertToMYSQL.py | InsertToMYSQL.py | py | 2,555 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector.connect",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_nam... |
26113671525 | import datetime
import logging
import numbers
import os
import fabio.file_series
import numpy
from . import commonh5
from silx import version as silx_version
import silx.utils.number
import h5py
_logger = logging.getLogger(__name__)
_fabio_extensions = set([])
def supported_extensions():
"""Returns all exte... | silx-kit/silx | src/silx/io/fabioh5.py | fabioh5.py | py | 36,065 | python | en | code | 106 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "fabio.file_series.fabioformats.get_classes",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "fabio.file_series.fabioformats",
"line_number": 31,
"usage_type": "attribute... |
14345795664 | '''
Imagine that an automobile manufacturer has developed prototypes for a
new vehicle. Before introducing the new model into its range,
the manufacturer wants to determine which existing vehicles on the
market are most like the prototypes--that is, how vehicles can be grouped,
which group is the most similar with... | Acilikola/MachineLearning_Python | 4_5-HierarchicalClustering.py | 4_5-HierarchicalClustering.py | py | 6,047 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.to_numeric",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "sklearn.preprocessing.MinMaxScaler",
"line_number": 45,
"usage_type": "call"
},
{
"api_nam... |
20481414036 | # Henry Jacobson, Simulation and Modeling, KTH 2020
################## Imports ##################
from ML import *
from time import time
from itertools import cycle
import sys
#############################################
############ Calculate flowrate #############
def flowrate_calculation(traffic_obj):
""" Ret... | henryjac/TrafficSimulation | src/analysis.py | analysis.py | py | 20,071 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "itertools.cycle",
"line_number": 314,
"usage_type": "call"
},
{
"api_name": "itertools.cycle",
"line_number": 316,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 369,
"usage_type": "name"
},
{
"api_name": "sys.argv",
"line_num... |
39248287805 | from flask import send_file, Response
import json
import os
from random import randint
from requests import codes
from fashion.database import get_fashion_items
import fashion.images as IMAGES
def validate(page):
value = int(page)
if value <= 0:
raise ValueError
return value
def create_routes(a... | leightonlee/fashion | fashion/routes.py | routes.py | py | 2,543 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fashion.database.get_fashion_items",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "requests.codes.BAD_REQUEST",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "requests.codes",
"line_number": 38,
"usage_type": "name"
},
{
... |
71748016187 | import cv2
import numpy as np
import sys
def Inverse_G_correction(c):
if(c<0.03928):
c = float(c)/12.92
else:
c = (float(c+0.055)/1.055)**2.4
return c
def gammacorrection(c):
if (c<0.00304):
c = c*12.92
else:
c = (1.055*(c**(1/2.4)) - 0.055)
return c
def conve... | shashidonthiri9/LinearScaling-and-Histogram-Eq | CV_project1/cv_1.py | cv_1.py | py | 5,024 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.zeros",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.float",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "numpy.float",
"line_numb... |
24134070824 | import pygame, time
pygame.init()
pygame.mixer.quit()
print("start")
promoVideo = pygame.movie.Movie("./resources/promoVideo.mpg")
while True:
totalScreen = pygame.display.set_mode((1000, 1000))
promoVideo.set_display(totalScreen)
for i in range(1):
pygame.display.flip()
... | wichersn/charityGame | other/testMovie.py | testMovie.py | py | 516 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pygame.mixer.quit",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pygame.movie.Movie",
... |
43470118995 | import scipy.io
import numpy as np
from scipy.io.wavfile import write
def loadData():
data = scipy.io.loadmat('input/sounds.mat')['sounds']
return data
def scale_data(data_matrix):
data_matrix /= np.max(np.abs(data_matrix), axis=0)
return data_matrix
def createAudioFile(data_matrix, directory_name... | anuparna/ICA | processData.py | processData.py | py | 739 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "scipy.io.io.loadmat",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "scipy.io.io",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "scipy.io",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "numpy.max",
"line_numb... |
342729082 | import time
import numpy as np
from matplotlib import pyplot as plt
from sklearn.cluster import KMeans
from cv2 import cv2 as cv
from color_conversion import *
from sklearn.utils.testing import ignore_warnings
from sklearn.exceptions import ConvergenceWarning
class ColorTuneAnalyzer:
def __init__(s... | Question406/More-Colorful-Subtitles | src/ColorTuneAnalyzer.py | ColorTuneAnalyzer.py | py | 5,396 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.random.seed",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.randint",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.random... |
33039025413 | import numpy as np
import cv2
import pickle
import glob
import matplotlib.pyplot as plt
import Image_processing_functions as IPF
import sys
import function_parameters as FP
def main():
if len(sys.argv) == 2:
img_arg=sys.argv[1]
print('Processing image: '+img_arg)
else:
img_arg='frame'+s... | Domagoj-Spoljar/-Python-Algoritam-Prepozunavanje-vozne-trake | Process_image_new.py | Process_image_new.py | py | 28,055 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "function_parameters.frame",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "function_p... |
43722145167 | import feedparser
import pprint
import json
from HTMLParser import HTMLParser
from feedgen.feed import FeedGenerator
from xml.sax.saxutils import escape, unescape
class MyHTMLParser(HTMLParser):
last_link = ''
real_url = ''
def handle_starttag(self, tag, attrs):
if tag == 'a':
for attr... | eugenekolo/rss-cleaner | rss-cleaner.py | rss-cleaner.py | py | 1,386 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "HTMLParser.HTMLParser",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "feedparser.parse",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "feedgen.feed.FeedGenerator",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "xml.... |
43968694430 |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a script that determines what batters from 2000 to 2021 had a good performance in effort of m
"""
import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
batting_table=pd.read_csv(r"//Users//mariopadilla//Documents//Python Scripts//bas... | mpadill6/Projects | Batting.py | Batting.py | py | 1,404 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.axes",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 37,
"usage_type": "name"
}
] |
29543060952 | """
Difficulty: Medium
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order,
and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.
You may assume the two numbers do not contain any leading zero, exce... | ali-izhar/daily-commit-challenge | linkedList/addTwoNumbers.py | addTwoNumbers.py | py | 1,981 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "typing.Optional",
"line_number": 35,
"usage_type": "name"
}
] |
24093492285 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
from datetime import datetime, timedelta
from sqlalchemy import Table, Column, Integer, Float, Unicode, Boolean, DateTime, func, or_
from sqlalchemy.ext.associat... | hitokiri8x/Flexget | flexget/plugins/api_tmdb.py | api_tmdb.py | py | 11,129 | python | en | code | null | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flexget.db_schema.versioned_base",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flexget.db_schema",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "... |
25728823870 | import numpy as np
from flask import Flask, request, jsonify, render_template
import pickle
# Create flask app
app = Flask(__name__)
model = pickle.load(open("model.pkl", "rb"))
def resultat():
l=np.zeros(8)
l[7]= request.form['nbexp']
sexe=request.form['sexe']
if sexe=="F":
l[0]=1
if sex... | saad167/flask_ML | app.py | app.py | py | 1,103 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
"line_numb... |
21764153922 | # Approach 1: Backtracking
# Time: O((n-1)!)
# Space: O(n)
from collections import defaultdict
class Solution:
def minTransfers(self, transactions: List[List[int]]) -> int:
balance_map = defaultdict(int)
for a, b, amount in transactions:
balance_map[a] += amount
balance_ma... | jimit105/leetcode-submissions | problems/optimal_account_balancing/solution.py | solution.py | py | 961 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 10,
"usage_type": "call"
}
] |
27341244908 | # Implementation of the following tabular action value reinforcement learning methods:
# - SARSA [1]
# - SARSA(lamda) [2]
# - Q-learning [3]
# - Watkins Q-learning(lamda) [4]
# to be used with OpenAI Gym environments. Demonstrations are included with the
# following environments: FrozenLake-v0.
... | RicardoDominguez/RL-Intro | agentTabular.py | agentTabular.py | py | 11,288 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "numpy.ones",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 112,
"usage_type": "call"
},
{
"api_name": "numpy.random.random",
"line_number": 125,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line... |
41685831309 | import re
import pathlib
import shutil
def patter_match(org_name):
copied_location= "roles-{}-new.yml.txt".format(branch_name)
shutil.copyfile(file_location,copied_location)
#append_string = ''
for _name_org in org_name:
append_string = ''
match_pattern= r'Below are set of default roles... | sudhann92/project-repo | python-module/append-new-role.py | append-new-role.py | py | 2,353 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "shutil.copyfile",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 32,
"usage_type": "call"
}
] |
21226178197 | from rest_framework import serializers
from django.utils.timezone import now
from usersapp.models import User
from surveyapp.models import Survey, Question, AnswerQuestion, AnswerUser
import json
class SurveySerializer(serializers.ModelSerializer):
class Meta:
model = Survey
fields = '__all__'
... | AlekseiPolianskii/test_api_FR | apiapp/serializers.py | serializers.py | py | 4,704 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "surveyapp.models.Survey",
"line_number": 10,
"usage_type": "name... |
7911915530 | '''
Created on 2010-03-24
@author: mdk
'''
from executor import Executor
import logging, os
log = logging.getLogger('Comparators')
class WrongAnswerError(Exception): pass
def defaultDiff(ctx):
log.debug('Comparing %s and %s', ctx.outputfile, ctx.difffile)
e = Executor()
e.command = '/usr/bin/diff'
... | kmagiera/pyza | src/pyza/comparators.py | comparators.py | py | 1,086 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "executor.Executor",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_... |
72682448828 | from typing import ItemsView
class ShoppingCart:
def __init__(self):
self.list_items = []
self.total_price = 0
def additems(self, item, item_price):
self.list_items.append(item)
self.total_price += float(item_price)
def removeitems(self, item, item_price):
... | georgelembah/calculator | calculator.py | calculator.py | py | 1,215 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.ItemsView",
"line_number": 37,
"usage_type": "argument"
}
] |
617725049 | from keras.applications import inception_v3,imagenet_utils
import cv2
import numpy as np
from flask import Flask, request, make_response,jsonify
import numpy as np
import json
import urllib.request
from urllib.request import Request, urlopen
import base64
import numpy as np
from flask import Flask, render_template, re... | akshaybhatia10/DeepClassifyML | server.py | server.py | py | 2,788 | python | en | code | 17 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGRA2BGR",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "cv2.resize",
"li... |
28998365539 | #!/usr/bin/env python3
import argparse
import pandas as pd
import numpy as np
import json
from sqlalchemy import exc
import sys
import os
sys.path.append("..")
from strAPI.repeats.models import Gene, Repeat, TRPanel, AlleleFrequency
from gtf_to_sql import connection_setup
def cla_parser():
parser = argparse.A... | acg-team/webSTR-API | database_setup/import_data_ensembltr.py | import_data_ensembltr.py | py | 8,482 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.listdir",
... |
27781065288 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Explore-Exploit fMRI: Neuron Paper
Finds participants with > 3 SD above the mean framewise displacement across task runs
author: jeremy hogeveen (jhogeveen@unm.edu)
last edit: March 9, 2022
"""
#%% PREAMBLE
# Importing modules for the script
import glob
import os
imp... | hogeveen-lab/exploreExploit_fmri_distrib | 4_fmri_motion_outliers.py | 4_fmri_motion_outliers.py | py | 2,131 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
11937567777 | import os
import pandas as pd
import argparse
from scipy.stats import kendalltau
from pygest.convenience import get_ranks_from_tsv_file
class Ktau:
""" A command to convert csv or tsv files to dataframes """
# Normally, all commands would inherit from Command, but this is a simple command that needs none of ... | mfschmidt/PyGEST | pygest/cmdline/ktau.py | ktau.py | py | 1,683 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pygest.convenience.get_ranks_from_tsv_file",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pygest.convenience.get_ranks_from_tsv_file",
"line_number": 38,
"usage... |
73995680509 | import ttools.movement as tmo
from tdmclient import ClientAsync
import cv2
def object_rec(img):
# Convert to graycsale
img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# Blur the image for better edge detection
img_blur = cv2.GaussianBlur(img_gray, (3, 3), 0)
# Sobel Edge Detection
# sobelx = ... | Jayordo/thymio_aseba_install | dev_dir/edge_detection_example.py | edge_detection_example.py | py | 1,594 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.cvtColor",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cv2.GaussianBlur",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.Canny",
"... |
27075397586 | from typing import Iterable, Union
import numpy as np
import torch
from torch.nn import Conv1d, Conv2d, Conv3d
import torch.nn.functional as F
from .fisher_block import ExtensionFisherBlock
from ..utils import append_homog, center, compute_cov
class ConvFisherBlock(ExtensionFisherBlock):
def __init__(
se... | n-gao/pytorch-kfac | torch_kfac/layers/conv_block.py | conv_block.py | py | 4,808 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "fisher_block.ExtensionFisherBlock",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv1d",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torch.... |
10952433357 | import numpy as np
import pandas as pd
import tensorflow as tf
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
import os
from time import time
from sys import exit
import headers
# tf.enable_eager_execution()
dir_path = os.path.dirname(os.path.realpath(__file__))
sessions_csv =... | Kakemixen/ACM_recsys_ML | FM_code/tf_adagrad.py | tf_adagrad.py | py | 7,036 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tensorflow.placeholder"... |
22786214156 | import sheetUpdater
def lambda_handler(event, context):
from datetime import date
import time
epoch_time = int(time.time())
today = date.today()
date = today.strftime("%B %d")
sheetUpdater.updater(epoch_time)
return {
'statusCode': 200,
'body': "Successfully updated spr... | howdym/SpotifyUpdater | lambda_function_test2.py | lambda_function_test2.py | py | 387 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.date.today",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "datetime.date",
"line_... |
42367862023 | from urllib.request import urlopen
import cv2
import numpy as np
import matplotlib.pyplot as plt
class Utils:
@staticmethod
def fetch_image(url, flag=cv2.IMREAD_COLOR):
req = urlopen(url)
image = np.asarray(bytearray(req.read()), dtype="uint8")
return cv2.imdecode(image, flag)
@s... | Resetand/opencv-labs | lib/utils.py | utils.py | py | 1,120 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.IMREAD_COLOR",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.imdeco... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.