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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
42565102000 | #coding:utf8
'''
@author: chin
@date: 2016年6月21日
'''
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
import json
import pandas as pd
matplotlib.rcParams['font.sans-serif'] = ['SimHei']
matplotlib.style.use('ggplot')
plt.figure(figsize=(12,6))
def visual_diffalg():
'''
比较几种不同的cache alg之间在... | TVect/DesignAnalysis | apps/cache_case/simulator/result/visualization.py | visualization.py | py | 2,399 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "matplotlib.rcParams",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.style.use",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.style",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "m... |
11840581052 | from . import mailchimpHandler
from datetime import date
from dashboards.models import Integrations_MailChimp_Campaigns, Integrations_MailChimp_CampaignReports, Integrations_MailChimp_Campaigns_Bl_Insights
from django.db import transaction
from django.utils import timezone
class CampaignHandler(mailchimpHandler.Mail... | websperoops/devops-test | dashboards/integrations/mailchimp/campaignHandler.py | campaignHandler.py | py | 7,432 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.db.transaction.atomic",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.db.transaction",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "django.db.transaction.atomic",
"line_number": 26,
"usage_type": "call"
},
{
"a... |
73930116479 | import unittest
import dictlistdict
import json
from pathlib import Path
import os
def loadJSON(name, encoding):
with open(name, "r", encoding=encoding) as input_file:
return json.load(input_file)
class TestDictListDict(unittest.TestCase):
def test_GenerateName(self):
name = "dummy.json"
... | jdrumgoole/nesteddict | test_dictlistdict.py | test_dictlistdict.py | py | 1,387 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "json.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "dictlistdict.GenerateName",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pathlib.Pat... |
33789875381 | from fastapi import APIRouter, Cookie, Depends
from fastapi.encoders import jsonable_encoder
from sqlalchemy.ext.asyncio import AsyncSession
from starlette import status
from starlette.responses import JSONResponse
from typing_extensions import Annotated
from fastapi_app.api import jwt_authenticator, oauth2_scheme
fro... | zaqbez39me/Timer-management-Web-App | fastapi_app/api/views/token.py | token.py | py | 3,279 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "typing_extensions.Annotated",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "fastapi.Depends",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "fastapi... |
71349879359 |
# -*- coding: utf-8 -*-
import json
import pika
class Sender(object):
def __init__(self):
parameters = pika.ConnectionParameters(host='localhost')
self.connection = pika.BlockingConnection(parameters)
self.channel = self.connection.channel()
def send(self,message,exchange='testfan'... | zhaoxuhua/testfan | utils/sender.py | sender.py | py | 1,053 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pika.ConnectionParameters",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pika.BlockingConnection",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 19,
"usage_type": "call"
}
] |
36824512882 | # Django импорт
from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.views.generic import ListView, DetailView
from django.db.models import F, Q
from django.core.exceptions import ObjectDoesNotExist
# DRF импорт
from rest_framework import viewsets
# Собственный импорт
from .m... | YashinIlya1996/boardgame_django | bg_project/apps/boardgames/views.py | views.py | py | 3,046 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "django.views.generic.ListView",
"line_number": 32,
"usage_type": "name"
},
{
"a... |
34053554599 | import matplotlib.pylab as plt
import os
def plot_comparison(old_mcmc_samples, cv_linear_mcmc_samples, cv_quad_mcmc_samples, fig_path='savefig', fig_name='figure.png', fig_size=(8, 8)):
num_samples = old_mcmc_samples.shape[0]
dim = old_mcmc_samples.shape[1]
fig, ax = plt.subplots(dim, figsize=fig_size)
... | zhouyifan233/PyStan_control_variate | ControlVariate/plot_comparison.py | plot_comparison.py | py | 1,069 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "matplotlib.pylab.subplots",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pylab",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
24065608812 | from dask import delayed
from dask.diagnostics import Profiler, ResourceProfiler, CacheProfiler,\
visualize, ProgressBar
import dask
class ForLoop:
def __init__(self, inputs, func, merge_func=None, **kwargs):
results = []
for data in inputs:
result = func(data, **kwargs)
... | qutang/padar_parallel | padar_parallel/for_loop.py | for_loop.py | py | 1,120 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "dask.diagnostics.Profiler",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "dask.diagnostics.ResourceProfiler",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "dask.diagnostics.CacheProfiler",
"line_number": 19,
"usage_type": "call"
},... |
21802912626 | '''
Created on Jun 4, 2013
@author: Jeff
'''
import sys, os
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import numpy as np
import Image
from scipy import ndimage
import matplotlib
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import Na... | jjberry/EchoTools | EchoTools/maxMovement.py | maxMovement.py | py | 8,137 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.zeros",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.bool",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "numpy.load",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.logical_not",
"line_... |
36395595031 | #!/usr/bin/env python
# Tai Sakuma <sakuma@fnal.gov>
import ROOT
import sys
import json
ROOT.gROOT.SetBatch(1)
##____________________________________________________________________________||
def noEvents(inputPathList):
if len(inputPathList) == 0: return True
for inputPath in inputPathList:
if getNEv... | TaiSakuma/mianlibs | funcCMSSW.py | funcCMSSW.py | py | 2,416 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "ROOT.gROOT.SetBatch",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "ROOT.gROOT",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "ROOT.TFile.Open",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "ROOT.TFile",
"l... |
33255980316 | """
Plotting support using bokeh & Jupyter
"""
from bokeh.models import GMapOptions
from bokeh.plotting import gmap, GMap
from geopy import Point
from geopy.distance import distance
import math
import os
import pandas
from typing import Sequence, Tuple, Union
from missilemap import Sighting
def render_path(figure: ... | gshklover/missile-map | server/simulator/plotting.py | plotting.py | py | 4,163 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "bokeh.plotting.GMap",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Sequence",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "geopy.Point",
"l... |
70695182719 | import cv2
import numpy as np
import sys
import math
sys.setrecursionlimit(100000)
point_tree_y=[]
point_tree_x=[]
detedge=[]
def initialize():
global point_tree_x,point_tree_y
point_tree_x=[]
point_tree_y=[]
def getDetedge():
return detedge
class UnionFind():
def __init__(self, n):
self.n = n
... | hackathonNIT/piction | piction/Algorithm.py | Algorithm.py | py | 4,851 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.setrecursionlimit",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 100,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 100,
"usage_type": "attribute"
},
{
"api_name": "cv2.flip"... |
29964846021 | import csv, json
INPUT_FILE = 'testing/input.csv'
OUTPUT_FILE = 'testing/output.csv'
def import_urls():
urls = []
with open(INPUT_FILE, 'r') as csv_file:
csv_reader = csv.reader(csv_file)
for row in csv_reader:
urls.append(row[0])
assert urls, 'No urls found in ' + INPUT_FILE
... | Manoj-nathwani/simple-web-scraping-platform | utils/intput_output.py | intput_output.py | py | 690 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "csv.reader",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 23,
... |
72157975678 | from flask import Flask, request, render_template
from stories import *
app = Flask(__name__)
@app.route("/form")
def show_form():
return render_template("form.html")
@app.route("/story")
def show_madlib():
p = request.args["place"]
n = request.args["noun"]
v = request.args["verb"]
adj = reques... | NDean1006/madlibs- | app.py | app.py | py | 524 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "flask.request... |
31172010465 | # -*- coding: utf-8 -*-
"""
@date: 2020/8/14 下午10:34
@file: utility.py
@author: zj
@description:
"""
import os
import yaml
def get_file_dir():
file_path = os.path.realpath(__file__)
file_dir = os.path.split(file_path)[0]
return file_dir
def parse_config(config_file=None):
if not config_file:
... | zjykzj/zlogo | zlogo/util/utility.py | utility.py | py | 875 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.path.realpath",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.split",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numbe... |
43517983350 | # pylint: disable=missing-docstring, invalid-name, wrong-import-position
import os
import pytest
import numpy as np
# for local pytest
# import sys
# sys.path.append("/home/arunkhattri/github/unittesting/src/")
from features.as_numpy import get_data_as_numpy_array
@pytest.fixture
def clean_data():
file_path = "cl... | arunkhattri/unittesting | tests/features/test_as_numpy.py | test_as_numpy.py | py | 1,196 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.remove",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.remove",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_nu... |
20612695262 | # -*- coding: utf-8 -*-
import sys
from typing import TYPE_CHECKING
# NOTE:
# Do not import anything here that is not part of the python standard library.
# Any external package could still not yet be installed when importing the package
# to access high-level information such as the metadata (__meta__.py).
if ... | Ouranosinc/cowbird | cowbird/__init__.py | __init__.py | py | 2,159 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "cowbird.constants.get_constant",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "cowbird.utils.get_logger",
"line_number": 28,
"usage_type": "call"
},
{
"api_... |
30883967988 | import logging
import multiprocessing
import gunicorn.app.base
from app import configure, create_app, start, load_static_assets, \
load_static_lib
from app.config import parser, settings
gunicorn.SERVER_SOFTWARE = 'gunicorn' # hide gunicorn version
LOCAL_ENVS = ["LOCAL", "DEV"]
logger = logging.getLogger(__na... | SiriusWhi/Amera_SAAS | web/run.py | run.py | py | 2,891 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "gunicorn.app.base.SERVER_SOFTWARE",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "gunicorn.app.base",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_na... |
34913135992 | from linotp.lib.crypto.utils import compare
"""
Declare the SecretObject to encapsulate security aspects
"""
import base64
import binascii
import ctypes
import hmac
import json
import logging
import os
import stat
import struct
import sys
from crypt import crypt as libcrypt
from Cryptodome.Cipher import AES
from pys... | LinOTP/LinOTP | linotp/lib/crypto/__init__.py | __init__.py | py | 7,215 | python | en | code | 484 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "linotp.lib.crypto.utils.decrypt",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "linotp.lib.crypto.utils",
"line_number": 62,
"usage_type": "name"
},
{
"api_nam... |
11736109520 | from pyramid.security import Allow
from pyramid.security import Deny
from pyramid.security import Everyone
from pyramid.traversal import find_interface
from pyramid.traversal import resource_path
from karl.models.interfaces import IIntranets
from karl.models.interfaces import IUserAddedGroup
from karl.models.interface... | karlproject/karl | karl/workflow.py | workflow.py | py | 12,789 | python | en | code | 48 | github-code | 97 | [
{
"api_name": "karl.utils.find_catalog",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "karl.security.workflow.postorder",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "karl.utils.find_peopledirectory_catalog",
"line_number": 61,
"usage_type": "call... |
36367586789 | from logging import Logger
import pandas as pd
import torch
import torchaudio
from torch.utils.data import Dataset
from torchaudio.transforms import Spectrogram
from torchvision.transforms import Resize
class WavDataset(Dataset):
"""
Dataset for comfortable getting audio files as tensors and their labels
... | VladimirMynka/ML-3-Hotword-Detection | src/pipelines/train/wav_dataset.py | wav_dataset.py | py | 1,543 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "logging.Logger",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torchau... |
34521555422 | from pyramid.config import Configurator
from vctweb.resources import Root
from vctweb import views
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
config = Configurator(root_factory=Root, settings=settings)
config.add_route('home', '/', view=views.home, r... | ccomb/vct.web | vctweb/__init__.py | __init__.py | py | 1,424 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pyramid.config.Configurator",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "vctweb.resources.Root",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "vctweb.views.home",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name":... |
9191065515 | from __future__ import print_function, division, absolute_import
from fontTools import ttLib
from collections import OrderedDict
import argparse
import re
__version__ = '0.1'
uniname_RE = re.compile(r"""((uni)|(u)) # match "uni" or "u"
((?(2)([0-9A-F]{4})) # if "uni" mat... | daltonmaag/scope-one | tools/rename.py | rename.py | py | 3,785 | python | en | code | 24 | github-code | 97 | [
{
"api_name": "re.compile",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.X",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "re.match",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_num... |
716554025 | import unicodedata
from django.http import HttpRequest
from events.utils import (
get_business_id,
get_organization_name,
PROVIDER_BUSINESS_ID_FIELD,
PROVIDER_NAME_FIELD,
)
EVENT_BASE_DATA = {
"offers": [
{
"is_free": True,
"price": {"fi": "", "sv": "", "en": ""},
... | City-of-Helsinki/yjdh | backend/tet/events/transformations.py | transformations.py | py | 3,251 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "unicodedata.lookup",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "events.utils.PROVIDER_NAME_FIELD",
"line_number": 63,
"usage_type": "name"
},
{
"api_name": "events.utils.get_organization_name",
"line_number": 63,
"usage_type": "call"
},
{... |
16832118148 | from preprocessing import *
from tqdm import tqdm
import argparse
import matplotlib.pyplot as plt
import bar_chart_race as bcr
def from_millis_to_minutes(millis: float) -> float:
return round(millis / (1000*60), 2)
def from_minutes_to_millis(minutes: float) -> float:
return (minutes * (1000*60))
def gath... | silvia-cor/lyrics_analysis | random_plots.py | random_plots.py | py | 6,695 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tqdm.tqdm",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "bar_chart_race.bar_chart_race",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentPa... |
5389726940 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
df_adm = pd.read_csv('/Users/KexinHuang/Downloads/ADMISSIONS.csv')
df_adm.ADMITTIME = pd.to_datetime(df_adm.ADMITTIME, format = '%Y-%m-%d %H:%M:%S', errors = 'coerce')
df_adm.DISCHTIME = pd.to_datetime(df_adm.DISCHTIME, format = '%Y-%m-%d %H:%M:%S... | kexinhuang12345/clinicalBERT | preprocess.py | preprocess.py | py | 9,942 | python | en | code | 318 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime... |
41945581509 | from abc import ABC
import loralib as lora
import torch
from chatgpt.dataset import RewardDataset
from chatgpt.models.loss import PairWiseLoss
from torch.optim import Adam, Optimizer
from torch.utils.data import DataLoader
from tqdm import tqdm
from .strategies import Strategy
from .utils import is_rank_0
class Rew... | airobotlab/KoChatGPT | colossalai_ChatGPT_230319/chatgpt/trainer/rm.py | rm.py | py | 3,994 | python | en | code | 280 | github-code | 97 | [
{
"api_name": "abc.ABC",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "strategies.Strategy",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "torch.optim.Optimizer",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "chatgpt.dataset.Rew... |
8891297295 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Factory that returns all the algorithms fron the project that are finall.
"""
from __future__ import print_function
import importlib
# pylint-disable: wrong-import-order
from ag_frame.algorithms.representations.mutations import base
from ag_frame import exceptions
PR... | mateimicu/ag_frame | ag_frame/algorithms/representations/mutations/factory.py | factory.py | py | 1,049 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "importlib.import_module",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "ag_frame.algorithms.representations.mutations.base.BaseMutation",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "ag_frame.algorithms.representations.mutations.base",... |
26204834003 | import os
import platform
from ctypes import (
POINTER,
byref,
WinDLL,
c_char_p,
c_uint8,
c_uint16,
c_uint32,
c_int,
c_int8,
c_int16,
c_int32,
c_long,
c_char,
c_ubyte,
c_float,
c_double,
c_void_p,
)
from enum import IntEnum, auto
# Buffer sizes
ERROR... | EzekielDaun/hp816x-py | src/hp816x.py | hp816x.py | py | 153,295 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "ctypes.c_long",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "ctypes.c_long",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "ctypes.c_int",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "ctypes.c_int",
"line_num... |
493512677 | from wtforms import Form, TextField, TextAreaField, validators, StringField, SubmitField
from datetime import date, datetime, timedelta
import python.database_static as database_static
import mysql.connector
class ReusableForm(Form):
flower = TextField('Flower:', validators=[validators.required()])
device = Te... | Spartriatez/sys_nawadniania_2 | python/addflower.py | addflower.py | py | 3,894 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "wtforms.Form",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "wtforms.TextField",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "wtforms.validators.required",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "wtforms.valid... |
26347213018 | from pathlib import Path
from setuptools import find_packages
from setuptools import setup
def get_version():
"""Parse package __version__.py to get version."""
versionpy = (Path('detect_secrets') / '__version__.py').read_text()
return versionpy.split("'")[1]
VERSION = get_version()
with open('README... | bridgecrewio/detect-secrets | setup.py | setup.py | py | 2,146 | python | en | code | null | github-code | 97 | [
{
"api_name": "pathlib.Path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 23,
"usage_type": "call"
}
] |
8644573183 | from typing import List, Optional, TYPE_CHECKING
import os
from datetime import datetime
from time import sleep
from tg_bot import TG_BOT
from gptapi import GPT_API
from dotenv import load_dotenv
from nltk.tokenize import RegexpTokenizer
from word_lists import DOGBOT_TRIGGERS, BAD_WORDS
from functools import wraps
from... | AntonZamyatin/dogGPT | dogbot.py | dogbot.py | py | 3,731 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "tg_bot.TG_BOT",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "gptapi.GPT_API",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "logger.Logger",
... |
7622965020 | import pymongo
import pymongo.errors
from be.model.collection import Collection
from be import conf
import re
import base64
class Search():
def __init__(self):
self.bookCollection = Collection("book").collection
self.bookCollection.create_index([("id", 1)], unique=True)
self.bookCollectio... | PaperL/Bookstore_Eewat_MongoDB | bookstore/be/model/search.py | search.py | py | 4,970 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "be.model.collection.Collection",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "be.model.collection.Collection",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "base64.b64encode",
"line_number": 23,
"usage_type": "call"
},
{
"ap... |
14909034377 | # This files contains your custom actions which can be used to run
# custom Python code.
#
# See this guide on how to implement these action:
# https://rasa.com/docs/rasa/core/actions/#custom-actions/
# This is a simple example for a custom action which utters "Hello World!"
from typing import Any, Text, Dict, List
... | Jviejo/rasa_poc | pagar/actions.py | actions.py | py | 2,835 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rasa_sdk.Action",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Text",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "rasa_sdk.Tracker",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "rasa_sdk.events.SlotSet"... |
32049453526 | from scraper.Scraper import Scraper
from utils import (publish, publish_logo, create_job, show_jobs)
url = " https://careers.smartrecruiters.com/PublicisGroupe/api/more?search=Romania&type=location%2C%20RO&"
company = "PublicisGroupe"
finalJobs = list()
page = 0
scraper = Scraper()
scraper.get_from_url(url + f"page={... | peviitor-ro/based_scraper_py | sites/publicisgroupe.py | publicisgroupe.py | py | 980 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "scraper.Scraper",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "scraper.Scraper.Scraper",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "scraper.Scraper.get_from_url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sc... |
651448043 | #Biblioteca que permite trabalhar com datas
from datetime import date
# listas dos grupos
Junior = []
Regular = []
Master = []
Senior = []
print('Digite 10 datas de nascimento:')
for i in range(0, 10):
data_nascimento = list(map(int, input('Data %.2d (DD/MM/AAAA): ' % (i + 1)).split('/'))) # ler as data de nasci... | andel-vitorio/Scripts | Python/idades.py | idades.py | py | 1,106 | python | pt | code | 1 | github-code | 97 | [
{
"api_name": "datetime.date.today",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "datetime.date",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"... |
1749099846 | import torch
from modules import shared
def get_next_logits(prompt):
tokens = shared.tokenizer.encode(prompt, return_tensors='pt').cuda()
output = shared.model(input_ids=tokens)
scores = output['logits'][-1][-1]
probs = torch.softmax(scores, dim=-1, dtype=torch.float)
topk_values, topk_indices ... | oobabooga/text-generation-webui | modules/logits.py | logits.py | py | 605 | python | en | code | 27,409 | github-code | 97 | [
{
"api_name": "modules.shared.tokenizer.encode",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "modules.shared.tokenizer",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "modules.shared",
"line_number": 7,
"usage_type": "name"
},
{
"api_nam... |
22811950488 | from importlib import reload
import numpy as np
import time
from . import camera
reload(camera)
class CitCamera(camera.Camera):
filePrefix = 'PFCC'
def __init__(self, **kw):
super().__init__(**kw)
self.logger.info('cit...')
self._exptime = 0.5
def _camConnect(self)... | Subaru-PFS/ics_cobraCharmer | python/ics/cobraCharmer/cobraCoach/mcs/citCam.py | citCam.py | py | 1,606 | python | en | code | 6 | github-code | 97 | [
{
"api_name": "importlib.reload",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "Camera.andor.Andor",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "Camera.andor",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"lin... |
25849127270 | # pca
#%%
import sys
sys.path.append('/Users/dorowiemann/Documents/_Uni/_SJTU_PowerMaps/Learning-Driven-Power-Maps/import')
import numpy as np
import pandas as pd
from pandas.plotting import register_matplotlib_converters
register_matplotlib_converters()
import matplotlib.pyplot as plt
import datetime
from sklearn.lin... | do6/Learning-Driven-Power-Maps | pca.py | pca.py | py | 4,804 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pandas.plotting.register_matplotlib_converters",
"line_number": 9,
"usage_type": "call"
},
{
"api_nam... |
2709957090 | # 关键字
# 蓄电池
# 特征工程
# 随机森林
#
# 项目背景
# 毫无疑问,蓄电池是一辆汽车不可缺少的一部分,它是一种将化学能转变成电能的装置,属于直流电源,其作用有:
#
# 启动发动机时,给起动机提供强大的起动电流(10
# A左右)
# 当发电机过载时,可以协助发电机向用电设备供电
# 当发动机处于怠速时,向用电设备供电
# 蓄电池还是一个大容量电容器,可以保护汽车的用电器
# 当发电机端电压高于铅蓄电池的电动势时,将一部分电能转变为化学能储存起来,也就是进行充电
# 该项目主要针对汽油车内的铅蓄电池故障,基于TBOX采集的原始数据建立机器学习模型以期挖掘故障特征或模式提前做出预警。
# 实际场景中也很有意义,如果车子... | qianbin0205/data_analysis | battery_forecast/battery_fail_forecast.py | battery_fail_forecast.py | py | 27,841 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.path.exists",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_numbe... |
7601617180 | #SORU 4
import torch
X = torch.tensor([[1, 2, 3], [4, 5, 6]],dtype=torch.float)
# Aktivasyon fonksiyonlarini tanımla
def tanh_act(x):
return (torch.exp(x) - torch.exp(-x)) / (torch.exp(x) + torch.exp(-x))
def sigmoid_act(x):
return 1 / (1 + torch.exp(-x))
import torch.nn as nn
torch.manual_seed(1)
c... | doua-ounoughi/YSA | Question_4.py | Question_4.py | py | 723 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.tensor",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "torch.float",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.exp",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.exp",
"line_number": 1... |
21426293828 | from django.shortcuts import render, render_to_response
from django.http import HttpResponse, HttpResponseRedirect
from django.template import Context, RequestContext
from django.contrib import auth
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User, Group
from models ... | xivid/Programming-Training-Helper | chelper/views.py | views.py | py | 12,695 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.contrib.auth.models.Group.objects.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.Group.objects",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.auth.models.Group",
"line_number": ... |
40175160738 | import requests
import time
import threading
import logging
from sqlalchemy import Column, Integer, String
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, declarative_base
engine = create_engine('sqlite:///database.db')
Session = sessionmaker(bind=engine)
session = Session()
Base = decla... | SomEnaMeforme/Python_Advanced_Homework | mod11/task2.py | task2.py | py | 1,740 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.declarative_base",
"line_number": 13,
"usage_type": "call"
},
{
... |
3448996890 | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
import json
from .serializers import CostSerializer
from .models import Cost
from .permissions import IsAutentificated
class CostService(APIView):
permission_classes = (IsAutentificated,)
se... | MikhailKilinskiy/rest_app | fin/views.py | views.py | py | 2,994 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "permissions.IsAutentificated",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "serializers.CostSerializer",
"line_number": 12,
"usage_type": "name"
},
{
... |
11788225579 | # 기본 템플릿
from flask import Flask, render_template, request, jsonify
app = Flask(__name__)
@app.route('/')
def home():
return render_template('index.html')
@app.route('/formUpload', methods=["GET", "POST"])
def formUpload():
if request.method == "GET":
return render_template('pages/formUpl... | agzeroo/Flask | flask_cms/run.py | run.py | py | 2,425 | python | ko | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "flask.reque... |
33496563199 | import os
import argparse
import gzip
import json
import ipdb
from tqdm import tqdm
from nltk import wordpunct_tokenize
from nltk.corpus import stopwords
def subsample_json_files(args):
folder = args.DATA_DIR
counter_fr = 0
with open(args.target_file_fr, 'a+') as fr_file:
for file in os.listdir(f... | clara-gdef/seq2seq | pre_proc/subsample_json_file.py | subsample_json_file.py | py | 6,327 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.listdir",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "gzip.open",
"line_number": 2... |
3096146905 | import yagmail
import os
state = True
i = 0
while (state):
here = os.path.dirname(os.path.abspath(__file__))
filename = os.path.join(here, "message"+str(i)+".txt")
try:
f = open(filename, "r")
alias = f.readline().strip() #get alias
print(alias)
message = f.readlines() #get m... | stephentambussi/Email_bot | test_bot_yagmail.py | test_bot_yagmail.py | py | 629 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
31558576868 | from __future__ import annotations
from itertools import chain
from pprint import pprint
from typing import Optional, Union
import discord
import httpx
import validators
from discord.ext import commands
from httpx_auth import OAuth2ResourceOwnerPasswordCredentials
from steward_discord.config import PASSWORD, STEWARD... | AulonSal/steward-discord | steward_discord/cogs/content.py | content.py | py | 4,823 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.check",
"line_number": 25,
"usage_type": "attribute"
},
{
... |
71022054720 | #!/usr/bin/env python3
# Cryptopals Set 2 - Challenge 10
# Implement AES CBC
# take ECB function, make it encrypt instead of decrypt, and
# use XOR function to combine
import base64
from fixed_xor import fixed_xor
import aes_ecb
import pkcs7
def encrypt(pt, key, iv):
assert len(pt) % 16 == 0
assert len(key)... | lisaoverall/cryptopals-python | aes_cbc.py | aes_cbc.py | py | 1,622 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "aes_ecb.encrypt",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "fixed_xor.fixed_xor",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "fixed_xor.fixed_xor",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "aes_ecb.decry... |
10316330124 | from sklearn.preprocessing import Binarizer
X = [
[ 1., -1., 2.],
[ 2., 0., 0.],
[ 0., 1., -1.]
]
bn = Binarizer(threshold=0.0) #threshold = 임계치 / Binarizer는 0보다 크면 1 작으면 0 --> 임계치 조정해주는 함수
fit = bn.fit(X) # 0.0보다 큰지 작은지 비교
print(fit)
trans = fit.transform(X)
fit_trans = bn.fit_transform(X)
print(fit... | KM-Yeon/MLDL-basic_code | Basic/lec08_matrix.py | lec08_matrix.py | py | 387 | python | ko | code | 0 | github-code | 97 | [
{
"api_name": "sklearn.preprocessing.Binarizer",
"line_number": 9,
"usage_type": "call"
}
] |
15184006262 | import os
import random
from statistics import mean, median
from collections import Counter
import itertools
import gym
import numpy as np
import keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten, Conv2D, MaxPooling2D
from keras.callbacks import TensorBoard
game = 'CarRacing-v0... | crizzy9/practical_machine_learning | src/openai_gym/car_racing.py | car_racing.py | py | 3,501 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "gym.make",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"line_number":... |
28447936233 | #!/usr/bin/env python3
import collections
import glob
import json
from scipy.stats import spearmanr
import numpy as np
import jezecek.fig_utils
import matplotlib.pyplot as plt
import scipy.stats as st
data = [
json.loads(x)
for f in glob.glob("data_matism/collected/*.jsonl")
for x in open(f, "r").readline... | zouharvi/tsip | src_vilem/annotation_analysis/matism_model_aggregate.py | matism_model_aggregate.py | py | 3,915 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "json.loads",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.average",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.average",
"line_number":... |
16442942366 | #!/usr/bin/env python
from time import sleep
import urwid as uw
from urwid_timed_progress import TimedProgressBar
# Demo of bar adjusting to reasonable units
# The demo simulates progress at different rates to show
# the progress bar changing units as needed.
if __name__ == '__main__':
palette = [
('norm... | mgk/urwid_timed_progress | examples/reasonable_units.py | reasonable_units.py | py | 1,724 | python | en | code | 9 | github-code | 97 | [
{
"api_name": "urwid_timed_progress.TimedProgressBar",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "urwid.Text",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "urwid.Text",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "urwid.Fra... |
8339139861 | import torch
import segmentation_models_pytorch as smp
import numpy as np
import cv2
from torch.utils.data import DataLoader
from torch.utils.data import Dataset as BaseDataset
from time import time
from torch.optim.lr_scheduler import StepLR
from torch.utils.tensorboard import SummaryWriter
from augmentations import g... | RuslanAgishev/active_learning | src/segmodel.py | segmodel.py | py | 7,889 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "segmentation_models_pytorch.encoders.get_preprocessing_fn",
"line_number": 37,
"usage_type": "cal... |
38246834208 | import pandas as pd
import os
import sys
import numpy as np
from tqdm import tqdm
import argparse
from loguru import logger
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn import svm
from sklearn.ensemble import GradientBoostingClassifier
f... | domejiraphon/algorithm | jupyter_notebook/disaster_tweets/run.py | run.py | py | 5,981 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
... |
18846024309 | import os
from os.path import join as pjoin
import numpy as np
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
def find_in_path(name, path):
"Find a file in a search path"
#adapted fom http://code.activestate.com/recipes/52224-find-a-file-given-... | TaatiTeam/stgcn_parkinsonism_prediction | mmskeleton/mmskeleton/ops/nms/setup_windows_v2.py | setup_windows_v2.py | py | 8,615 | python | en | code | 16 | github-code | 97 | [
{
"api_name": "os.pathsep",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numbe... |
35263758660 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
from bs4 import BeautifulSoup
from core.crawler import CrawlerBase
from utils.common import format_list
from utils.tomongo import insert
from utils import req
from utils.common import set_data_md5
class SpiderBase(CrawlerBase):
desc = "spider_guanjia"
auth = "fa... | supertyper/apt_spider | spider/spider_guanjia.py | spider_guanjia.py | py | 2,319 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "core.crawler.CrawlerBase",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "utils.req.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "utils.req",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "bs4.BeautifulSoup",
... |
13016266989 |
from rest_framework import status
from rest_framework.views import APIView
from rest_framework.permissions import (IsAuthenticatedOrReadOnly)
from rest_framework.response import Response
from django.shortcuts import get_object_or_404
from landmark_events.models import LandmarkEvent
from system.models import Languag... | yousef69mr/TouriscoBackend | tickets/views.py | views.py | py | 5,565 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "rest_framework.permissions.IsAuthenticatedOrReadOnly",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 32,
... |
13496321700 | from .pytorch_tools.gradient_reversal import RevGrad
import torch
import os
from processing.models.deep_tl_predictor import DeepTlPredictor
import numpy as np
import torch.nn as nn
from .pytorch_tools.training import fit, predict
from captum.attr import IntegratedGradients
class LSTM(DeepTlPredictor):
def __init_... | benSlash2/stage_MSV | processing/models/lstm.py | lstm.py | py | 5,360 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "processing.models.deep_tl_predictor.DeepTlPredictor",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.optim.Adam",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.optim",
"line_number": 19,
"usage_type": "attribute"
},
{
... |
2481879979 |
from datetime import datetime
class Diretorio:
# Atributos de um arquivo regular
nome = None
tc = None # Tempo de criacao
tm = None # Tempo de modificacao
ta = None # Tempo de acesso
cont = None # Quantidade de elementos dentro do diretorio
raiz = None
def __init__(... | shayenne/ep3SO | diretorio.py | diretorio.py | py | 1,996 | python | pt | code | 0 | github-code | 97 | [
{
"api_name": "datetime.datetime.now",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 20,
"usage_type": "name"
}
] |
24038875552 | from app import app
from flask import request, render_template, jsonify, make_response
@app.route("/")
def index():
return 'HELLO'
@app.route('/upload-video', methods=['GET', 'POST'])
def upload_video():
print(request.method)
if request.method == 'POST':
filesize = request.cookies.get('filesi... | richardvlas/File-Upload-App-JS-Ajax-Flask | app/views.py | views.py | py | 585 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "app.app.route",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "app.app",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "flask.request.method",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"li... |
70390677758 | import numpy as np
import cv2
from cv2 import CV_32F
import warnings
def FPE(out, ):
warnings.filterwarnings(action='ignore')
# out = cv2.normalize(img.astype('float'), None, 0.0, 1.0, cv2.NORM_MINMAX)
[v, h, d] = np.shape(out)
# print('--- Mask generation stage ---')
mask = (v + h)*np.ones((v, h))... | gunchung78/3DImaging-system | FPeplography_optim.py | FPeplography_optim.py | py | 1,289 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.shape",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_n... |
41140319206 | #----------------------------------------------------------------------------#
# Imports
#----------------------------------------------------------------------------#
from flask import Flask, render_template, request
import logging
from logging import Formatter, FileHandler
from forms import *
import os
from... | mshamir11/python-verilog-code-gen | app.py | app.py | py | 13,227 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "flask.render_... |
16185097746 | from django.db import models
from core.categorias.models import Categoria
class Produto(models.Model):
nome = models.CharField(
'Nome',
max_length=128
)
valor = models.DecimalField(
'Valor',
max_digits=10,
decimal_places=2,
blank=True,
null=True
)... | beatrizuezu/de-sql-para-orm-django | core/produtos/models.py | models.py | py | 450 | python | pt | code | 15 | github-code | 97 | [
{
"api_name": "django.db.models.Model",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "... |
41739863717 | '''
Created on Aug 10, 2011
@author: mkiyer
'''
import logging
import argparse
import sys
import collections
import subprocess
# local imports
import pysam
from bx.intervals.intersection import Interval, IntervalTree
# project imports
from oncoseq.rnaseq.lib.base import DNA_reverse_complement, split_seq
def parse_g... | mkiyer/oncoseq | oncoseq/rnaseq/utils/create_fragsize_index.py | create_fragsize_index.py | py | 4,596 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "collections.defaultdict",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "bx.intervals.intersection.IntervalTree",
"line_number": 37,
"usage_type": "call"
},
{... |
35654362800 | # -*- coding: utf-8 -*-
"""
Created on Fri Nov 9 10:59:41 2018
@author: cc_privide
"""
import datapre_function as dataf
filepath='D:/ccwang20160302/python/titanic_test/data/test.csv'
xtest=dataf.data_pre(filepath)
import pandas as pd
datatrain=pd.read_csv('D:/ccwang20160302/python/titanic_test/firsttest/dat... | ccwang122333/titanci_test | main.py | main.py | py | 1,437 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "datapre_function.data_pre",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.path",
... |
32363637382 | ######## 基础准备 ########
import os
os.getcwd()
os.chdir('D:\\Download\\water\\manage')
os.getcwd() # 获取当前工作目录
from reportlab.pdfgen import canvas
from reportlab.lib.units import cm
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
pdfmetrics.registerFont(TTFont('song', 'C:/Windows/... | jishi92/pdf_processor | water.py | water.py | py | 2,221 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.getcwd",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "reportlab.pdfbase.pdfmetrics.registerFont",... |
37805198030 | import torch
from model import Network
from data_prepare import calculate_features
import cv2
import numpy as np
import pandas as pd
patch_size = 10
locations = []
labels = ('notumor', 'pituitary', 'meningioma', 'glioma')
for i in range(28, 224, 28):
for j in range(28, 224, 28):
locations.append([i,j])
def nor... | akshay-antony/Brain_tumor_classification | test_image.py | test_image.py | py | 1,281 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.max",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.random.randint",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"li... |
36767783472 | import click
import os
@click.command(help='archives the path directory to the destination and delete recursively')
@click.option('-d', '--directory', type=click.Path(), default="./temp")
@click.option('-D', '--destination', type=click.Path())
def archive(directory, destination):
try:
os.system(f'cp -r {di... | vaibhavblayer/andriana | src/archive.py | archive.py | py | 707 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.system",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "click.command",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "click.option",
"line_number": 5,
... |
17813798597 | import pandas as pd
import numpy as np
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer, TfidfTransformer
from sklearn.metrics.pairwise import linear_kernel, cosine_similarity
from ast import literal_eval
from surprise import Reader, Dataset, SVD #pip install scikit-surprise 之前必須先下載"pip in... | samh99474/Python_Final_Project_RecommenderSystem | Python_Final_Project/Server/Recommender/hybrid_RS.py | hybrid_RS.py | py | 5,390 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "sqlite3.connect",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql",
... |
37399589115 | import requests
import bs4
ret = requests.get('http://inndy.me:8090').text
document = bs4.BeautifulSoup(ret, 'html5lib')
forms = document.select('form') # css selector
form = forms[0]
print('Method: %s' % form['method'])
for post in document.select('div.post'): # '.post'
# print(post.text.split(maxsplit=3))
... | NTUST-Coding-Club/advanced-python-course-autumn-2015 | crawler/get-posts.py | get-posts.py | py | 584 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 5,
"usage_type": "call"
}
] |
42046596398 | import sys
import platform
from pathlib import Path
from itertools import *
bindingsOk = Path("./bindings-ok")
class ConstantDesc:
def __init__(self, name, value):
self.name = name
self.value = value
def save(self, saver):
saver['name'] = self.name
saver['value'] = self.value... | GPUOpen-LibrariesAndSDKs/RadeonProRenderBlenderAddon | src/bindings/pyrpr/src/pyrprapi.py | pyrprapi.py | py | 21,608 | python | en | code | 451 | github-code | 97 | [
{
"api_name": "pathlib.Path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 123,
"usage_type": "attribute"
},
{
"api_name": "json.dump",
"line_number": 156,
"usage_type": "call"
},
{
"api_name": "json.load",
... |
24805713930 | # 1516 게임 개발
"""
위상정렬 구현, 진입차수(in_degree) 배열을 만들고, in_degree가 0이 되면 조건 충족했다고 보고
건설을 시작한다.
"""
import sys
from collections import deque
input = sys.stdin.readline
N = int(input())
build = [[]]
condition = [[] for _ in range(N+1)]
in_degree = [[]]
for i in range(1, N+1):
time, *cond, _ = map(int, input().sp... | jang-namu/pyAlgorithm | solved/11주차-MST(크루스칼, 프림), 위상정렬/bj1516.py | bj1516.py | py | 1,867 | python | ko | code | 0 | github-code | 97 | [
{
"api_name": "sys.stdin",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 25,
"usage_type": "call"
}
] |
2397142288 | from django.shortcuts import render
from django.http import HttpResponse
from rest_framework import viewsets
from rest_framework import permissions
from rest_framework.views import APIView
from rest_framework.decorators import api_view
from rest_framework.response import Response
from work.models import Work, WorkSecti... | anteatersa/gatsby-django-portfolio | django/portfolio/work/views.py | views.py | py | 3,632 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "requests.post",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "dynamic_preferences.registries.global_preferences_registry.manager",
"line_number": 25,
"usage_typ... |
31447006469 | # -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from opps.db.models.fields.jsonf import JSONFormField
from opps.fields.widgets import JSONField
from opps.fields.models import Field, FieldOption
from .models import Container, Co... | opps/opps | opps/containers/forms.py | forms.py | py | 2,599 | python | en | code | 313 | github-code | 97 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "models.ContainerBoxContainers",
"line_number": 21,
"usage_type": "name"
},
{
"api_name":... |
22929807426 | import math
import unittest
from airflow.models import BaseOperator
from airflow.operators.python_operator import PythonOperator
from ditto.api import DAGFragment, OperatorTransformer
from ditto.resolvers import PythonCallTransformerResolver
class TestTransformerResolvers(unittest.TestCase):
def test_python_ca... | angadsingh/airflow-ditto | tests/test_resolvers.py | test_resolvers.py | py | 1,090 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "unittest.TestCase",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "math.factorial",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "ditto.api.OperatorTransformer",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "a... |
42400253334 | from flask.globals import request
from flask.helpers import url_for
from werkzeug.exceptions import abort
from werkzeug.utils import redirect
from flaskr import db
from flask import Blueprint, render_template, flash
from flaskr.blueprints.post.forms import PostForm
from flaskr.model import Post
from flaskr.auth impo... | isayahc/Flask_Blog | flaskr/blueprints/post/routes.py | routes.py | py | 2,149 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Blueprint",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flaskr.blueprints.post.forms.PostForm",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flaskr.model.Post",
"line_number": 23,
"usage_type": "call"
},
{
"api_name"... |
4776883117 | from db.models import Planer
from db.schemas import planer
from fastapi import HTTPException
from sqlalchemy.orm import Session
def create_planer(db: Session, planer: planer.PlanerBase, user_id: int):
find_planer = db.query(Planer).filter(Planer.name == planer.name).one_or_none()
if find_planer is not No... | Shrimp22/hakaton.github.io | backend/db/crud/planer.py | planer.py | py | 1,370 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "db.schemas.planer.PlanerBase",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "db.schemas.planer",
"line_number": 7,
"usage_type": "name"
},
{
"api_name"... |
32307507919 | """
오류 없이 Training data 모두 다 돌았을 때 결과
[5000, 566, 5000, 5000, 4945, 5000, 5000, 1976, 5000, 5000, 890, 5000, 3958, 5000, 5000, 5000, 5000, 2328, 5000, 4337, 5000]
"""
import sys
import os
import json
import shutil
path_dir = "/Users/ymp/Desktop/KFashionImage/Training/라벨링데이터/"
file_list = os.listdir(path_dir)
base_dir... | ClothesSilly/BetweenOurClothes_CategoryModel | FilterKFashionData/categorize21categories.py | categorize21categories.py | py | 3,821 | python | ko | code | 0 | github-code | 97 | [
{
"api_name": "os.listdir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "shutil.copyfile",
"line_number": ... |
4152017631 | """
holds tutorial information
"""
from in_game import InGame
from level_management import decode_safety_wrap
from pygame.key import name
class Tutorial(InGame):
"""
tutorial class
"""
# noinspection SpellCheckingInspection
def tutorial_place(self) -> None:
"""
runs tutorial plac... | Firefly7-7/121_game | src/tutorial.py | tutorial.py | py | 2,351 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "in_game.InGame",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "level_management.decode_safety_wrap",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pygame.key.name",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "py... |
18756315466 | # 查询子域名的A记录
import re
from queue import Queue
from threading import Thread
import dns
def query_A(t_id, subtract_subdomains_queue, Subdomains_ips): # 查询A记录的IP
while not subtract_subdomains_queue.empty():
subdomain = subtract_subdomains_queue.get()
# print('{}, '.format(subdomain), end='')
... | 0x727/ShuiZe_0x727 | Plugins/infoGather/subdomain/queryA/queryA.py | queryA.py | py | 1,428 | python | en | code | 3,283 | github-code | 97 | [
{
"api_name": "dns.resolver.query",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "dns.resolver",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"li... |
13136493846 | from sklearn.feature_extraction.text import TfidfVectorizer
import numpy as np
from collections import defaultdict
# Create 3 classes, 1 for each Method Type:
# 1) MeanEmbeddingVectorizer: np.array with an average word vector for each doc
# 2) MaxEmbeddingVectorizer: np.array with a max word vector for each doc
# 3) Tf... | csipiemonte/unlockpa-csibot | csibot/models/w2v_utils.py | w2v_utils.py | py | 3,642 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.array",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 5... |
73988276799 | from django.views import generic
from holiday_manager import models, forms
from holiday_manager.utils import redirect_to_referer
from django.forms.models import inlineformset_factory, modelformset_factory
from invites import forms as invite_forms
from invites.models import User
from holiday_manager.views import LoginRe... | fabiosussetto/holiday | holiday_manager/views/admin.py | admin.py | py | 13,191 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "holiday_manager.views.base.ProjectViewMixin",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "django.views.generic.View",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.views.generic",
"line_number": 23,
"usage_type": "name"... |
19416715840 | import os
from PIL import Image
import click
@click.command()
@click.option('--dir', 'dir', help='Directory of files', required=True)
@click.option('--exten', 'extenction', help='Extenction of files', required=False, default="png")
def zmiana_nazwy(dir:str, extenction:str):
a=0
for file_path in os.listdir(dir... | Charon6000/ImageConverter | python.py | python.py | py | 950 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.listdir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "os.remove",
"line_number": 15... |
16552796583 | import argparse
import json
import os
import sys
from .bookmarks import write_bookmarks
from .config import accounts_with_role, conf
from .google import GoogleRoleManager
from .profiles import update_profiles
def generate_role_entries(roles):
user_roles = []
for role in roles:
if role in conf['roles'... | isotoma/aws-accessc | access_control/cli.py | cli.py | py | 5,421 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "config.conf",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "config.conf",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "config.conf",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "config.conf",
"line_number": ... |
35968390751 | import matplotlib.pyplot as plt
import numpy as np
from operator import sub
start = 0x02
a = start
i = 1
c = 1
prn = []
while(i != start):
newbit = (((a >> 6) ^ (a >> 5)) & 1)
a = ((a << 1) | newbit) & 0x7f
# print(a)
prn.append(a)
if (a == start):
# print('repetation period:', c)
... | nabanita-sarkar/PRN-with-QPSK | demod.py | demod.py | py | 1,158 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.linspace",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "operator.sub",
"line_number": 33,
"usage_type": "argument"
},
{
"api_name": "numpy.linspace",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_... |
42320559401 | from setuptools import setup, find_packages
# install_requires = open_requirements('requirements.txt')
# d = {}
# exec(open("spikefinder/version.py").read(), None, d)
# version = d['version']
long_description = open("README.md").read()
setup(name='SpikeFinder',
version='0.1',
description='Python toolkit... | pabloslash/SpikeFinder | setup.py | setup.py | py | 1,150 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "setuptools.setup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 17,
"usage_type": "call"
}
] |
40942690336 | import math
from collections import defaultdict
def fact(n):
res = 1
for i in range(2, n+1):
res = res * i
return res
def ncr(n, r):
return (fact(n) / (fact(r)
* fact(n - r)))
n = int(input())
a = []
for i in range(n):
x = input()
a.append(x)... | ratedRA/python | Algo/silentclass.py | silentclass.py | py | 888 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "collections.defaultdict",
"line_number": 24,
"usage_type": "call"
}
] |
30248377441 | from .easy import sheet, column, cell_range
from .utils import extract_data, get_cell_type, get_cell_numeric_format
def from_array(array):
""" Helper function for creating a sheet out of a NumPy Array
Args:
array (NumPy Array):
Returns:
``Sheet`` widget
Example:
>>> import n... | jupyter-widgets-contrib/ipysheet | ipysheet/numpy_loader.py | numpy_loader.py | py | 1,611 | python | en | code | 527 | github-code | 97 | [
{
"api_name": "utils.get_cell_numeric_format",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "utils.get_cell_type",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "easy.sheet",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "easy.col... |
72854245120 | import requests
import json
import time
i = 0
offset = 1
limit = 1000
headers = {'Token': 'iPUFLyvvyzixkBcMRarLLeoLASMlWkEE'
}
payload = {'limit': limit,
'offset': offset}
data_set_name = 'locations'
r = requests.get(f'https://www.ncdc.noaa.gov/cdo-web/api/v2/{data_set_name}', headers=headers, pa... | ZCW-Data1dot2/data-acquisition-lab-agonzalez1216 | make_requests.py | make_requests.py | py | 867 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": ... |
18146056636 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="python_magic_file",
version="0.0.7",
author="Valtteri Remes",
description="Small Python module to aid developers in getting file extensions from files securely.",
long_description=long_des... | vremes/python-magic-file | setup.py | setup.py | py | 829 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "setuptools.setup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 13,
"usage_type": "call"
}
] |
72566528319 | from tkinter import *
import sqlite3 as lite
import pandas as pd
# Cores
co0 = "#f0f3f5" # Preta
co1 = "#feffff" # branca
co2 = "#257549" # verde
co3 = "#38576b" # valor
co4 = "#403d3d" # letra
co5 = "#e06636" # - profit
co6 = "#4186d7" # azul
co7 = "#ba432e" # vermelha
co8 = "#39da90" # + verde
co9 = "#... | everaldobass/curso-hashtag | hashtag-cadastro-cliente/Cadastro_clientes.py | Cadastro_clientes.py | py | 3,766 | python | pt | code | 0 | github-code | 97 | [
{
"api_name": "sqlite3.connect",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 62,
"usage_type": "call"
}
] |
30471058334 | import requests
#import os
from datetime import datetime
api_key = '87d845b0b6cf29baa1a73cc34b067a95'
location = input("Enter the city name: ")
complete_api_link = "https://api.openweathermap.org/data/2.5/weather?q="+location+"&appid="+api_key
api_link = requests.get(complete_api_link)
api_data = api_link.js... | DheerajMunaga/CYSECBOOT_PROJECT | weather(DHEERAJ).py | weather(DHEERAJ).py | py | 1,132 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "name"
}
] |
13434564677 | from scrapy.utils.serialize import ScrapyJSONEncoder
import json
import csv
import os
def return_spider_output(output):
"""
Encode the output into json
"""
_encoder = ScrapyJSONEncoder(ensure_ascii=False)
return _encoder.encode(output)
def save_finance_json(output):
"""
Save a list of spy... | stdevelopr/web-nlp-scraping | financescrape/financescrape/utils.py | utils.py | py | 1,866 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "scrapy.utils.serialize.ScrapyJSONEncoder",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": ... |
37432044002 | from googletrans import Translator
import time
from city import city
import csv
from dhaka import dhaka
level_0_bn = ""
level_1_bn = ""
level_2_bn = ""
def translate_to_bn(text):
translator = Translator(service_urls=[
'translate.google.co.kr',
])
translated = translator.translate(text, src='en', de... | ramisafariha5/address-translator | main.py | main.py | py | 1,922 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "googletrans.Translator",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "dhaka.dhaka",
"line_... |
12891015204 | from collections import namedtuple
from datetime import datetime
from typing import Optional
from typing import Union
from .connection import join_url
from .connection import root
from .exceptions import _raise_exception
from .parse import BeautifulSoup
from .parse import check_page_raise
from .parse import html_to_bb... | FurryCoders/FAAPI | faapi/journal.py | journal.py | py | 7,583 | python | en | code | 15 | github-code | 97 | [
{
"api_name": "collections.namedtuple",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 30,
"usage_type": "call"
},
{
"api_name... |
19224098429 | '''
Author: Sungjun Han
Description:
here we can build either
1. regular vocabulary
2. byte pair encoding vocabulary
'''
import logging
import os
import numpy as np
import argparse
import pickle
import time
import json
from nli.preprocess import token_to_idx, idx_to_token, frequency_count
from nli.utils import op... | hansungj/NLPLab | scripts/build_vocab.py | build_vocab.py | py | 3,328 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "nli.utils.open_tsv_file",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "nli... |
37841289800 | import pathlib
from collections import defaultdict
import matplotlib.pyplot as plt
import numpy as np
import pybedtools
from pybedtools import BedTool
from tqdm import tqdm
import utils
from utils.miscellaneous import is_valid_chromosome
###############################################################################... | alnfedorov/MEF-CBL0137 | chip-seq/analysis/scripts/mm10-coverage-by-repeats.py | mm10-coverage-by-repeats.py | py | 4,147 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "utils.miscellaneous.is_valid_chromosome",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "pybedtools.BedTool",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "utils.paths",
"line_number": 14,
"usage_type": "attribute"
},
{
"a... |
19509133435 | """
File with the utility functions
Y Fan, L Lin, L Ying, L Zepeda-Nunez, A multiscale neural network based on hierarchical matrices,
arXiv preprint arXiv:1807.01883
"""
import numpy as np
from keras import backend as K
import argparse
# functions
def padding(x, size):
return K.concatenate([x[:,x.shape[1]-... | Forgotten/mnn-H | NLSE/utils.py | utils.py | py | 3,328 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "keras.backend.concatenate",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "keras.backend.sum",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "keras.backe... |
38553669012 | import torch
from torch import nn
class SparseMaxPool(nn.Module):
def __init__(self, pooling_counts, N):
super(SparseMaxPool, self).__init__()
mask2d = torch.zeros(N, N, dtype=torch.bool)
mask2d[range(N), range(N)] = 1
stride, offset = 1, 0
maskij = []
for c in pool... | Xun-Yang/Causal_Video_Moment_Retrieval | framework/modeling/models/feat2d.py | feat2d.py | py | 1,821 | python | en | code | 34 | github-code | 97 | [
{
"api_name": "torch.nn.Module",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "torch.zeros",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.bool",
"line_number"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.