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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
70059653662 | # --------------------------------------------------------------
# Logical_unit
# --------------------------------------------------------------
#------------------------
# Identify light sources
#------------------------
#----------
# kerne.py
#----------
from PIL import Image
def build_kernel():
print("bui... | KisterShulamit/Mobileye | model/part 1 - attention.py | part 1 - attention.py | py | 5,613 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "PIL.Image.open",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_number": 90,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_n... |
43793018848 | from q_a import app
from flask import render_template, session, request, url_for
from q_a.models import User, Email, Group
from q_a.supplement import Amend, Check
@app.route('/profiles', methods=['GET', 'POST'])
@app.route('/profiles/<int:page>', methods=['GET', 'POST'])
def profiles(page=1):
Check.update()
if... | iurmak/phonphon | q_a/profiles.py | profiles.py | py | 3,764 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "q_a.supplement.Check.update",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "q_a.supplement.Check",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "flask.session.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flas... |
29909401663 | import math
import logging
from functools import partial
from collections import OrderedDict
from copy import deepcopy
import torch
import torch.nn as nn
import torch.nn.functional as F
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD, IMAGENET_INCEPTION_MEAN, IMAGENET_INCEPTION_STD
from timm.models.... | Honey-Be/XCiFormer | models_xc/cross_covariance_inception_transformer/xciformer.py | xciformer.py | py | 18,279 | python | en | code | null | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "timm.data.IMAGENET_DEFAULT_MEAN",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "timm.data.IMAGENET_DEFAULT_STD",
"line_number": 29,
"usage_type": "name"
},
{
"... |
12903999072 | from django.urls import path
from . import views
app_name = 'tution'
urlpatterns = [
path('contact_with_form/', views.contact_with_form, name='contact_with_form'),
# path('contact_with_modelform/', views.contact_with_modelform, name='contact_with_modelform'),
path('contact/', views.ContactView.as_view(), ... | rhsajib/django-practice | projects/Tech solutions BD/practice1/backend/tution/urls.py | urls.py | py | 1,087 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
7223230118 | # Third Party
import pytest
# Database
from sqlalchemy.orm import Query
# Project
from graphene_sqlalchemy_filter import FilterSet
from tests import models
from tests.graphql_objects import UserFilter
def test_hybrid_property_automatic_filter_binding():
msg = 'Unsupported field type for automatic filter binding... | art1415926535/graphene-sqlalchemy-filter | tests/test_hybrid_property.py | test_hybrid_property.py | py | 821 | python | en | code | 118 | github-code | 7 | [
{
"api_name": "pytest.raises",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "graphene_sqlalchemy_filter.FilterSet",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "tests.models.User",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_nam... |
72737939424 | import time
import logging
import os
from typing import Sequence
from sunhead.conf import settings
from isk.backends.factory import backend
from isk.urldownloader import url_to_file
logger = logging.getLogger(__name__)
on_rtd = os.environ.get('READTHEDOCS', None) == 'True' # Whether this module is imported by read... | anti1869/isk | src/isk/api/images.py | images.py | py | 22,309 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"lin... |
21515802830 | import discord
from discord.ext import commands
from utils.loader import configData
from checks.cargos import has_roles
class unban(commands.Cog):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command()
@has_roles(
configData["roles"]["staff"]["asmodeus"]... | Marciel404/Grifo-Kamaitachi-Python | commands/Administracao/unban.py | unban.py | py | 683 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.Bot",
"line_number": 10,
"usage_type": "attribute"
},
{
"ap... |
72850621982 | import base64
import os
import mmcv
import torch
from ts.torch_handler.base_handler import BaseHandler
from mmcls.apis import inference_model, init_model
class MMclsHandler(BaseHandler):
def initialize(self, context):
properties = context.system_properties
self.map_location = 'cuda' if torch.cu... | Ascend/ModelZoo-PyTorch | PyTorch/built-in/cv/classification/Resnet50_Cifar_for_PyTorch/tools/deployment/mmcls_handler.py | mmcls_handler.py | py | 1,602 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "ts.torch_handler.base_handler.BaseHandler",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 15,
"usage_type": "attribute"
},
{
... |
1796294996 | import os, logging
from scipy.io.wavfile import read,write
from ..Configuration.configuration import Configuration
from ..AudioLogic.recording import Recording
class AudioSystem():
__instance = None
#Implementing Singleton pattern
def __init__(self):
self.configuration = Configuration.getinstance... | Artelia/Lamia | api/libslamia/VoiceRecorder/main/AudioLogic/audioSystem.py | audioSystem.py | py | 2,031 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "Configuration.configuration.Configuration.getinstance",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "Configuration.configuration.Configuration",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "scipy.io.wavfile.write",
"line_number": 27,
... |
8337226365 | from unittest import mock
from tap_intercom.client import IntercomClient, IntercomError, IntercomBadRequestError
import unittest
import requests,json
from parameterized import parameterized
def get_mock_http_response(status_code, contents):
"""Returns mock rep"""
response = requests.Response()
response.sta... | singer-io/tap-intercom | tests/unittests/test_client.py | test_client.py | py | 3,208 | python | en | code | 12 | github-code | 7 | [
{
"api_name": "requests.Response",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "tap_intercom.client.IntercomClient",
"line_number": 18,
"usage_type": "call"
},
{
"api_na... |
11727056828 | from typing import Tuple, NamedTuple, List
import glm
from glglue import glo
from .vertex_buffer import MeshBuilder
from .drawable import Drawable
"""
OpenGL default is ccw
+->
|
v
4 5
+-+
/ /
+-+
7 6
0 1
+-+
/ /
+-+
3 2
"""
S = 0.6
VERTICES = [
glm.vec3(-S, -S, -S),
glm.vec3(S, -S, -S),
glm.vec... | ousttrue/glglue | glglue/drawable/cube.py | cube.py | py | 1,400 | python | en | code | 10 | github-code | 7 | [
{
"api_name": "glm.vec3",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "glm.vec3",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "glm.vec3",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "glm.vec3",
"line_number": 29,
"usa... |
42642457578 | from typing import Any, Dict, Type, TypeVar, Union
import attr
from ..types import UNSET, Unset
T = TypeVar("T", bound="CodatAssessDataContractsFinancialsMetricsMetricPeriodInput")
@attr.s(auto_attribs=True)
class CodatAssessDataContractsFinancialsMetricsMetricPeriodInput:
"""
Attributes:
name (Uni... | levrofin/levro-codat | codat_api_client/models/codat_assess_data_contracts_financials_metrics_metric_period_input.py | codat_assess_data_contracts_financials_metrics_metric_period_input.py | py | 1,222 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.TypeVar",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "types.Unset",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "types.UNSET",
"line_number... |
33747921378 | from curses.ascii import SP
from datetime import datetime
from os.path import join
from pathlib import Path
from airflow.models import DAG
from airflow.operators.my_plugins import TwitterOperator
from airflow.contrib.operators.spark_submit_operator import SparkSubmitOperator
from airflow.utils.dates import days_ago
fro... | ykhost/datapipeline | airflow/dags/twitter_dag.py | twitter_dag.py | py | 1,848 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "airflow.utils.dates.days_ago",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "airflow.models... |
4708924929 | import uuid, sys
from twisted.python import log
from twisted.internet import reactor
from twisted.web.server import Site
from twisted.web.wsgi import WSGIResource
from autobahn.twisted.resource import WebSocketResource, \
WSGIRootResource
from wsgi_app import make_app
from ws_protocol import BroadcastServerFactor... | ergo/channelstream_twisted_test | channelstream/server.py | server.py | py | 1,429 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "twisted.python.log.PythonLoggingObserver",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "twisted.python.log",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "twisted.python.log.startLogging",
"line_number": 24,
"usage_type": "call"
}... |
35935173773 | import numpy as np
import environments
from environments.base import HitStand
import pickle
from pathlib import Path
from os.path import getctime
from uuid import uuid4
from dill import dump, load
import re
from functools import reduce
def folderpath_search(origin:Path, sought_folder:str)->Path:
for element in o... | Xavi-Linux/Fatjack | agents/agents.py | agents.py | py | 21,976 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pathlib.Path",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pathlib.Path.cwd",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_n... |
41970654200 | from django.urls import path
from . import views
app_name = 'zomato_app'
urlpatterns = [
path('dishes/', views.dish_list, name='dish_list'),
path('add_dish/', views.add_dish, name='add_dish'),
path('order_list/', views.order_list, name='order_list'),
path('place_order/', views.place_order, name='place... | AmanChaudhary214/Python | Zomato Chronicles Django/zomato_chronicles/zomato/urls.py | urls.py | py | 332 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
19891906226 | from abc import ABCMeta, abstractmethod
from six import add_metaclass, PY2
import xmltodict
if PY2:
from codecs import open
__author__ = 'y.gavenchuk'
@add_metaclass(ABCMeta)
class AbstractSettings(object):
_parser = None
def __init__(self, config):
self._cfg_file = config
self._data =... | ygavenchuk/web-deploy | web_deploy/settings.py | settings.py | py | 1,380 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "six.PY2",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "six.add_metaclass",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "abc.ABCMeta",
"line_n... |
37631834777 | # coding=utf-8
import resvole
import requests
import re
import pickle
from selenium import webdriver
import time
import csv
L = []
cnt = 0
a = re.compile(r'<a target="_blank" href="([^jpg]*?)" usercard="id=\d*?">.*?</a>')
def get_users(d):
return re.findall(a,d.page_source)
with open('users.plk','rb') ... | hanyang7427/wb_crawler | more_comment.py | more_comment.py | py | 2,672 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "re.compile",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Firefox",
"l... |
12458018595 | import datetime
import enum
import logging
import os
import pathlib
__all__: tuple[str, ...] = ("Logger",)
class LogLevelColors(enum.Enum):
"""Colors for the log levels."""
DEBUG = "\033[96m"
INFO = "\033[92m"
WARNING = "\033[93m"
ERROR = "\033[33m"
CRITICAL = "\033[91m"
ENDC = "\033[0m"... | Skurczybyki/bot | src/logger.py | logger.py | py | 2,633 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "enum.Enum",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "logging.Filter",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "logging.LogRecord",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",... |
20818605844 | """Module contains methods to read .nex files produced from the offline sorter.
Based on documents from http://www.neuroexplorer.com/code.html. The text file
HowToReadAndWriteNexFilesInCPlusPlus.txt is especially useful
"""
import struct, pylab, logging
logger = logging.getLogger(__name__)
upk = struct.unpack
sz = st... | kghose/neurapy | neurapy/neuroexplorer/nexio.py | nexio.py | py | 6,024 | python | en | code | 14 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "struct.unpack",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "struct.calcsize",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pylab.array",... |
22689449828 | from flask import Flask, render_template, request, redirect, url_for, session
from mri2pet import Mri2Pet
from os import path, mkdir, listdir, unlink
from flask_ngrok import run_with_ngrok
from werkzeug.utils import secure_filename
from shutil import rmtree
import time
import string
import random
from flask import Res... | mritopep/UI-Depreciated- | app.py | app.py | py | 3,623 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.dirname",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "os.path.abspath",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_numbe... |
12078701641 | from tokenizer import Tokenizer
from abstract_syntax_tree import ASTNode, ConcatNode, AlternationNode, DuplicationNode, CharNode, AnchorNode
class ParseError(Exception):
pass
class Parser:
'''
Parses a regular expression into an abstract syntax tree.
'''
'''
The order of precedence for of operators is as f... | aheinous/pyregex | parser.py | parser.py | py | 2,962 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tokenizer.Tokenizer",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "abstract_syntax_tree.ConcatNode",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "abstract_syntax_tree.AnchorNode",
"line_number": 83,
"usage_type": "call"
},
{
... |
9594438220 | from config import config
from .base import BaseCompressor
import pytorch_lightning as pl
from pytorch_lightning.callbacks import ModelCheckpoint, EarlyStopping
from pytorch_lightning import Trainer, seed_everything
import torch
import torch.nn as nn
from torch.nn import functional as F
from functools import reduce
imp... | matyushinleonid/PID_Compression | pidc/models/compression/ae.py | ae.py | py | 7,997 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "base.BaseCompressor",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pytorch_lightning.seed_everything",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "config.config",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "c... |
74663321182 | from twisted.internet import reactor
from twisted.internet.error import CannotListenError
from twisted.web import server
from twisted.protocols.policies import ThrottlingFactory
from jinja2 import Environment, PackageLoader
from downpour.core.plugins import Plugin
from downpour.core.net import get_interface
from downpo... | jjongsma/downpour | downpour/web/__init__.py | __init__.py | py | 6,044 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "downpour.core.plugins.Plugin",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "jinja2.PackageLoader",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "jinja2.Environment",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "... |
22432350242 | #!/usr/bin/env python
# coding: utf-8
# # Implementing linear regression in Python
#
# ## Example: 2007 West Coast Ocean Acidification Cruise
# In[1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy import stats
import statsmodels.formula.api as smf
import pingouin as pg
import... | tompc35/data_marine_science | _build/jupyter_execute/week05b-wcoa-cruise-regression.py | week05b-wcoa-cruise-regression.py | py | 1,444 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 55,
"usage_type": "name"
},
{
"api_name": "matplotlib... |
72358172703 | import os
import sys
import shutil
import logging
from pylons import c
from ming.orm import session
from allura import model as M
log = logging.getLogger(__name__)
MONGO_HOME=os.environ.get('MONGO_HOME', '/usr')
MONGO_DUMP=os.path.join(MONGO_HOME, 'bin/mongodump')
MONGO_RESTORE=os.path.join(MONGO_HOME, 'bin/mongorest... | leotrubach/sourceforge-allura | scripts/migrate_project_database.py | migrate_project_database.py | py | 2,733 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"l... |
21098850048 | #! coding: utf-8
import ply.lex as lex
import sys
LOCALE = False
tokens = (
'VARIABLE',
'TRUE',
'FALSE',
'IF',
'THEN',
'ELSE',
'LAMBDA',
'TWOPOINTS',
'POINT',
'ZERO',
'SUCC',
'OPENPAREN',
'CLOSEPAREN',
'PRED',
'ISZERO',
'BOOL',
'NAT',
'ARROW'
... | MichelleGrenier/TP-TL | Calculo_Lambda/lexer.py | lexer.py | py | 1,043 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.stderr.write",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 58,
"usage_type": "attribute"
},
{
"api_name": "ply.lex.lex",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "ply.lex",
"line_numb... |
5135295156 | import sys
from PyQt5.QtWidgets import (QApplication, QWidget, QGridLayout, QVBoxLayout, QHBoxLayout, QLabel, QLineEdit, QTextEdit, QPushButton)
import resize
class Logger(object):
def __init__(self, editor, out):
self.editor = editor # 結果出力用のエディター
self.out = out # 標準出力・標準エラーなどの出力オブジェクト... | Penguin8885/img_resizer | resize_gui.py | resize_gui.py | py | 3,119 | python | ja | code | 1 | github-code | 7 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QLineEdit",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QLineEdit",
"line_number": 26,
"usage_type": "call"
},
{
"api_n... |
71040040543 | import logging
import os
from datetime import datetime
from twisted.internet.defer import Deferred
from golem.verifier.subtask_verification_state import SubtaskVerificationState
logger = logging.getLogger('golem.verifier.core_verifier')
class CoreVerifier: # pylint: disable=too-many-instance-attributes
activ... | golemfactory/clay | golem/verifier/core_verifier.py | core_verifier.py | py | 2,799 | python | en | code | 2,915 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "golem.verifier.subtask_verification_state.SubtaskVerificationState.WAITING",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "golem.verifier.subtask_verification_state.Subtas... |
17702735806 | """ Implements the commands for viewing and manipulating the training manifest """
import json
import time
import os
from blaze.action import Policy
from blaze.logger import logger as log
from blaze.mahimahi.server import start_server
from . import command
@command.argument("replay_dir", help="The directory contain... | nkansal96/alohamora | blaze/command/replay.py | replay.py | py | 1,807 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "os.path.abspath",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
74247269982 | import numpy as np
import os
from skimage import io
from tqdm import tqdm
from utils.files import load_img
import torch
from torch.utils.data import Dataset
from PIL import Image
class BaseDataset(Dataset):
def __init__(self,
datasetA: str = None,
datasetB: str = None,
... | Rushabh318/CycleGAN-Pytorch-Lightning | code/datasets/basic.py | basic.py | py | 9,389 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.walk",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_... |
26419409056 | from flask import Flask,jsonify,request,abort
from pymongo import MongoClient
import requests
import datetime
from datetime import date
import pandas as pd
import numpy as np
import threading
from sklearn.preprocessing import StandardScaler
from sklearn import svm
import warnings
import time
warnings.filterwarnings('i... | ShashankBongale/Blood-Bank-Website | Project/web_app.py | web_app.py | py | 6,208 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
... |
4986142782 | import argparse
import logging
import os
import sys
import operator
import collections
import shutil
import assemblyline
from assemblyline.lib.bx.intersection import Interval, IntervalTree
from assemblyline.lib.bx.cluster import ClusterTree
from assemblyline.lib.base import Category, GTFAttr
from assemblyline.lib.gtf ... | bmpvieira-forks/assemblyline | assemblyline/assemblyline/utils/compare_assemblies.py | compare_assemblies.py | py | 36,873 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "collections.defaultdict",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 39,
"usage_type": "call"
},
{
"api_name"... |
9819943666 | import wget
# wget.download("https://raw.githubusercontent.com/pesikj/python-012021/master/zadani/5/twlo.csv")
import pandas
import matplotlib.pyplot as plt
twilio = pandas.read_csv("twlo.csv")
# twilio["Date"] = pandas.to_datetime(twilio["Date"])
twilio.plot("Date", "Close")
# plt.show()
# změnil se popisek osy x, p... | KristynaSodomkova/python-012021 | 7/ukoly7/ukol33.py | ukol33.py | py | 547 | python | cs | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 18,
"usage_type": "name"
}
] |
42886429670 | # Time Limit Exceeded
class Solution:
def subarraySum(self, nums: list[int], k: int) -> int:
ps = [0]
for i in range(1, len(nums)+1):
ps.append(ps[-1] + nums[i-1])
answer = 0
for i in range(1, len(ps)):
for j in range(i):
if ps[i] - ps[j] == k:... | hyeonjun/AlgorithmTest | leetcode/560_Subarray_Sum_Eqauls_K.py | 560_Subarray_Sum_Eqauls_K.py | py | 1,126 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "collections.defaultdict",
"line_number": 20,
"usage_type": "call"
}
] |
70543148063 | # file to assist in generating heyawake text files
# while the main part is running
# q: quit
# u: undo last operation (supports full undo history)
# w: write to file when finished
# type "<r> <c> [n]" to make a rxc rectangle with the number n (optional)
# command line usage: heyawake_helper <r> <c> <file>
import curs... | tkoz0/random-puzzles | datasets/giant_logic_puzzles/heyawake/heyawake_helper.py | heyawake_helper.py | py | 5,826 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "curses.init_pair",
"lin... |
36158411543 | from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D
from keras.layers import Activation, Dropout, Flatten, Dense
from keras import backend as K
import matplotlib.pyplot as plt
from keras.utils import np_utils
import numpy as np
data... | sahasd/dogcatClassifier | petClassifier.py | petClassifier.py | py | 1,518 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "keras.preprocessing.image.ImageDataGenerator",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "keras.utils.np_utils.to_categorical",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "keras.utils.np_utils",
"line_number": 23,
"usage_type": ... |
13272814309 | # IMPORTING MODULES
# from pyspark.sql.functions import split, explode, lower, regexp_extract
import pyspark.sql.functions as F
# IMPORTING DATA
# importing the book Pride and Prejudice on Databricks
file_location = "/FileStore/tables/1342_0.txt"
file_type = "txt"
# READING THE DATA
# .alias() provide a clean and e... | pitz/pyspark-notes | notebooks/pride_and_prejudice.py | pride_and_prejudice.py | py | 2,647 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pyspark.sql.functions.split",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.functions",
"line_number": 63,
"usage_type": "name"
},
{
"api_name": "pyspark.sql.functions.col",
"line_number": 63,
"usage_type": "call"
},
{
"api_n... |
7302797780 | from django import forms
from .models import Form
from django.forms.widgets import DateInput
"""
from django.utils.deconstruct import deconstructible
from django.utils.translation import ugettext_lazy as _
from django.core.validators import BaseValidator
from datetime import date
def calculate_age(born):
today = d... | amark23/django-form | form/forms.py | forms.py | py | 861 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "models.Form",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "django.forms.wid... |
38454353450 | import sys
import pandas as pd
import sqlalchemy
import logging
import boto3
import os
from datetime import datetime
from os.path import join, dirname
from datetime import datetime
from dotenv import load_dotenv
logname = sys.argv[0]
logger = logging.getLogger(logname)
formatter = logging.Formatter('%(asctime)s %(lev... | data-skeptic/membership-services | drip-campaign/runner.py | runner.py | py | 11,609 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
... |
29871020744 | from random import randint
from typing import Set, Any
from fastapi import FastAPI, UploadFile,File
from io import BytesIO
from fastapi.middleware.cors import CORSMiddleware
from kafka import TopicPartition
import pandas as pd
import uvicorn
import aiokafka
import asyncio
import json
import logging
import os
from kafka... | trung501/urlphishing | fastapi/main.py | main.py | py | 5,258 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "fastapi.middleware.cors.CORSMiddleware",
"line_number": 19,
"usage_type": "argument"
},
{
"api_name": "json.dumps",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": ... |
29580363559 | from __future__ import absolute_import
import os
import re
from OpenSSL import SSL
from netlib import http_auth, certutils, tcp
from .. import utils, platform, version
from .primitives import RegularProxyMode, SpoofMode, SSLSpoofMode, TransparentProxyMode, UpstreamProxyMode, ReverseProxyMode, Socks5ProxyMode
TRANSPARE... | sravani-m/Web-Application-Security-Framework | venv/lib/python2.7/site-packages/libmproxy/proxy/config.py | config.py | py | 11,444 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "re.compile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "netlib.tcp.Address.wrap",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "netlib.tcp.Addr... |
12278057594 | from google.appengine.ext import ndb
# Account Data
class AccountDetails(ndb.Model):
first_name = ndb.StringProperty()
last_name = ndb.StringProperty()
mobile_number = ndb.StringProperty()
password = ndb.StringProperty()
email = ndb.StringProperty()
is_active = ndb.BooleanProperty()
is_ver... | RegsonDR/Project-Estimator-GAE | models.py | models.py | py | 7,572 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "google.appengine.ext.ndb.Model",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.ext.ndb",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "google.appengine.ext.ndb.StringProperty",
"line_number": 6,
"usage_type": "cal... |
28681252670 | import streamlit as st
import joblib
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import plotly.express as px
import seaborn as sns
model = joblib.load('xgb_model.joblib')
pipeline = joblib.load('pipeline.joblib')
st.title('Ames Housing Price Prediction 🏡')
st.markdown("***")
... | Cyriled1014/Ames_Housing_Model | Housing_Model_app.py | Housing_Model_app.py | py | 9,394 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "joblib.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "joblib.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "streamlit.markdown",
"line... |
30875603934 | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 10 17:50:56 2020
@author: Prasanth
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
df=pd.read_csv('F:/downloads/task')
df.columns
x=df[['fixed acidity','volatile acidity' , 'citric acid', 'residual sugar','chlorides', 'free sulf... | prasanthkondapalli/red-wine-quality | redwine.py | redwine.py | py | 5,683 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.boxplot",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "matplotli... |
36712207316 | import os
import matplotlib.pyplot as plt
from pitch_fork import visualization
import numpy as np
import argparse
import pathlib
def do(
x_true: np.ndarray,
source_dir: pathlib.Path,
target_dir: pathlib.Path,
add_fidelity: bool,
) -> None:
x_true = x_true / np.sqrt(np.sum(x_true * x_true))
tar... | JessieMHenderson/quantum-geologic-fracture-networks | UniformPermeabilityLargerRegions/plot_errors.py | plot_errors.py | py | 2,055 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "numpy.ndarray",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.sqrt",
... |
73834416224 | from dataset.data_loading import AssetsDataset
from torchvision import transforms
import utils.config as cfg
def split_data(dataset, attrib, split_ratio=(0.8, 0.1, 0.1)):
"""
This function is used to apply transformation on the dataset as well as split them
into train, val and test.
"""
train_rang... | git-hamza/multi-label_multi_output_classification | dataset/data_split.py | data_split.py | py | 1,400 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "dataset.data_loading",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "dataset.data_loading",
"line_number": 12,
"usage_type": "argument"
},
{
"api_name": "dataset.data_loading",
"line_number": 13,
"usage_type": "argument"
},
{
"api_na... |
30117865849 | from itertools import count
def exponential(round, start=0, increment=2, limit=None):
limit_func = min if 0 < increment else max
result = start + (increment ** round)
return limit_func(result, limit) if limit else result
def exponential_generator(start=0, increment=2, limit=None):
for round in count(... | juhajokela/random-stuff | exponential.py | exponential.py | py | 786 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "itertools.count",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "itertools.count",
"line_number": 15,
"usage_type": "argument"
}
] |
30054443780 | import numpy as np
from tqdm import tqdm
from script.json_maker import json_maker
import utility
import argparse
np.random.seed(0)
if __name__ == '__main__' :
parser = argparse.ArgumentParser()
parser.add_argument('--src', type=str, default='/data3/sap/frcnn_keras/result/result-sv_messytable_cam3_resume_m... | solapark/frcnn_keras_original | script/nms.py | nms.py | py | 3,316 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.random.seed",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "script.json... |
14472129200 | #!/usr/bin/python3
"""a script that statrs a Flask web app"""
from flask import Flask
app = Flask(__name__)
@app.route('/', strict_slashes=False)
def hello_world():
"""Return a string"""
return 'Hello HBNB!'
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
| Ibrah44/AirBnB_clone_v2 | web_flask/0-hello_route.py | 0-hello_route.py | py | 288 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
}
] |
6778046026 | ######################################################
##Author: Kellie McGuire kellie@kelliejensen.com
##
##Takes FITS files or .txt file and creates a heatmap
##of the pixel values
######################################################
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import f... | KJMcGuire/ccd-testing-tools | heatmap.py | heatmap.py | py | 1,957 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "astropy.io.fits.open",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "numpy.nanmedian",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.nanmedian"... |
36040931117 | from typing import Any, Callable, Optional, Tuple
import haiku as hk
import jax
import jax.numpy as jnp
import jraph
from haiku.initializers import UniformScaling
from jax.tree_util import Partial
from egnn_jax.utils import LinearXav, MLPXav
class EGNNLayer(hk.Module):
"""EGNN layer.
Args:
layer_nu... | gerkone/egnn-jax | egnn_jax/egnn.py | egnn.py | py | 8,358 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "haiku.Module",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "typing.Callable",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
... |
74081154782 | import urllib3
import datetime
import json
import time
#--- 共通コード ------------------------------------------------------
# request項目を保存するクラス。配列として使う。
# 'p_no'、'p_sd_date'は格納せず、func_make_url_requestで生成する。
class class_req :
def __init__(self) :
self.str_key = ''
self.str_value = ''
de... | e-shiten-jp/e_api_get_histrical_price_daily.py | e_api_get_histrical_price_daily.py | e_api_get_histrical_price_daily.py | py | 31,961 | python | ja | code | 4 | github-code | 7 | [
{
"api_name": "urllib3.PoolManager",
"line_number": 215,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 227,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 245,
"usage_type": "call"
},
{
"api_name": "datetime.date... |
41870922391 | # This Python file uses the following encoding: utf-8
import os, sys
import traceback
from PyQt5.QtWidgets import *
import PyQt5.uic
from PyQt5.uic import *
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))
from common import lang
import common.common, common.files, common.books, common.qt
from common.va... | LordKBX/eBookCollection | editor/img.py | img.py | py | 4,077 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "sys.path.insert",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
11238235408 | import argparse
import os
import sys
parser = argparse.ArgumentParser(description="Run commands")
parser.add_argument('-w', '--num-workers', default=1, type=int,
help="Number of workers")
parser.add_argument('-r', '--remotes', default=None,
help='The address of pre-existing VNC ... | Bifrost-Research/RL-Universe | Universe-Starter-Agent/train.py | train.py | py | 2,422 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.executable",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "os.system",
"line_number": 65,
"usage_type": "call"
}
] |
13939794282 | import urllib.request, urllib.parse, urllib.error
import json
import ssl
import sqlite3
api_key = False
# If you have a Google Places API key, enter it here
# api_key = 'AIzaSy___IDByT70'
# https://developers.google.com/maps/documentation/geocoding/intro
if api_key is False:
api_key = 42
serviceurl = 'http://... | nima14/Coursera_P4E_Specialization | 04. Using Databases With Python/Week 5/geoload.py | geoload.py | py | 1,896 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sqlite3.connect",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "ssl.create_default_context",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "ssl.CERT_NONE",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "urllib.... |
25507076782 | from typing import Optional
from api.models import Guide, Element, Version
class Glossary:
"""
Class created for operation with basic instances used in application and
includes Guide object id, Version object id and incoming data for
elements validation.
If necessary, it could be extended for mor... | dussiks/komtek_glossary | api/usecases.py | usecases.py | py | 3,313 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "api.models.Guide.objects.get",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "api.models.Guide.objects",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "api.models.Guide",
"line_number": 38,
"usage_type": "name"
},
{
"api_n... |
33373080725 | import os
import cv2
import numpy as np
import dlib
import time
from tkinter import *
import pytesseract
import PIL
from PIL import Image,ImageTk
global list1
list1 = ["You_Byeongjae","You_Seyun","jim_carrey","problem","hanyeseul","Park","trumfe","Park_Geunhye","jungwoosung","Lee_Byeongbak","Kim_Junhyeon","Hong_Yunhwa... | sangwoo24/KPU | Embedded Vision System - Face swapping/realtime_face_swapping.py | realtime_face_swapping.py | py | 12,700 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cv2.flip",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 33,
... |
37113232427 | import dash
import dash_bootstrap_components as dbc
import numpy as np
import pandas as pd
import plotly.graph_objects as go
from Class import Radio, Time
PAGE_ID = "HOME"
radiolist = Radio.RadioList()
radio_total_num = radiolist.get_total_num()
radio_total_length = radiolist.get_total_length()
radio_average_le... | ikumyn1or0/uraradi_archive | src/pages/overview.py | overview.py | py | 12,392 | python | ja | code | 0 | github-code | 7 | [
{
"api_name": "Class.Radio.RadioList",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "Class.Radio",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.ceil",
"... |
27123255690 | import datetime as dt
import logging
import os
from typing import Any, List
import pytest
from fastapi import FastAPI
from starlette import status
from starlette.testclient import TestClient
from app.core.db import db
from app.domain.users.users_schema import (
UserBase,
UserCreateSchema,
UserDBSchema,
... | niparis/fastapi-template | tests/routes/test_user.py | test_user.py | py | 1,521 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "app.domain.users.users_schema.UserBase",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_... |
39583093676 | # -*- coding=utf-8 -*-
"""
Created by lichen on 2019-06-10.
宝藏系统
"""
import json
import time
import math
import random
import freetime.util.log as ftlog
from freetime.entity.msg import MsgPack
from freetime.core.timer import FTLoopTimer
import poker.util.timestamp as pktimestamp
from poker.protocol import router
from... | isoundy000/learn_python | learn_tu_you/wx_superboss/trunk/hall37-newfish/src/newfish/entity/treasure_system.py | treasure_system.py | py | 30,690 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "newfish.entity.redis_keys.UserData.treasure",
"line_number": 53,
"usage_type": "attribute"
},
{
"api_name": "newfish.entity.redis_keys.UserData",
"line_number": 53,
"usage_type": "name"
},
{
"api_name": "newfish.entity.config.FISH_GAMEID",
"line_number": 53,
... |
21025555706 | import re
import difflib
import os
from io import StringIO
import shutil
import bs4
from ebooklib import epub
from ebooklib.utils import create_pagebreak
from pdf2ebook import logger
from pdf2ebook.base_page import BasePage
class HTMLPage(BasePage):
def __init__(self, idx, content):
self.idx = idx
... | RobertLucey/pdf2ebook | src/pdf2ebook/html_page.py | html_page.py | py | 7,888 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "pdf2ebook.base_page.BasePage",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "io.StringIO",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "bs4.Beauti... |
70869333665 | import requests
import os
import json
from enum import Enum
TIME_OUT = 25
class Method(Enum):
GET = 1
POST = 2
class HttpClient(object):
def __init__(self):
self.session = requests.session()
self.cookies = None
def request(self, url, method, cookies=None, postData=None, headers=Non... | Chenle007/ZLMH | HttpClient.py | HttpClient.py | py | 4,088 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "enum.Enum",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "requests.session",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
13417119262 | #!/usr/bin/env python
# Modified version of movidius classification-sample.py to test in a snap
from __future__ import print_function
import sys
import os
from argparse import ArgumentParser, SUPPRESS
import cv2
import numpy as np
import logging as log
from time import time
from openvino.inference_engine import IENet... | apereiracv/movidius-snap | movidius_test/main_object_detection.py | main_object_detection.py | py | 5,563 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "sys.std... |
86987491678 | import sqlalchemy
import pandas as pd
from datetime import datetime, timedelta
import numpy as np
def get_non_missing(date):
"""Given a date, takes a subset of the historicalReturns df
corresponding to the year preceeding the date, and returns all
tickers where zero nan values are found in that time frame... | ChrisDarley/momentum_sp500_backtesting | choose_stocks.py | choose_stocks.py | py | 3,873 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sqlal... |
25642039408 | import torch
import torch.nn as nn
import torch.nn.functional as F
from pcseg.model.segmentor.base_segmentors import BaseSegmentor
from pcseg.model.segmentor.range.utils import ClassWeightSemikitti, CrossEntropyDiceLoss, Lovasz_softmax, BoundaryLoss
class ResContextBlock(nn.Module):
def __init__(self, in_filters... | PJLab-ADG/OpenPCSeg | pcseg/model/segmentor/range/salsanext/model/semantic/salsanext.py | salsanext.py | py | 9,154 | python | en | code | 205 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
33054982757 | import sys
import time
from qtpy.QtWidgets import QApplication
from ..lsl import StreamInlet, resolve_streams
from ..utils._checks import check_type
from ..utils.logs import _use_log_level, logger
from .control_gui.control_eeg import ControlGUI_EEG
from .scope.scope_eeg import ScopeEEG
class StreamViewer:
"""Cl... | mne-tools/mne-lsl | mne_lsl/stream_viewer/stream_viewer.py | stream_viewer.py | py | 2,613 | python | en | code | 33 | github-code | 7 | [
{
"api_name": "lsl.StreamInlet",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "scope.scope_eeg.ScopeEEG",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "qtpy.QtWidgets.QA... |
2737289431 | import numpy as np
import math
from typing import Union, Tuple, List, Dict
import pandas as pd
from tqdm import tqdm_notebook
from itertools import combinations
import matplotlib.pyplot as plt
EPS = 0.1
def in_shape(img: np.ndarray, pixel: List) -> bool:
"""Short summary:
function that verifies if a pix... | MehdiZouitine/Segmentation_Mumford_Shah | src/function.py | function.py | py | 14,340 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "numpy.ndarray",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "typing.List",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "math.copysign",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.ndarray",
"lin... |
30133411420 | #!/usr/bin/env python3
# Example on scattering
from mpi4py import MPI
# Define the communicator
world_comm = MPI.COMM_WORLD
# Get workd size
world_size = world_comm.Get_size()
# Get the rank
my_rank = world_comm.Get_rank()
# Generate data in rank = 0 to be scattered
if my_rank == 0:
sample_data = [(4.*y + 1.)... | GabrielBJ/practice-modules | mpi_modules/example_mpi13.py | example_mpi13.py | py | 570 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "mpi4py.MPI.COMM_WORLD",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "mpi4py.MPI",
"line_number": 7,
"usage_type": "name"
}
] |
45358106577 | import xlrd
wb = xlrd.open_workbook('C:\\Users\\ppirogov\\Desktop\\Паше\\tab.xlsx')
sheet_names = wb.sheet_names()
sh = wb.sheet_by_name(sheet_names[0])
nmin = sh.row_values(6)[2]
for rownum in range(7, 27):
temp = sh.row_values(rownum)
nmin = min(nmin, temp[2])
print(nmin)
print (sh.row_values(0)[0]) | pirogov-p/phyton | course_python/2.1.py | 2.1.py | py | 315 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "xlrd.open_workbook",
"line_number": 3,
"usage_type": "call"
}
] |
72685301344 | from typing import List
class Solution:
def singleNumber(self, nums: List[int]) -> int:
a = 0
for num in nums:
# xor
# the bit of the number itself will be reversed when xor
a ^= num
return a
| daviddwlee84/LeetCode | Python3/Array/SingleNumber/BM136.py | BM136.py | py | 258 | python | en | code | 15 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
70996535263 | from google.cloud import bigquery
client = bigquery.Client()
table_id = "datafold-dev-2.data_diff.tmp_rating"
dataset_name = "data_diff"
client.create_dataset(dataset_name, exists_ok=True)
job_config = bigquery.LoadJobConfig(
source_format=bigquery.SourceFormat.CSV,
skip_leading_rows=1,
autodetect=True,... | datafold/data-diff | dev/_bq_import_csv.py | _bq_import_csv.py | py | 846 | python | en | code | 2,618 | github-code | 7 | [
{
"api_name": "google.cloud.bigquery.Client",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "google.cloud.bigquery",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "google.cloud.bigquery.LoadJobConfig",
"line_number": 10,
"usage_type": "call"
},
{
... |
70403153822 | from genetic_algorithm import run_genetic_algorithm
from utils import load_csv, get_cost, print_output, plot_progress, plot_solution, output_to_csv
import time
import numpy as np
import csv
import random
tests = [
{
'data':'5_cities.csv',
'num_stations':1
},
{
'data':'data.csv',
'num_stations':6
},
{
'd... | afestein/sit316-project | benchmark_genetic_algorithm.py | benchmark_genetic_algorithm.py | py | 2,108 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "random.randint",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"lin... |
928716254 | from typing import Any, Optional, Union
from reactivex import Observable, abc
from reactivex.scheduler import ImmediateScheduler
def throw_(
exception: Union[str, Exception], scheduler: Optional[abc.SchedulerBase] = None
) -> Observable[Any]:
exception_ = exception if isinstance(exception, Exception) else Ex... | ReactiveX/RxPY | reactivex/observable/throw.py | throw.py | py | 754 | python | en | code | 4,581 | github-code | 7 | [
{
"api_name": "typing.Union",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "reactivex.abc.SchedulerBase",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "reactivex.... |
5512834116 | import os
import cv2
def main():
for srcpath, _, files in os.walk('photos'):
if len(_):
continue
dstpath = srcpath.replace('photos', 'faces')
if not os.path.exists(dstpath):
os.makedirs(dstpath)
for filename in files:
if filename.startswith('.'):
... | qinritukou/classifymisscolleofjp | classifygirls/face_detecter.py | face_detecter.py | py | 1,994 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.walk",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 10,... |
19807808758 | from collections import defaultdict
from statistics import mean
from typing import Dict, List, Literal, Optional, Set, Tuple, Union
import torch
from cohesion_tools.evaluation import CohesionScore, CohesionScorer
from cohesion_tools.extractors import PasExtractor
from rhoknp import BasePhrase, Document, Morpheme, Phra... | ku-nlp/kwja | src/kwja/metrics/word.py | word.py | py | 25,003 | python | en | code | 113 | github-code | 7 | [
{
"api_name": "kwja.metrics.base.BaseModuleMetric",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 66,
"usage_type": "name"
},
{
"api_name": "kwja.datamodule.datasets.WordDataset",
"line_number": 66,
"usage_type": "name"
},
... |
70540702625 | import os
import torch
import torch.nn as nn
import torch.optim as optim
from typing import List
from functools import partial
from ..constants import TORCH_MODELS_DIR
def get_activation(name):
if type(name) != str:
return name
if name == 'relu':
return nn.ReLU()
elif name == 'tanh':
... | flyingleafe/dqnroute | src/dqnroute/networks/common.py | common.py | py | 2,963 | python | en | code | 8 | github-code | 7 | [
{
"api_name": "torch.nn.ReLU",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torch.nn.Tanh",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 16... |
35870161905 | #!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5
import torch.nn as nn
import torch
from .GDN import GDN
import math
class Analysis_net_17(nn.Module):
'''
Analysis net
'''
def __init__(self, out_channel_N=192):
super(Analysis_net_17, self).__init__()
self.co... | liujiaheng/iclr_17_compression | models/analysis_17.py | analysis_17.py | py | 1,827 | python | en | code | 89 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
1305633619 |
import os
from random import randint
from flask import Flask, render_template, jsonify, request, redirect, url_for, session
from flask_session import Session
from flask_socketio import SocketIO, emit
from flask_cors import CORS, cross_origin
app = Flask(__name__)
app.config["SESSION_PERMANENT"] = False
app.config... | maguilera0810/project2 | application.py | application.py | py | 3,490 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask_session.Session",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"li... |
29822996123 | #!/usr/bin/env python
###############################
import json
import logging
import shlex
import subprocess
import sys
import time
import boto3
from Naked.toolshed.shell import execute_rb
# AWS Region
from botocore.exceptions import ClientError
#import main.py
import os
#########################################... | febatech/cloudformationtemplates | efs.py | efs.py | py | 10,206 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "boto3.Session",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 90,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 94,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 117,
... |
6208683173 | # Nikolaus Howe, May 2016
# Some functions to streamline the NN notebooks
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import roc_curve, auc
def draw_histogram(test_data, test_labels, model):
# Get the test signal and background to make the histogram
test_signal = test_data[np.where... | vlimant/summer16-NikolausHowe | draw_functions.py | draw_functions.py | py | 3,101 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.where",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.hist",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
38685303483 | """ Eop visualisation.
This module contains all methods used for visualising Eop series and their residuals, using numpy and matplotlib as backend.
The public methods availabe in this module are:
*plot_serie, plots a data serie and its uncertainty
*plot_residuals, plots residuals between two data series and... | AdrianLundell/adrians-geotools | EopTool/visualise.py | visualise.py | py | 3,220 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "EopTool.units.one",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "EopTool.units",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.subplot",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplo... |
34381139400 | from itertools import tee
with open('./input.txt') as input:
handle1, handle2 = tee(input)
bitcount = len(next(handle1).strip())
count = 0
print(bitcount)
occurences = [0] * bitcount
for row in handle2:
for index, bit in enumerate(row.strip()):
occurences[index] += int(bit)
... | CapOfCave/adventofcode-2021 | Day 03 - Binary Diagnostic/part1-solution.py | part1-solution.py | py | 544 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "itertools.tee",
"line_number": 4,
"usage_type": "call"
}
] |
7062712495 | import pytest
import numpy as np
from collections import namedtuple
from ppo_worm.env_wrapper import WormGymWrapper
@pytest.fixture(scope="session")
def worm_env():
return WormGymWrapper("worm/worm.x86_64", no_graphics=True)
def test_reset(worm_env):
obs = worm_env.reset()
assert obs.shape == (10, 64)
... | dogeplusplus/ppo-worm | tests/test_env_wrapper.py | test_env_wrapper.py | py | 1,009 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "ppo_worm.env_wrapper.WormGymWrapper",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.random.normal",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "... |
9942465096 | from __future__ import unicode_literals
import ezdxf
from ezdxf.tools import standards
def main():
dwg = ezdxf.new('R12')
for name, desc, pattern in standards.linetypes():
if name in dwg.linetypes:
continue
dwg.linetypes.new(name, dxfattribs={
'description': desc,
... | YunbiaoCao/ezdxf | examples/setup_standard_tables.py | setup_standard_tables.py | py | 929 | python | en | code | null | github-code | 7 | [
{
"api_name": "ezdxf.new",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "ezdxf.tools.standards.linetypes",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "ezdxf.tools.standards",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "ezdxf.to... |
14007133049 | """
Example DAG using GCSToBigQueryOperator.
"""
import os
from airflow import DAG
from airflow.providers.google.cloud.operators.bigquery import (
BigQueryCreateEmptyDatasetOperator,
BigQueryDeleteDatasetOperator,
)
from airflow.providers.google.cloud.transfers.gcs_to_bigquery import GCSToBigQueryOperator
fro... | trushasahu/Composer-to-load-CSV-to-BQ | csv-to-bigquery.py | csv-to-bigquery.py | py | 1,617 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.environ.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_... |
29695998528 | from Block import Blockchain, Block
from flask import Flask, jsonify, request
import json
app = Flask(__name__)
blockchain = Blockchain()
@app.route("/")
def home():
return "Hello, Flask!"
@app.route('/SendWeapon/GametoServer', methods = ['POST'])
def GametoServer():
values = request.get_json()
print(val... | zdayscott/Legacy | Legacy Server Code/app.py | app.py | py | 1,543 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "Block.Blockchain",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.request",
... |
21009138550 | import copy
import os.path
from pathlib import Path
from nni.experiment.config import ExperimentConfig
def expand_path(path):
return os.path.realpath(os.path.join(os.path.dirname(__file__), path))
## minimal config ##
minimal_json = {
'searchSpace': {'a': 1},
'trialCommand': 'python main.py',
'trial... | microsoft/nni | test/ut/experiment/test_exp_config.py | test_exp_config.py | py | 3,111 | python | en | code | 13,409 | github-code | 7 | [
{
"api_name": "os.path.path.realpath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "os.path.path.join",
... |
74523901983 | #!/usr/bin/env python
from utils import Utils
from dataset import Dataset
import argparse
import sys
def main(args):
d = Dataset()
if args.gather:
d.load_csv(args.infile, args.num_accounts, args.skip, args.verbose)
elif args.load:
d.load(args.infile, args.verbose)
else:
print(... | jmacfarland/misinformation-bot | main.py | main.py | py | 1,207 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "dataset.Dataset",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line... |
2991757902 | import io
import json
from PIL import Image
TILE_SIZE = 4096
# disable PIL maximum pixels limit
Image.MAX_IMAGE_PIXELS = None
# open image
image = Image.open('moon.jpg')
# get image size
width, height = image.size
# get scale factors
SCALE_FACTORS = [pow(2, factor) for factor in range(
0, round(max(width, heig... | romainquencez/imagestiles | info.py | info.py | py | 1,077 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "PIL.Image.MAX_IMAGE_PIXELS",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
... |
1421801419 | from fastapi import FastAPI,APIRouter
# /api/v1/student
# student
import student
from config import settings
router = APIRouter(prefix="{}".format(settings.API_V1_STR),
tags=["core"]
)
@router.get("/")
async def hello():
return {"message": "Hello World"}
app = FastAPI()
ap... | DanialSobri/einsnull | main.py | main.py | py | 379 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "config.settings.API_V1_STR",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "config.settings",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "fastap... |
28056435609 | from .cube import TrainableCube, PredictorCube, CubeLabel
from ..utils.functions import sorted_labels
import re
import os
import json
from collections import defaultdict
class PatternMatcher(TrainableCube, PredictorCube):
"""Matcher based on regexps"""
def __init__(self):
self.labels = []
se... | spoof/deepcubes | deepcubes/cubes/pattern_matcher.py | pattern_matcher.py | py | 1,914 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cube.TrainableCube",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "cube.PredictorCube",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "re.matc... |
73672320543 | from typing import Tuple
import pytest
from y2021.day_9.main import puzzle_1, Point, calculate_top_bottom_left_right
@pytest.mark.parametrize(
"input_, expected",
[
pytest.param(
[
"2199943210",
"3987894921",
"9856789892",
"... | bergran/advent-of-code | y2021/day_9/tests/test_puzzle_1.py | test_puzzle_1.py | py | 4,362 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "y2021.day_9.main.puzzle_1",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pyte... |
3086268413 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torchvision
from torch.utils.data import DataLoader, Dataset
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from torchvision.models import mobilenet_v2, MobileNet_V2_Weights
from tqdm import tqd... | mnuryga/PIML | hw05/hw05.py | hw05.py | py | 7,051 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "torchvision.datasets.CIFAR10",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "... |
17824678973 | from PIL import Image, ImageDraw, ImageFont
import random
import io
import base64
import os
from pathlib import Path
def encode(key, msg):
enc = list()
for i in range(len(msg)):
key_c = key[i % len(key)]
enc.append(chr((ord(msg[i]) + ord(key_c)) % 256))
return base64.urlsafe_b64encode("".jo... | acharyabidhan/captcha-api | api/CAPTCHA.py | CAPTCHA.py | py | 3,240 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "base64.urlsafe_b64encode",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "base64.urlsafe_b64decode",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "random... |
42673691078 | import vcf
import os
from joblib import Parallel, delayed
import math
import itertools
import multiprocessing
import csv
vcf_file_ending = ".vcf"
variant_cap = 5
use_variant_cap = False
include_filenames = False
def open_files(country, main_dir, res_dir):
input_dir = "{}/{}/Vcf".format(main_dir, country)
... | samhollenbach/KIRVCF | vcf_scripts/VCFvariants.py | VCFvariants.py | py | 5,572 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.exists",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numb... |
34359853336 | #!/usr/bin/env python
"""Script to import tags into hoover.
Receives a csv with tags as stdin. Use it like: tags.csv | -c collection -u username
"""
import subprocess
from argparse import ArgumentParser
import sys
parser = ArgumentParser()
parser.add_argument('-c', '--collection', dest='collection', required=True,
... | liquidinvestigations/node | import-tags.py | import-tags.py | py | 1,731 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.stdin.isatty",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
... |
31544270779 | from PIL import Image
def hide_text_in_image(image_path, message):
# Ouvre l'image en mode lecture
img = Image.open(image_path)
# Convertit le message en une chaîne binaire
message_bin = ''.join(format(ord(c), '08b') for c in message)
message=f'[{len(message)}]'+message
message_bin = ''.join(fo... | JulienCarayon/CoursCpp | TD_Steganography/Encrypt_python/encrypt_png.py | encrypt_png.py | py | 1,319 | python | fr | code | 1 | github-code | 7 | [
{
"api_name": "PIL.Image.open",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 5,
"usage_type": "name"
}
] |
72859618782 | import argparse
import torch
import torch.onnx
from lib.config import config, update_config, hrnet
from collections import OrderedDict
def parse_args():
parser = argparse.ArgumentParser(description='Train classification network')
parser.add_argument('--cfg',
help='experiment configure ... | Ascend/ModelZoo-PyTorch | PyTorch/contrib/cv/classification/HRNet_ID1780_for_PyTorch/pthtar2onnx.py | pthtar2onnx.py | py | 1,905 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "lib.config.update_config",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "lib.config.config",
"line_number": 34,
"usage_type": "argument"
},
{
"api_name": ... |
4395781877 | from zipfile import ZipFile
FILES = [ 'file-a', 'file-b', 'file-c' ]
for i in range(1, 100):
filename = f'sub{str(i).rjust(3, "0")}.zip'
with ZipFile(f'data/{filename}') as file:
contents = file.namelist()
if len(contents) != 3 or not all(f in contents for f in FILES):
print(filen... | ucll-scripting/exercises | old-exams/verify-zips/solution.py | solution.py | py | 324 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "zipfile.ZipFile",
"line_number": 8,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.