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
40057143195
#!/usr/bin/env python3 import scapy.all as scapy import argparse from datetime import datetime import sys def ip(): parse = argparse.ArgumentParser() parse.add_argument("-ip", dest="ip", help="Needs IP range /24") parse.add_argument("-i", dest="interface", help='Needs interface') parse.add_...
WMDA/ctf
tools/python_scripts/network_scanner.py
network_scanner.py
py
1,853
python
en
code
1
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "scapy.all.ARP", "line_number": 25, "usage_type": "call" }, { "api_name": "scapy.all", "line_number": 25, "usage_type": "name" }, { "api_name": "scapy.all.Ether", ...
22568917957
from .workspace import get_workspace_location, get_workspace_state, resolve_this from .cache import Cache from .config import Config from .resolver import find_dependees from .ui import warning, fatal, show_conflicts from .cmd_git import has_package_path, get_head_branch from .util import iteritems, yaml_dump from pygi...
fkie/rosrepo
src/rosrepo/cmd_export.py
cmd_export.py
py
3,924
python
en
code
5
github-code
36
[ { "api_name": "pygit2.Repository", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "ui.warning", "line_nu...
40211358205
#%% [markdown] # ## Preliminaries #%% from pkg.utils import set_warnings set_warnings() import time import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from giskard.utils import get_random_seed from myst_nb import glue as default_glue from pkg.data import load_network_palette...
neurodata/bilateral-connectome
misc_scripts/perturbations_unmatched_deep_dive.py
perturbations_unmatched_deep_dive.py
py
6,901
python
en
code
5
github-code
36
[ { "api_name": "pkg.utils.set_warnings", "line_number": 6, "usage_type": "call" }, { "api_name": "pkg.io.savefig", "line_number": 37, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.close", "line_number": 42, "usage_type": "call" }, { "api_name": "matplotl...
6363206566
from itertools import count global_index = 1 global_bank_fee = 1 global_bank_win = 2 global_bank_lose = 3 class smartPlayer: _ids = count(0) def __init__(self, trustor_or_trustee, trust_coefficient, beta): global global_bank_fee global_bank_fee = beta self.id = next(self._ids) ...
snirsh/TrustGame
SmartPlayer.py
SmartPlayer.py
py
2,264
python
en
code
0
github-code
36
[ { "api_name": "itertools.count", "line_number": 10, "usage_type": "call" } ]
7086566402
from django.shortcuts import render,redirect from adm.models import * def ViewInicio(request): listJogos = Jogo.objects.select_related('Vencedora','Perdedora').all() context = { "listJogos":listJogos, } return render(request,"inicio.html",context) def ViewCadastro(request): if request.me...
michel110299/Administrador_tranca
adm/views.py
views.py
py
7,068
python
pt
code
0
github-code
36
[ { "api_name": "django.shortcuts.render", "line_number": 11, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 39, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 45, "usage_type": "call" }, { "api_nam...
28891628391
"""Tests for traces.traces.""" import ast import collections import sys import textwrap from pytype import config from pytype.pytd import pytd from pytype.pytd import pytd_utils from pytype.tests import test_utils from pytype.tools.traces import traces import unittest _PYVER = sys.version_info[:2] _BINMOD_OP = "BINA...
google/pytype
pytype/tools/traces/traces_test.py
traces_test.py
py
11,794
python
en
code
4,405
github-code
36
[ { "api_name": "sys.version_info", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pytype.tools.traces.traces.MatchAstVisitor", "line_number": 22, "usage_type": "attribute" }, { "api_name": "pytype.tools.traces.traces", "line_number": 22, "usage_type": "name...
38801618139
from transformers import pipeline # classifier = pipeline('sentiment-analysis') # res = classifier( # 'We are not very happy to introduce pipeline to the transformers repository.') pipe = pipeline('question-answering') res = pipe({ 'question': 'What is the name of the repository ?', 'context': 'Pipeline h...
taterboom/simple-tts
index.py
index.py
py
397
python
en
code
0
github-code
36
[ { "api_name": "transformers.pipeline", "line_number": 7, "usage_type": "call" } ]
39472235141
import json from flask import request, jsonify from flask_restful import Resource from werkzeug.exceptions import BadRequest from managers.brand import BrandManager from models import RoleType from models.products import * from schemas.request.brand import CreateBrandRequestSchema, EditBrandRequestSchema from schemas...
a-angeliev/Shoecommerce
server/resources/brand.py
brand.py
py
2,486
python
en
code
0
github-code
36
[ { "api_name": "dotenv.load_dotenv", "line_number": 19, "usage_type": "call" }, { "api_name": "cloudinary.config", "line_number": 25, "usage_type": "call" }, { "api_name": "flask_restful.Resource", "line_number": 28, "usage_type": "name" }, { "api_name": "managers....
38672578742
import shodan import requests from shodan import Shodan ''' api = Shodan('Insert_your_Shodan_Api_Key') print(api.search(query='product:nginx', facets='country,org')) ''' SHODAN_API_KEY = "Insert_your_Shodan_Api_Key" api = shodan.Shodan(SHODAN_API_KEY) target = 'www.packtpub.com' dnsResolve = 'https://api.shodan.io/...
MuhammadAli947/shodanCode
ShodanScans.py
ShodanScans.py
py
1,526
python
en
code
0
github-code
36
[ { "api_name": "shodan.Shodan", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 19, "usage_type": "call" } ]
36211707503
#file a transaction #any changes to the users balanace should be reflected in the account file import datetime def transaction_options(accounts_path, line_number): stay_logged_in = True while stay_logged_in == True: ask = input('Would you like to make a transaction, return to the homepage, or logout ...
2105-may24-devops/fletcher-project0
transaction_module.py
transaction_module.py
py
3,661
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.strptime", "line_number": 57, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 57, "usage_type": "attribute" } ]
11371604753
import logging from sklearn.metrics import accuracy_score from pytorch_tabular import TabularModel from pytorch_tabular.config import DataConfig, OptimizerConfig, TrainerConfig from ml.solvers.base_solver import Solver class PytorchTabularSolver(Solver): def init_model(self): super(PytorchTabularSolver,...
gregiberri/coupon
ml/solvers/pytorch_tabular_solver.py
pytorch_tabular_solver.py
py
2,165
python
en
code
0
github-code
36
[ { "api_name": "ml.solvers.base_solver.Solver", "line_number": 10, "usage_type": "name" }, { "api_name": "pytorch_tabular.config.DataConfig", "line_number": 14, "usage_type": "call" }, { "api_name": "pytorch_tabular.config.TrainerConfig", "line_number": 20, "usage_type": "...
40587003321
from django.contrib.auth.base_user import AbstractBaseUser from django.contrib.auth.decorators import login_required from django.http import (HttpRequest, HttpResponse, HttpResponseNotFound, HttpResponseRedirect) from django.shortcuts import redirect, render from django.urls import reverse_lazy...
Xewus/Examiner
src/questions/views.py
views.py
py
4,430
python
ru
code
0
github-code
36
[ { "api_name": "django.urls.reverse_lazy", "line_number": 12, "usage_type": "call" }, { "api_name": "django.urls.reverse_lazy", "line_number": 13, "usage_type": "call" }, { "api_name": "django.urls.reverse_lazy", "line_number": 14, "usage_type": "call" }, { "api_na...
39479105306
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core.management.base import BaseCommand, CommandError from cards.search import searchservice from cards.models import Card, BaseCard from cards.models import PhysicalCard import json from django.utils import dateparse import codecs import s...
jcrickmer/mtgdbpy
cards/management/commands/reindex_es.py
reindex_es.py
py
5,648
python
en
code
0
github-code
36
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 21, "usage_type": "name" }, { "api_name": "cards.search.searchservice.search", "line_number": 45, "usage_type": "call" }, { "api_name": "cards.search.searchservice", "line_number": 45, "usage_type": "...
26419037040
import datetime from functools import wraps from django.http import HttpResponseRedirect from django.urls import reverse from django.utils import timezone def authentication_required(function=None): def decorator(view_func): @wraps(view_func) def _wrapped_view(request, *args, **kwargs): ...
qiuosier/Pisces
decorators.py
decorators.py
py
1,068
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "attribute" }, { "api_name": "django.utils.timezone.now", "line_number": 19, "usage_type": "call" }, { "api_name": "django.utils.timezone", "line_number": 19, "usage_type": "name" }, { "api_name":...
73574130663
import torch import torch.nn as nn import torch.nn.functional as F from policy import discrete_policy_net from critic import attention_critic import numpy as np from buffer import replay_buffer from make_env import make_env import os import random from gym.spaces.discrete import Discrete from gym.spaces.box ...
deligentfool/MAAC_pytorch
model_mpe.py
model_mpe.py
py
12,313
python
en
code
0
github-code
36
[ { "api_name": "make_env.make_env", "line_number": 19, "usage_type": "call" }, { "api_name": "gym.spaces.discrete.Discrete", "line_number": 34, "usage_type": "argument" }, { "api_name": "critic.attention_critic", "line_number": 38, "usage_type": "call" }, { "api_na...
38650316304
#%% import pyautogui, pyperclip Y = 550 # 507 X = 800 # 740 pyperclip.copy("직") pyautogui.moveTo(x=X, y=Y, duration=0.001) pyautogui.click(clicks=1) pyautogui.hotkey("ctrl", "v") pyperclip.copy("업") pyautogui.moveTo(x=X, y=Y, duration=1) pyautogui.click(clicks=1) pyautogui.hotkey("ctrl", "v") pypercli...
shetshield/src
stitching_img/pymacro.py
pymacro.py
py
1,353
python
en
code
0
github-code
36
[ { "api_name": "pyperclip.copy", "line_number": 6, "usage_type": "call" }, { "api_name": "pyautogui.moveTo", "line_number": 7, "usage_type": "call" }, { "api_name": "pyautogui.click", "line_number": 8, "usage_type": "call" }, { "api_name": "pyautogui.hotkey", "...
38313990919
from flask import flash from flask_app.config.mysqlconnection import connectToMySQL from flask_app.models import user from flask_app.models import message class Event: db = "plannendar_schema" def __init__(self, data): self.id = data['id'] self.event = data['event'] self.description =...
rchuu/plannendar
flask_app/models/event.py
event.py
py
5,351
python
en
code
0
github-code
36
[ { "api_name": "flask_app.config.mysqlconnection.connectToMySQL", "line_number": 26, "usage_type": "call" }, { "api_name": "flask_app.config.mysqlconnection.connectToMySQL", "line_number": 31, "usage_type": "call" }, { "api_name": "flask_app.config.mysqlconnection.connectToMySQL",...
12410410025
""" Update existing "embargo_approved_no_user" logs to link to registered project instead of the registration. """ from copy import deepcopy import logging import sys from modularodm import Q from framework.transactions.context import TokuTransaction from website.models import Node, NodeLog from website.app import i...
karenhanson/osf.io_rmap_integration_old
scripts/fix_embargo_approved_logs.py
fix_embargo_approved_logs.py
py
1,458
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "website.models.NodeLog.find", "line_number": 26, "usage_type": "call" }, { "api_name": "website.models.NodeLog", "line_number": 26, "usage_type": "name" }, { "api_name": "...
35217860162
from itertools import product import sys from bs4 import BeautifulSoup from selenium import webdriver import time import json import random sys.path.append('../..') from lib import excelUtils from lib import httpUtils from lib import textUtil from lib.htmlEleUtils import getNodeText from lib.htmlEleUtils import getInn...
Just-Doing/python-caiji
src/work/20230205/parchem.py
parchem.py
py
2,568
python
en
code
1
github-code
36
[ { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 23, "usage_type": "call" }, { "api_name": "selenium...
7416408824
import pywt import numpy as np from scipy import stats import matplotlib.pyplot as plt plt.style.use("resources/figstyle.mplstyle") FIG_WIDTH = 2.3 * 7.16 # Gaussian fitting utils from scipy import optimize def fit_generalized_gaussian(x): μ0 = x.mean() σ0 = x.std() β0 = 2 res = optimize.minimiz...
mattbit/wavelet-wqn-acha
acha_scripts/02_figure_2__coeff_distributions.py
02_figure_2__coeff_distributions.py
py
4,260
python
en
code
2
github-code
36
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 7, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name"...
10246834959
import os import argparse import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt if __name__ == '__main__': parser = argparse.ArgumentParser(description='Some hyperparameters') parser.add_argument('--epochs', type=int, default=200) parser.add_argument('--frac', type=float, default=0.1) ...
jinwoolim8180/fl-sparse-masking
accuracy.py
accuracy.py
py
3,163
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.use", "line_number": 4, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 67, "usage_type": "call" }, { "api_name": "matplot...
19074906476
from collections import Iterator, Iterable #global set_num #set_num = 0 class Disjoint_set(Iterable): def __init__(self, element=None): self.head = element self.tail = element element.set = self #global set_num #set_num += 1 def add_element(self, element): ...
LouisYLWang/Algorithms
Clustering_algorithm/Disjoint_set.py
Disjoint_set.py
py
2,199
python
en
code
0
github-code
36
[ { "api_name": "collections.Iterable", "line_number": 7, "usage_type": "name" } ]
39804183733
import os from celery import Celery # Set the default Django settings module for the 'celery' program. # similar to the setup in asgi.py # os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'prolube76site.settings') app = Celery('prolube76site') # Using a string here means the worker doesn't have to serialize # the co...
zjgcainiao/new_place_at_76
prolube76site/celery.py
celery.py
py
952
python
en
code
0
github-code
36
[ { "api_name": "celery.Celery", "line_number": 9, "usage_type": "call" } ]
31566863140
import sys import csv # preprocessing import gensim from gensim.utils import simple_preprocess import re import nltk from nltk.corpus import stopwords from nltk.tokenize import word_tokenize # lemmitization from nltk.stem import WordNetLemmatizer def pre_processor(): user_input = input('Please enter a dream...
connormeaton/dream_cluster
src/app/SampleTextPreprocessor.py
SampleTextPreprocessor.py
py
1,906
python
en
code
1
github-code
36
[ { "api_name": "re.sub", "line_number": 21, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 25, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 27, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 29, "usage_type"...
12185526029
"""Inference for 2D US Echocardiography EchoNet dataset.""" import os import numpy as np import torch import torchvision.transforms as transforms import torch.nn.functional as F from PIL import Image from torch.autograd import Variable import matplotlib.pyplot as plt from models.unet import UNet from models.cenet impo...
SanoScience/TTTS_CV
src/inference.py
inference.py
py
2,235
python
en
code
0
github-code
36
[ { "api_name": "models.fpn.FPN", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.load", "line_number": 28, "usage_type": "call" }, { "api_name": "torchvision.transforms.Compose", "line_number": 32, "usage_type": "call" }, { "api_name": "torchvision....
69997777065
from re import split from typing import Dict, Mapping from elasticsearch import Elasticsearch import cbor import json from trec_car.read_data import * class IndexManagement: def __init__(self): self.es_cli = Elasticsearch( timeout=200, max_retries=15, retry_on_timeout=True) self.es_cli...
Hanifff/ConversationalAssistance
index_data.py
index_data.py
py
3,917
python
en
code
0
github-code
36
[ { "api_name": "elasticsearch.Elasticsearch", "line_number": 11, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 46, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 47, "usage_type": "call" }, { "api_name": "json.dumps", "l...
19348729652
from app import app from flask import request, jsonify, make_response from api_exception import ApiException from data.internal_configurations.internal_configurations import InternalConfigurations @app.errorhandler(ApiException) def handle_invalid_service(error): response = jsonify(error.to_dict()) response.s...
mbast100/st-joseph-backend-services
routes/internal_configurations.py
internal_configurations.py
py
1,885
python
en
code
1
github-code
36
[ { "api_name": "flask.jsonify", "line_number": 9, "usage_type": "call" }, { "api_name": "app.app.errorhandler", "line_number": 7, "usage_type": "call" }, { "api_name": "api_exception.ApiException", "line_number": 7, "usage_type": "argument" }, { "api_name": "app.ap...
35609489128
from math import sqrt import torch from torch import nn class FSRCNN(nn.Module): """ Args: upscale_factor (int): Image magnification factor. """ def __init__(self, upscale_factor: int) -> None: super(FSRCNN, self).__init__() # Feature extraction layer. self.feature_ex...
gmlwns2000/sharkshark-4k
src/upscale/model/fsrcnn/model.py
model.py
py
2,315
python
en
code
14
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.nn", "line_...
33532112483
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ A script to test if the associations.csv are good. Typically you would run this file from a command line like this: ipython3.exe -i -- /deploy/cbmcfs3_runner/scripts/check_associations.py """ # Built-in modules # # Third party modules # import pandas from tqd...
xapple/cbmcfs3_runner
scripts/associations/check_associations.py
check_associations.py
py
4,628
python
en
code
2
github-code
36
[ { "api_name": "autopaths.auto_paths.AutoPaths", "line_number": 44, "usage_type": "call" }, { "api_name": "plumbing.databases.access_database.AccessDatabase", "line_number": 49, "usage_type": "call" }, { "api_name": "plumbing.cache.property_cached", "line_number": 46, "usa...
16721355609
import torch import torch.nn.functional as F from torch.distributions import Normal from torch.utils.data.sampler import BatchSampler, SubsetRandomSampler from torch.nn.utils import clip_grad_norm_ from PPO_Continuous.version2.Network import Actor, Critic class PPO(object): def __init__(self, st...
zhihangmuzi/deep-reinforcement-learning-with-pytorch
PPO_Continuous/version2/Agent.py
Agent.py
py
3,981
python
en
code
0
github-code
36
[ { "api_name": "PPO_Continuous.version2.Network.Actor", "line_number": 38, "usage_type": "call" }, { "api_name": "torch.optim.Adam", "line_number": 39, "usage_type": "call" }, { "api_name": "torch.optim", "line_number": 39, "usage_type": "attribute" }, { "api_name"...
12259799552
from PySide2 import QtWidgets import ui.devicesDialog_ui import input.audio class form(QtWidgets.QDialog, ui.devicesDialog_ui.Ui_Dialog): def __init__(self): super(form, self).__init__() self.setupUi(self) #setup user interface self.currentDevice = 0 #set default device self.butto...
HamerKits/RoscoeQRSSViewer
devicesDialog.py
devicesDialog.py
py
948
python
en
code
0
github-code
36
[ { "api_name": "PySide2.QtWidgets.QDialog", "line_number": 5, "usage_type": "attribute" }, { "api_name": "PySide2.QtWidgets", "line_number": 5, "usage_type": "name" }, { "api_name": "ui.devicesDialog_ui.devicesDialog_ui", "line_number": 5, "usage_type": "attribute" }, ...
3270527178
""" Model implementation. """ from helper import cache_func, INIT_METHODS import tensorflow as tf class CNNModel: """ CNN model implementation. Covers the implementations for both the large and the compact network. """ def __init__(self, data, target, model_params, data_params): self.data ...
Oguzhanka/face_attractiveness
models/cnn_model.py
cnn_model.py
py
13,191
python
en
code
0
github-code
36
[ { "api_name": "tensorflow.compat.v1.get_variable", "line_number": 30, "usage_type": "call" }, { "api_name": "tensorflow.compat", "line_number": 30, "usage_type": "attribute" }, { "api_name": "helper.INIT_METHODS", "line_number": 31, "usage_type": "name" }, { "api_...
31635729829
import os import torch import torchvision import random import pandas as pd import numpy as np import torch.nn as nn import matplotlib.pyplot as plt from PIL import Image import cv2 import torch.nn.functional as F import torchvision.transforms as transforms import torchvision.models as models from torc...
a20815579/cat_face_detection
cat_CNN.py
cat_CNN.py
py
13,278
python
en
code
1
github-code
36
[ { "api_name": "cv2.resize", "line_number": 42, "usage_type": "call" }, { "api_name": "cv2.copyMakeBorder", "line_number": 47, "usage_type": "call" }, { "api_name": "cv2.BORDER_CONSTANT", "line_number": 47, "usage_type": "attribute" }, { "api_name": "torch.utils.da...
21848108182
import numpy as np from sklearn.externals.joblib import Parallel, delayed from multiprocessing import cpu_count def apply_parallel_joblib(func, data, *args, chunk=None, overlap=10, n_jobs=None, **kwargs): """ Apply a function in parallel to overlapping chunks of an array Parameters ---------- ...
emmanuelle/skimage-sprint
chunk_joblib.py
chunk_joblib.py
py
1,921
python
en
code
0
github-code
36
[ { "api_name": "multiprocessing.cpu_count", "line_number": 42, "usage_type": "call" }, { "api_name": "sklearn.externals.joblib.Parallel", "line_number": 57, "usage_type": "call" }, { "api_name": "sklearn.externals.joblib.delayed", "line_number": 57, "usage_type": "call" ...
24396409804
import logging logger = logging.getLogger(__name__) def do_something(): logger.debug( 'Detailed information, typically of interest only when diagnosing problems.') logger.info('Confirmation that things are working as expected.') logger.warning( 'An indication that something unexpected hap...
jmhart/python-template
src/stuff/thing.py
thing.py
py
656
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 3, "usage_type": "call" } ]
2986896269
import os import h5py import numpy as np class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKCYAN = '\033[96m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' if 'KAGGLE_BASE_URL' in os.environ: challen...
felix-20/gravitational_oceans
src/helper/utils.py
utils.py
py
5,376
python
en
code
1
github-code
36
[ { "api_name": "os.environ", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_nu...
12803394908
import urllib2 import json headers = {'Content-Type': 'application/json; charset=utf-8'} XXX_HOST = "http://xxx.xxx.com/xxx-app/" # post请求,json格式数据 def post_json(url, header, request_data): req = urllib2.Request(url, request_data, header) page = urllib2.urlopen(req) res = page.read() page.close() ...
AldrichYang/HelloPython2
src/http/http_helper.py
http_helper.py
py
690
python
en
code
0
github-code
36
[ { "api_name": "urllib2.Request", "line_number": 12, "usage_type": "call" }, { "api_name": "urllib2.urlopen", "line_number": 13, "usage_type": "call" }, { "api_name": "urllib2.Request", "line_number": 27, "usage_type": "call" }, { "api_name": "urllib2.urlopen", ...
13425691279
### Unzip the Dataset # importing the zipfile module from zipfile import ZipFile import pandas as pd import random # loading the temp.zip and creating a zip object with ZipFile("./resources/Sentences_from_Stormfront_dataset.zip", 'r') as zip_oject: # Extracting all the members of the zip # into a specific loc...
Speymanhs/SemEval_2023_Task_11_Lonea
reading_dataset_stormfront.py
reading_dataset_stormfront.py
py
1,887
python
en
code
0
github-code
36
[ { "api_name": "zipfile.ZipFile", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 23, "usage_type": "call" }, { "api_name": "random.randint", "l...
71578985703
#!/usr/bin/env python import vtk def main(): pd_fn, scene_fn = get_program_parameters() colors = vtk.vtkNamedColors() polyData = ReadPolyData(pd_fn) mapper = vtk.vtkPolyDataMapper() mapper.SetInputData(polyData) actor = vtk.vtkActor() actor.SetMapper(mapper) actor.GetProperty().Set...
lorensen/VTKExamples
src/Python/Utilities/SaveSceneToFile.py
SaveSceneToFile.py
py
5,409
python
en
code
319
github-code
36
[ { "api_name": "vtk.vtkNamedColors", "line_number": 9, "usage_type": "call" }, { "api_name": "vtk.vtkPolyDataMapper", "line_number": 12, "usage_type": "call" }, { "api_name": "vtk.vtkActor", "line_number": 15, "usage_type": "call" }, { "api_name": "vtk.vtkRenderer"...
3479784873
# This is the model definition of retrieval model. from typing import List, Dict, Tuple, Text import os import tensorflow as tf import tensorflow_recommenders as tfrs import numpy as np from . import dataset as ds, params # Get unique query and candidate and timestamp. unique_user_ids, unique_therapist_ids = ds.get_u...
thomiaditya/theia
theia/config/recommender/retrieval_definition.py
retrieval_definition.py
py
6,028
python
en
code
0
github-code
36
[ { "api_name": "tensorflow.keras", "line_number": 20, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.Sequential", "line_number": 24, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 24, "usage_type": "attribute" }, { "api_name"...
37248697117
# Importing libraries and modules from tkinter import * from PIL import ImageTk, Image import time from tkinter import messagebox from tkinter.filedialog import askopenfilename # Start of GUI root = Tk() root.title("A-Star Grid World") # Grid Initialization # Ask the user if he wants to load a pre-deined world map ...
abhianshi/DynamicPathPlanning
src/AStarGUI.py
AStarGUI.py
py
8,336
python
en
code
1
github-code
36
[ { "api_name": "tkinter.messagebox.showinfo", "line_number": 16, "usage_type": "call" }, { "api_name": "tkinter.messagebox", "line_number": 16, "usage_type": "name" }, { "api_name": "tkinter.filedialog.askopenfilename", "line_number": 17, "usage_type": "call" }, { ...
33532139383
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ A script to convert the column names from CamelCase to snake_case. Typically you would run this file from a command line like this: ipython3.exe -i -- /deploy/cbmcfs3_runner/scripts/orig/convert_column_case.py """ # Built-in modules # import os # Third party ...
xapple/cbmcfs3_runner
scripts/orig/convert_column_case.py
convert_column_case.py
py
7,647
python
en
code
2
github-code
36
[ { "api_name": "os.environ.get", "line_number": 30, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 30, "usage_type": "attribute" }, { "api_name": "autopaths.auto_paths.AutoPaths", "line_number": 57, "usage_type": "call" }, { "api_name": "pandas....
36872129562
#! /usr/bin/python3 # -*- coding:utf-8 -*- from flask import Flask, request, render_template, redirect import json import os app = Flask(__name__) @app.route('/') def accueil(): if os.path.exists("db")==False: os.mkdir("db") return render_template('index.html') @app.route('/formule') def repon...
yahyalazaar/audit_project
__init__.py
__init__.py
py
7,848
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": ...
40988144291
from pathlib import Path from typing import Any, Dict import json MockData = Dict[str, Any] class Mock: """ A class that holds the `mock.json` file contents """ mock: MockData = {} @staticmethod def populate(mock_path: Path) -> None: if not mock_path.exists(): raise Exce...
viscript/Ox4Shell
lib/mock.py
mock.py
py
490
python
en
code
null
github-code
36
[ { "api_name": "typing.Dict", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 5, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 16, "usage_type": "name" }, { "api_name": "json.load", "line_number": 21, ...
72640625383
""" Project: SSITH CyberPhysical Demonstrator health.py Author: Ethan Lew <elew@galois.com> Date: 08/23/2021 Python 3.8.3 O/S: Windows 10 Component Health Monitoring Objects and Components """ import threading import abc import collections import re import requests import typing import struct import socket import time...
GaloisInc/BESSPIN-Tool-Suite
besspin/cyberPhys/cyberphyslib/cyberphyslib/demonstrator/healthmonitor.py
healthmonitor.py
py
11,624
python
en
code
5
github-code
36
[ { "api_name": "socket.inet_aton", "line_number": 35, "usage_type": "call" }, { "api_name": "struct.unpack", "line_number": 36, "usage_type": "call" }, { "api_name": "abc.ABC", "line_number": 38, "usage_type": "attribute" }, { "api_name": "abc.abstractmethod", ...
16589607570
import random import requests import codecs import json import re import queue import time from threading import Thread requests.packages.urllib3.disable_warnings() proxy = '127.0.0.1:8888' def sec(): while True: headers = { 'Referer': 'https://www.achievemint.com/signup?referral=1&utm_campaign=YOaBLXQNLBg%3D%0...
breitingerchris/public_code
Python/Achievemint/anker.py
anker.py
py
1,509
python
en
code
0
github-code
36
[ { "api_name": "requests.packages.urllib3.disable_warnings", "line_number": 10, "usage_type": "call" }, { "api_name": "requests.packages", "line_number": 10, "usage_type": "attribute" }, { "api_name": "random.randint", "line_number": 21, "usage_type": "call" }, { "...
4828779456
import torch from torch import nn import pickle from model import WideResNet from autoattack import AutoAttack from torch.utils.data import Dataset from torch.utils.data import DataLoader from torchvision import datasets, transforms, models class ImageDataset(Dataset): def __init__(self, file): super().__i...
AmadeusloveIris/AutoAdversarialTraining
test.py
test.py
py
2,316
python
en
code
0
github-code
36
[ { "api_name": "torch.utils.data.Dataset", "line_number": 10, "usage_type": "name" }, { "api_name": "pickle.load", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number": 18, "usage_type": "call" }, { "api_name": "torchvision.transfo...
19915052730
""" Write a function that takes directory path, a file extension and an optional tokenizer. It will count lines in all files with that extension if there are no tokenizer. If a the tokenizer is not none, it will count tokens. For dir with two files from hw1.py: #>>> universal_file_counter(test_dir, "txt") 6 #>>> univer...
Abbath90/python_epam
homework9/task3/file_counter.py
file_counter.py
py
1,333
python
en
code
0
github-code
36
[ { "api_name": "typing.TextIO", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.Callable", "line_number": 17, "usage_type": "name" }, { "api_name": "pathlib.Path", "lin...
20604733756
from sklearn import preprocessing from pandas import read_csv from sklearn.model_selection import train_test_split from keras.layers import Dense from keras.models import Sequential from keras.optimizers import Adam from sklearn.metrics import r2_score from matplotlib import pyplot as plt df = read_csv("C:\Code\RNASeq...
taytay191/RNAseqAnalysis
RNAseqFinal/model.py
model.py
py
1,905
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.preprocessing", "line_number": 14, "usage_type": "name" }, { "api_na...
2063569811
from functools import cache from . import get_track_data, get_countries_charts import pandas as pd @cache def get_basic_track_features(): tracks = get_track_data() isrc_cols = tracks.columns[tracks.columns.str.contains("isrc")].tolist() album_cols = tracks.columns[tracks.columns.str.contains("album")].tol...
Sejmou/exploring-spotify-charts
data-collection-and-exploration/helpers/model.py
model.py
py
3,256
python
en
code
2
github-code
36
[ { "api_name": "functools.cache", "line_number": 6, "usage_type": "name" }, { "api_name": "pandas.merge", "line_number": 36, "usage_type": "call" }, { "api_name": "functools.cache", "line_number": 25, "usage_type": "name" }, { "api_name": "pandas.merge", "line_...
938934612
import os import json class Settings: def __init__(self, settings_directory, settings_default): self.settings_directory = settings_directory self.settings_default = settings_default self.settings_file = os.path.join(self.settings_directory, "settings.json") # Make sure a settings ...
ChimeraOS/chimera
chimera_app/settings.py
settings.py
py
2,180
python
en
code
189
github-code
36
[ { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
12487564602
import filecmp import subprocess import pytest from typer.testing import CliRunner import erdantic as erd from erdantic.cli import app, import_object_from_name import erdantic.examples.dataclasses as examples_dataclasses import erdantic.examples.pydantic as examples_pydantic from erdantic.examples.pydantic import Par...
drivendataorg/erdantic
tests/test_cli.py
test_cli.py
py
6,182
python
en
code
205
github-code
36
[ { "api_name": "typer.testing.CliRunner", "line_number": 16, "usage_type": "call" }, { "api_name": "erdantic.cli.import_object_from_name", "line_number": 20, "usage_type": "call" }, { "api_name": "erdantic.examples.pydantic.Party", "line_number": 20, "usage_type": "name" ...
10208120572
import socket import threading from collections import deque from concurrent.futures import ThreadPoolExecutor from jsock.protocol import Protocol from jsock.message import MessageHeader, Message from jsock.errors import Errors from jsock.client import Client from jsock.config import Config PORT = 1337 LISTEN_NUM = 50...
jacobggman/python_black_jack_server
jsock/server.py
server.py
py
7,368
python
en
code
0
github-code
36
[ { "api_name": "jsock.config.Config", "line_number": 54, "usage_type": "name" }, { "api_name": "jsock.protocol.Protocol", "line_number": 54, "usage_type": "name" }, { "api_name": "socket.socket", "line_number": 57, "usage_type": "call" }, { "api_name": "socket.AF_I...
37989832631
""" Steps to run: python python policy_list_report_scraper.py Program written in Python 3 Program Output: 1 file: Exported_data.csv - csv file that contains the policy list report data Program Description: Progam first fetches the ASP login page paramters - __VIEWSTATE, __VIEWSTATEGENERATOR, etc and then inputs the...
tebbythomas/Freelance_Projects
Web_Data_Extraction_Projects/J11_Finance_Pro_Policy_List_Report_Generator/Policy_List_Report/policy_list_report_scraper.py
policy_list_report_scraper.py
py
7,187
python
en
code
1
github-code
36
[ { "api_name": "requests.Session", "line_number": 40, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 43, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 60, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", ...
26290834166
"""Tests for common_utils.py.""" import common_utils import pytest class TestCommonUtils: def testGetFilePathShouldRaiseError(self): common_utils.input = lambda _: 'foo' with pytest.raises(FileNotFoundError): common_utils.get_file_path() common_utils.input = input def testGetFilePathShouldNotR...
thompsond/PyAVMisc
com/AVMisc/common_utils_test.py
common_utils_test.py
py
687
python
en
code
0
github-code
36
[ { "api_name": "common_utils.input", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pytest.raises", "line_number": 9, "usage_type": "call" }, { "api_name": "common_utils.get_file_path", "line_number": 10, "usage_type": "call" }, { "api_name": "common...
477236470
import io, os from .comment_parser import CommentParser from .create_parser import CreateParser from .insert_parser import InsertParser class Reader: def __init__(self): self._tables = {} self._rows = {} self._global_errors = [] self._global_warnings = [] self._parsing_error...
cmancone/mygrations
mygrations/formats/mysql/file_reader/reader.py
reader.py
py
5,702
python
en
code
10
github-code
36
[ { "api_name": "io.IOBase", "line_number": 128, "usage_type": "attribute" }, { "api_name": "os.path.isfile", "line_number": 135, "usage_type": "call" }, { "api_name": "os.path", "line_number": 135, "usage_type": "attribute" }, { "api_name": "comment_parser.CommentP...
12234497572
import datetime from typing import List from sqlalchemy.orm import make_transient from data_access.entities.person import Person from data_access.entities.policy import Policy from data_access.entities.policy_offer_template import PolicyOfferTemplate from data_access.entities.policy_risk import PolicyRisk from data_a...
bastyje/policyapp
python/src/services/policy_service.py
policy_service.py
py
8,189
python
en
code
0
github-code
36
[ { "api_name": "data_access.repositories.person_repository.PersonRepository", "line_number": 25, "usage_type": "name" }, { "api_name": "data_access.repositories.policy_repository.PolicyRepository", "line_number": 26, "usage_type": "name" }, { "api_name": "data_access.repositories....
6296104681
import requests import urllib.parse from models import PlayByPlay from constants import headers from db_utils import insert_many class PlayByPlayRequester: url = 'https://stats.nba.com/stats/playbyplayv2' def __init__(self, settings): self.settings = settings self.settings.db.bind([PlayByPl...
Promise-Igbo/nba-sql
stats/play_by_play.py
play_by_play.py
py
3,273
python
en
code
null
github-code
36
[ { "api_name": "models.PlayByPlay", "line_number": 15, "usage_type": "name" }, { "api_name": "models.PlayByPlay", "line_number": 21, "usage_type": "name" }, { "api_name": "urllib.parse.parse.urlencode", "line_number": 31, "usage_type": "call" }, { "api_name": "urll...
21704376256
# # @lc app=leetcode.cn id=40 lang=python3 # # [40] 组合总和 II # from typing import List # @lc code=start class Solution: def combinationSum2(self, candidates: List[int], target: int) -> List[List[int]]: ans = [] current = [] def dfs(i, target): if target == 0: ans.append(current[:]) ...
LinkTsang/.leetcode
solutions/40.组合总和-ii.py
40.组合总和-ii.py
py
780
python
en
code
0
github-code
36
[ { "api_name": "typing.List", "line_number": 11, "usage_type": "name" } ]
69812436265
import numpy as np import cv2 from PIL import Image #В этом скрипте делаем маску #С помощью манипуляций с opencv создаем два файла #первый - с контрастными крышами, второй - с выделенными дорогами #затем - используя второй файл, убираем дороги с первого image = "ZRYNEEUSVQ213QTY.png" input = cv2.imread(image) _, th =...
kekartem/BuildingDefine
RunFirst.py
RunFirst.py
py
1,512
python
ru
code
0
github-code
36
[ { "api_name": "cv2.imread", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.threshold", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.THRESH_TOZERO", "line_number": 12, "usage_type": "attribute" }, { "api_name": "cv2.imwrite", "li...
18913603323
from collections import defaultdict class Solution: def valid_tree(self, n: int, edges: list[list[int]]) -> bool: seen: set[int] = set() children: dict[int, list[int]] = defaultdict(list) for x, y in edges: children[x].append(y) children[y].append(x) def d...
lancelote/leetcode
src/graph_valid_tree.py
graph_valid_tree.py
py
689
python
en
code
3
github-code
36
[ { "api_name": "collections.defaultdict", "line_number": 7, "usage_type": "call" } ]
11571428709
from django.utils.module_loading import import_string from django.urls import (RegexURLResolver, RegexURLPattern) from CRM import settings from collections import OrderedDict def recursion_urls(pre_namespace, pre_url, urlpatterns, url_ordered_dict): # None, '/', urlpatterns, url_ordered_dict ''' 第一次递归: ...
heyhito/CRM
rbac/server/routes.py
routes.py
py
2,278
python
en
code
0
github-code
36
[ { "api_name": "django.urls.RegexURLResolver", "line_number": 16, "usage_type": "argument" }, { "api_name": "collections.OrderedDict", "line_number": 45, "usage_type": "call" }, { "api_name": "django.utils.module_loading.import_string", "line_number": 47, "usage_type": "ca...
71399122025
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.common.exceptions import NoSuchElementException import time driver = webdriver.Firefox() driver.get('https://github.com/Vidoosh/Image-colorizer') time.sleep(2) code = driver.find_element(By.CSS_SELECTOR, '#re...
sravanithummapudi/st
download_button.py
download_button.py
py
901
python
en
code
0
github-code
36
[ { "api_name": "selenium.webdriver.Firefox", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 10, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 13, "usage_type": "call" }, { "api_name": "selenium.web...
71666166824
# The following code was adapted from Week 3 Programming Assignment 2 in the Convolutional Neural Networks course by DeepLearning.AI offered on Coursera # https://www.coursera.org/learn/convolutional-neural-networks/home/week/3 import tensorflow as tf import numpy as np from tensorflow.keras.layers import Input fro...
AndrewZhang126/Neural-Networks
U-Net.py
U-Net.py
py
6,154
python
en
code
1
github-code
36
[ { "api_name": "os.path.join", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 2...
33377706423
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np eps = 1e-7 class SCELoss(nn.Module): def __init__(self, num_classes=10, a=1, b=1): super(SCELoss, self).__init__() self.num_classes = num_classes self.a = a self.b = b self.cross_entropy ...
hitcszx/lnl_sr
losses.py
losses.py
py
10,369
python
en
code
42
github-code
36
[ { "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.CrossEntropyLoss", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn", ...
39209701807
# Create your views here. from django.shortcuts import render from team.models import Player from django.shortcuts import render, get_object_or_404, redirect, render_to_response from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger def home(request): context = {'message': 'Here is a message!'} ...
carolinp/Project-1
team/views.py
views.py
py
890
python
en
code
0
github-code
36
[ { "api_name": "django.shortcuts.render", "line_number": 9, "usage_type": "call" }, { "api_name": "team.models.Player.objects.all", "line_number": 12, "usage_type": "call" }, { "api_name": "team.models.Player.objects", "line_number": 12, "usage_type": "attribute" }, { ...
34141195826
import numpy as np import torch from snownlp import SnowNLP from common_utils import * from preprocessing.clean_data import batchify def get_overlap(list1, list2): """ Returns a list of words that occur in both list1 and list2. Also returns total number of words in list1 and in list2 (can be used to ...
JasmineZhangxyz/ewb-ml-censorship
similarity/metrics/list_metrics.py
list_metrics.py
py
4,969
python
en
code
0
github-code
36
[ { "api_name": "snownlp.SnowNLP", "line_number": 29, "usage_type": "call" }, { "api_name": "snownlp.SnowNLP", "line_number": 30, "usage_type": "call" }, { "api_name": "torch.load", "line_number": 64, "usage_type": "call" }, { "api_name": "preprocessing.clean_data.b...
7784263631
import twitter class pytwitter_forecast(NebriOS): listens_to = ['forecast_date'] def check(self): return True def action(self): auth = twitter.OAuth(shared.ttoken, shared.ttoken_secret, shared.tconsumer_key, shared.tconsumer_secret) t = twitter.Twitter(auth=auth)...
bandono/nebri
tweet_rain/pytwitter_forecast.py
pytwitter_forecast.py
py
874
python
en
code
0
github-code
36
[ { "api_name": "twitter.OAuth", "line_number": 12, "usage_type": "call" }, { "api_name": "twitter.Twitter", "line_number": 13, "usage_type": "call" } ]
32316213655
import time import threading import logging import traceback import datetime import os import sys import re import robotparser as rp import numpy as np import random import util import decide import queries from conn import connect class Crawler: ''' Abstract class for crawling a news source. ''' ###...
bentruitt/TopicStory
topicstory/crawler/crawler.py
crawler.py
py
8,339
python
en
code
0
github-code
36
[ { "api_name": "util.robots_url", "line_number": 74, "usage_type": "call" }, { "api_name": "robotparser.RobotFileParser", "line_number": 75, "usage_type": "call" }, { "api_name": "queries.insert_url", "line_number": 97, "usage_type": "call" }, { "api_name": "decide...
18482541642
import torch import torch.nn as nn import torch.nn.functional as F from .utils import weight_reduce_loss class FocalLoss(nn.Module): def __init__(self, use_sigmoid=True, gamma=2.0, alpha=0.25, reduction='mean', loss_weight=1.0): ...
TWSFar/FCOS
models/losses/focal_loss.py
focal_loss.py
py
1,798
python
en
code
1
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.zeros", "line_number": 31, "usage_type": "call" }, { "api_name": "torch.long", "line_number...
39184736012
####################### IMPORT LIBRARIES #################################### from pandas import ExcelFile, read_excel from pandas import datetime from sklearn.metrics import mean_squared_error from math import sqrt import matplotlib.pyplot as plt import warnings from hmmlearn.hmm import GaussianHMM import numpy as np ...
srihari1212/bloqq
HMM/Docstring_HMM_test.py
Docstring_HMM_test.py
py
4,173
python
en
code
0
github-code
36
[ { "api_name": "pandas.ExcelFile", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.datetime.strptime", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.datetime", "line_number": 21, "usage_type": "name" }, { "api_name": "pandas.date...
10567641757
import time from datetime import datetime, timedelta from pydantic import BaseModel from fastapi import FastAPI, Depends, File, UploadFile, HTTPException, Request, status from fastapi.responses import HTMLResponse, JSONResponse, FileResponse import uvicorn import os from pytube import YouTube from pytube import Playlis...
uponex/YoutubeAPI
main.py
main.py
py
7,761
python
en
code
0
github-code
36
[ { "api_name": "fastapi.FastAPI", "line_number": 13, "usage_type": "call" }, { "api_name": "pydantic.BaseModel", "line_number": 16, "usage_type": "name" }, { "api_name": "pytube.YouTube", "line_number": 34, "usage_type": "call" }, { "api_name": "fastapi.responses.J...
23313577208
import argparse import gym import random import tensorflow as tf import numpy as np from tqdm import trange from tensorflow import keras from network import SharedModel from subproc_env import EnvActor, SubProcessEnv # Some parameters taken from OpenAI # baselines implementation, since # they're not mentioned in the...
james-sorrell/reinforcement_learning
atari/ppo/main.py
main.py
py
4,674
python
en
code
2
github-code
36
[ { "api_name": "gym.make", "line_number": 37, "usage_type": "call" }, { "api_name": "network.SharedModel", "line_number": 42, "usage_type": "call" }, { "api_name": "subproc_env.EnvActor", "line_number": 49, "usage_type": "call" }, { "api_name": "subproc_env.SubProc...
16828444501
from flask import Flask,request import sqlite3 app = Flask(__name__) connection = sqlite3.connect('sms.db') curser = connection.cursor() curser.execute('create table if not exists students (sid integer primary key,name text,age integer,address text)') connection.close() @app.route('/student_details') def details():...
mubarakdalvi/mubarakdalvi
studnt_management.py
studnt_management.py
py
868
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.request.get_json", ...
11876743553
# 数据预处理 阴影过滤 #yangzhen #2020.4.13 #translate from matlab """get the shadow proportion from images of remote sensing""" import numpy as np import cv2 import os import json from shutil import copyfile import argparse def cv_imread(file_path): cv_img=cv2.imdecode(np.fromfile(file_path,dtype=np.uint8),1) retur...
jansona/GeoScripts
shadow_filter/shadowfilter.py
shadowfilter.py
py
4,966
python
en
code
0
github-code
36
[ { "api_name": "cv2.imdecode", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.fromfile", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 15, "usage_type": "attribute" }, { "api_name": "cv2.imencode", "line...
40083862973
#!/usr/bin/env python3 import argparse import random import json import re import importlib.util import os.path import sys import types import inspect import pandas as pd import numpy as np MAX_SLOT=8 SMART_COMMENT="\\s*#+\\s*(fastscore|odg)\\.(\\S*)\\s*:\\s*(\\S*)\\s*$" def is_input_slot(s): return s % 2 == 0 ##...
modelop/modelop.github.io
Product Manuals/Model Launchers/Python Launcher/lh.py
lh.py
py
9,190
python
en
code
1
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 23, "usage_type": "call" }, { "api_name": "re.match", "line_number": 58, "usage_type": "call" }, { "api_name": "re.split", "line_number": 59, "usage_type": "call" }, { "api_name": "sys.exit", "line_number...
24788697819
""" N×M 크기의 공간에 아기 상어 여러 마리가 있다. 공간은 1×1 크기의 정사각형 칸으로 나누어져 있다. 한 칸에는 아기 상어가 최대 1마리 존재한다. 어떤 칸의 안전 거리는 그 칸과 가장 거리가 가까운 아기 상어와의 거리이다. 두 칸의 거리는 하나의 칸에서 다른 칸으로 가기 위해서 지나야 하는 칸의 수이고, 이동은 인접한 8방향(대각선 포함)이 가능하다. 안전 거리가 가장 큰 칸을 구해보자. """ import sys from collections import deque N, M = list(map(int, sys.stdin.readline().stri...
inhyeokJeon/AALGGO
Python/baekjoon/17086_baby_shark_2.py
17086_baby_shark_2.py
py
1,975
python
ko
code
0
github-code
36
[ { "api_name": "sys.stdin.readline", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.stdin.readline", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.stdin", ...
23269856572
# import os import sys import csv from matplotlib.patches import Ellipse import matplotlib.transforms as transforms # import pandas as pd # from pandas.plotting import lag_plot from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import * import random import matplotlib.pyplot as plt import numpy...
lukascao/GUI_vorlesung
GUI_example.py
GUI_example.py
py
54,545
python
en
code
0
github-code
36
[ { "api_name": "typing.Optional", "line_number": 40, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 41, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 42, "usage_type": "name" }, { "api_name": "typing.Optional", ...
74649269864
# -*- coding: utf-8 -*- # @Project : selenium_event # @File : test_alert.py # @Software: PyCharm # @Author : Lizhipeng # @Email : 1907878011@qq.com # @Time : 2021/9/26 17:16 from selenium.webdriver import ActionChains from seleium_study.selenium_js.base import Base class TestAlert(Base): def test_alert(...
iospeng/python
pycharm_demo/selenium_event/seleium_study/selenium_file_alert/test_alert.py
test_alert.py
py
1,036
python
en
code
0
github-code
36
[ { "api_name": "seleium_study.selenium_js.base.Base", "line_number": 13, "usage_type": "name" }, { "api_name": "selenium.webdriver.ActionChains", "line_number": 21, "usage_type": "call" } ]
40586478771
from fastapi import APIRouter, Depends, status from sqlalchemy.ext.asyncio import AsyncSession from src.authentication import AuthModel, get_token_user from src.core.exceptions import UnprocessableEntityException from src.db.postgres import get_db from .dependencies import get_token_parent from .parents.crud import pa...
Xewus/KidEdVisor
backend/src/parents/router.py
router.py
py
1,626
python
en
code
0
github-code
36
[ { "api_name": "fastapi.APIRouter", "line_number": 12, "usage_type": "call" }, { "api_name": "parents.models.ParentModel", "line_number": 21, "usage_type": "name" }, { "api_name": "fastapi.Depends", "line_number": 21, "usage_type": "call" }, { "api_name": "dependen...
35183490035
import asyncio import os import oneai from oneai import Input, Output oneai.api_key = os.getenv("ONEAI_KEY") async def split(filepath): pipeline = oneai.Pipeline( steps=[ oneai.skills.SplitByTopic(), ] ) with open(filepath, 'r') as file_input: output = await pipeline....
clande/demo
oneai_splitbytopic_repro.py
oneai_splitbytopic_repro.py
py
808
python
en
code
0
github-code
36
[ { "api_name": "oneai.api_key", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 6, "usage_type": "call" }, { "api_name": "oneai.Pipeline", "line_number": 10, "usage_type": "call" }, { "api_name": "oneai.skills.SplitByTopic",...
17579968573
import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from numpy import * import sys file_name = sys.argv[1] data1 = loadtxt("./" + file_name) NUM=data1[:,0] # TIME=data1[:,1] # fig = plt.figure() # top = fig.add_subplot(111) # 1 riga, 1 colonna, figura 1 top.set_title('BRUTE FORCE') top.grid...
UnProgrammatore/CCQ
altre_cose/fattorizzazione_mpi_banale_print/plot.py
plot.py
py
480
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.use", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot...
12676975577
import mlflow import dvc.api import pandas as pd def yield_artifacts(run_id, path=None): """Yield all artifacts in the specified run""" client = mlflow.tracking.MlflowClient() for item in client.list_artifacts(run_id, path): if item.is_dir: yield from yield_artifacts(run_id, item.path)...
robert-min/bike_share_mlflow
model/utils.py
utils.py
py
1,317
python
en
code
0
github-code
36
[ { "api_name": "mlflow.tracking.MlflowClient", "line_number": 8, "usage_type": "call" }, { "api_name": "mlflow.tracking", "line_number": 8, "usage_type": "attribute" }, { "api_name": "mlflow.tracking.MlflowClient", "line_number": 18, "usage_type": "call" }, { "api_...
27770003302
import numpy as np import pandas as pd import matplotlib import metrics import sklearn import xgboost from sklearn import metrics from decimal import * import graphviz ''' 新細明體:PMingLiU 細明體:MingLiU 標楷體:DFKai-SB 黑体:SimHei 宋体:SimSun 新宋体:NSimSun 仿宋:FangSong 楷体:KaiTi 仿宋_GB2312:FangSong_GB2312 楷体_GB2312:KaiTi_GB2312 微軟正黑體...
kshsky/PycharmProjects
machinelearning/tools/mlTools.py
mlTools.py
py
8,384
python
en
code
0
github-code
36
[ { "api_name": "sklearn.metrics.confusion_matrix", "line_number": 55, "usage_type": "call" }, { "api_name": "sklearn.metrics", "line_number": 55, "usage_type": "name" }, { "api_name": "sklearn.metrics.accuracy_score", "line_number": 57, "usage_type": "call" }, { "a...
37986696093
""" This script is written to do analysis on GA study """ # import libraries import re import tsfresh import numpy as np import pandas as pd from pandas import ExcelWriter from sklearn.preprocessing import LabelBinarizer import matplotlib import matplotlib.pyplot as plt import seaborn as sns sns.set_style("darkgrid") ...
emilymacq/Project-Clear-Lungs
Parkinsons_ML/main/Study_Ga.py
Study_Ga.py
py
12,820
python
en
code
2
github-code
36
[ { "api_name": "seaborn.set_style", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 65, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 69, "usage_type": "call" }, { "api_name": "numpy.nan", "...
34366380953
from scripts.hackerrank.isLeapYear import is_leap, is_leap2, is_leap3, is_leap4 class Test: test_cases = [ [2004, True], [2008, True], [2012, True], [2016, True], [2005, False], [2009, False], [2013, False], [2017, False], ] testable_fun...
TrellixVulnTeam/learning_to_test_code_BL81
tests/hackerrank/test_isLeapYear.py
test_isLeapYear.py
py
560
python
en
code
0
github-code
36
[ { "api_name": "scripts.hackerrank.isLeapYear.is_leap", "line_number": 17, "usage_type": "name" }, { "api_name": "scripts.hackerrank.isLeapYear.is_leap2", "line_number": 17, "usage_type": "name" }, { "api_name": "scripts.hackerrank.isLeapYear.is_leap3", "line_number": 17, ...
43314571963
import requests def getweather(city): api = "96e3cd3e19571466a39662b984eec5f1" server = "https://api.openweathermap.org/data/2.5/weather" request = f"{server}?q={city}&appid={api}" output = requests.get(request) if output.status_code == 200: weather_data = output.json() weather = w...
XBOPb/Projects
API_Weather_App/weatherAPI.py
weatherAPI.py
py
821
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" } ]
19530926102
""" Projeto Marinha do Brasil Autor: Pedro Henrique Braga Lisboa (pedro.lisboa@lps.ufrj.br) Laboratorio de Processamento de Sinais - UFRJ Laboratorio de de Tecnologia Sonar - UFRJ/Marinha do Brasil """ from __future__ import print_function, division import os import h5py import warnings import numpy a...
pedrolisboa/poseidon
poseidon/io/offline.py
offline.py
py
6,116
python
en
code
2
github-code
36
[ { "api_name": "os.listdir", "line_number": 58, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 63, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 63, "usage_type": "call" }, { "api_name": "os.path", "line_number": 63, ...
3118375238
import torch.optim as optim ADADELTA_LEARNING_RATE = 0.05 ADADELTA_MOMENTUM = 0.9 ADADELTA_WEIGHT_DECAY = 0.005 def get_adadelta_halnet(halnet, momentum=ADADELTA_MOMENTUM, weight_decay=ADADELTA_WEIGHT_DECAY, learning_rate=ADADELTA_LEARNING_RATE):...
pauloabelha/muellerICCV2017
optimizers.py
optimizers.py
py
520
python
pt
code
2
github-code
36
[ { "api_name": "torch.optim.Adadelta", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.optim", "line_number": 11, "usage_type": "name" } ]
28436305539
import socket import subprocess import json import os import base64 import sys import shutil import time import requests from termcolor import colored from mss import mss def reliable_send(data): json_data=json.dumps(data) sock.send(json_data.encode('utf-8')) def reliable_recv(): data='' while True: ...
sharshith1312/reverse_shell
rstest1.py
rstest1.py
py
5,215
python
en
code
0
github-code
36
[ { "api_name": "json.dumps", "line_number": 15, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 28, "usage_type": "call" }, { "api_name": "mss.mss", "line_number": 33, ...
15386994551
#!/usr/bin/env python3 """게임과 론처를 묶어서 새 앱 프로토콜 버전을 서명한 뒤 패키지로 생성한다.""" import argparse import os import os.path import logging import shutil import tarfile import tempfile import zipfile from zipfile import ZIP_DEFLATED parser = argparse.ArgumentParser(description=__doc__.replace('\n', ' ')) parser.add_argument('out_...
FioX0/PandoraReborn
tools/pack/pack.py
pack.py
py
3,340
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 21, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 21, "usage_type": "attribute" }, { "api_name": "logging....
31982185532
import requests from bs4 import BeautifulSoup from datetime import datetime import os.path import csv import threading from queue import Queue # Proxies for BURP - update requests if you want to use this proxy proxies = {"http": "http://127.0.0.1:8080", "https": "http://127.0.0.1:8080"} playersFile = 'sample_corrected...
zcrosman/PDGAscrape
PDGAscrape.py
PDGAscrape.py
py
9,296
python
en
code
0
github-code
36
[ { "api_name": "queue.Queue", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 23, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime.datetime.now", ...
40144939486
from flask import request from werkzeug.utils import secure_filename from db import db from models import Img def upload_images(pic_list, private, user_id): #import pdb; pdb.set_trace() for pic in pic_list: filename = secure_filename(pic.filename) mimetype = pic.mimetype if not filen...
elmanreasat/imagipy
controllers/upload.py
upload.py
py
573
python
en
code
0
github-code
36
[ { "api_name": "werkzeug.utils.secure_filename", "line_number": 11, "usage_type": "call" }, { "api_name": "models.Img", "line_number": 17, "usage_type": "call" }, { "api_name": "db.db.session.add", "line_number": 18, "usage_type": "call" }, { "api_name": "db.db.ses...
12087004714
from sklearn.feature_extraction.text import TfidfVectorizer import nltk from nltk.corpus import stopwords from nltk.tokenize import word_tokenize import spacy,os import argparse import re from tqdm import tqdm from collections import OrderedDict import string import numpy as np from spacy.lang.en import En...
Law-AI/summarization
extractive/MMR/MMR.py
MMR.py
py
4,098
python
en
code
139
github-code
36
[ { "api_name": "spacy.lang.en.English", "line_number": 14, "usage_type": "call" }, { "api_name": "string.punctuation", "line_number": 32, "usage_type": "attribute" }, { "api_name": "string.whitespace", "line_number": 32, "usage_type": "attribute" }, { "api_name": "...
11936036688
from typing import Any, Optional, TYPE_CHECKING import logging from ..common.utils import deepmerge from .execution_method import ExecutionMethod from .aws_settings import INFRASTRUCTURE_TYPE_AWS, AwsSettings if TYPE_CHECKING: from ..models import ( Task, TaskExecution ) logger = logging.getLog...
CloudReactor/task_manager
server/processes/execution_methods/aws_base_execution_method.py
aws_base_execution_method.py
py
3,685
python
en
code
0
github-code
36
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 9, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "execution_method.ExecutionMethod", "line_number": 19, "usage_type": "name" }, { "api_name":...
3219242168
import sys sys.path.append('../VQ-VAE') from auto_encoder2 import VQ_CVAE import argparse from torch import optim from torchvision import transforms import fpa_dataset parser = argparse.ArgumentParser(description='Train an autoencoder for hand depth image reconstruction') parser.add_argument('-r', dest='dataset_root_f...
pauloabelha/handy
train_autoencoder.py
train_autoencoder.py
py
2,275
python
en
code
2
github-code
36
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "torchvision.transf...
8755383285
# -*- coding: utf-8 -*- import json import logging from datetime import datetime, date, timedelta from odoo import api, fields, models from odoo.addons.muk_dms.models import dms_base logger = logging.getLogger('FOLLOW-UP') AVAILABLE_PRIORITIES = [ ('0', u'Normale'), ('1', u'Basse'), ('2', u'Haute'), ...
odof/openfire
of_followup/models/of_followup.py
of_followup.py
py
70,070
python
en
code
3
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "odoo.models.Model", "line_number": 19, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 19, "usage_type": "name" }, { "api_name": "odoo.api.model", ...
2391690633
from threading import Thread from flask import Flask, request, redirect, session, render_template, send_file, Response, flash from flask_session import Session import os, json from bs4 import BeautifulSoup, SoupStrainer import requests, lxml, cchardet app = Flask('') app.config["SESSION_PERMANENT"] = False app.confi...
CoolCoderSJ/DataPak
main.py
main.py
py
17,220
python
en
code
3
github-code
36
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask_session.Session", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.environ", "l...
33171162837
import matplotlib.pyplot as plt import cv2 import numpy as np # from pyradar.classifiers.isodata import isodata_classification from isodataclassifier import isodata_classification def equalize_histogram(img, histogram, cfs): """ Equalize pixel values to [0:255]. """ total_pixels = img.size N, M = i...
sauravkarn541/morphological_operators
isodata.py
isodata.py
py
2,932
python
en
code
0
github-code
36
[ { "api_name": "numpy.zeros_like", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.float32", "...
3715520265
import cv2 import numpy as np def get_crops(img, annotations, padding=0): crops = [] new_img = img.copy() # Prevent drawing on original image for a in annotations: c = a['coordinates'] y1, y2 = int(c['y'] - c['height'] / 2 - padding), int(c['y'] + c['height'] / 2 + padding) x1, x2 = int(c['x'] - c['width'] /...
mattzh72/sframe-visualizer
tools/utils/segment.py
segment.py
py
1,936
python
en
code
0
github-code
36
[ { "api_name": "cv2.cvtColor", "line_number": 20, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 20, "usage_type": "attribute" }, { "api_name": "cv2.threshold", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.THRESH_BINARY_...