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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9694945557 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 20 12:20:28 2021
@author: mrgna
"""
import numpy as np
from scipy import stats
from statsmodels.distributions.empirical_distribution import ECDF
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow_probability as tfp
tf.config.set_visible_devices([],... | jnr494/MasterThesis | KolmogorovSmirnovTest.py | KolmogorovSmirnovTest.py | py | 8,446 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "tensorflow.config.set_visible_devices",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tensorflow.config",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.linspace",
"line_number": 24,
"usage_type": "call"
},
{
"api_n... |
20610268801 | from functools import wraps
import logging
from stocker.stock_exceptions import StockInformationMissingException
from typing import Tuple, Optional, Type
""" Dektoratorji za metode razreda Stock """
logger = logging.getLogger(__name__)
def error_call(func_to_call, error_to_raise):
# type: (callable, Type[StockInfor... | aljazmedic/stock-prediction | stocker/decorators.py | decorators.py | py | 5,670 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "stocker.stock_except... |
9751688415 | import torch
from torch import nn
class SimpleModel(nn.Module):
def __init__(self):
super(SimpleModel, self).__init__()
self.sequential_convs = nn.Sequential(
nn.Conv2d(1,96,(5,5),padding=2),
nn.ReLU(),
nn.MaxPool2d((2,2),stride=2,padding=0),
nn.Conv2... | michaelyhuang23/SqueezeNet | simple_model.py | simple_model.py | py | 922 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.nn.Module",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
36065131227 | from django.shortcuts import render
from .serializers import QuestSerializer, QuestCompliteSerializer
from .models import Quest, QuestComplite
from rest_framework.viewsets import GenericViewSet
from rest_framework import mixins
from rest_framework.permissions import IsAuthenticated
from rest_framework.authentication im... | nutmi/level-system | quest/views.py | views.py | py | 1,929 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.mixins.ListModelMixin",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.mixins",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "rest_framework.mixins.RetrieveModelMixin",
"line_number": 14,
"usage_type... |
72457753280 | import abc
import datetime
import json
from typing import Tuple, Dict, Union, Callable, List, Optional, Any
import copy
import pandas as pd
from numpy import NaN
import sqlalchemy as sa
from qualipy.exceptions import InvalidReturnValue
def convert_value_to_varchar(value):
if isinstance(value, dict... | baasman/qualipy | qualipy/backends/base.py | base.py | py | 5,620 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "json.dumps",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "typing.Dict",
"line_number": 76,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_numb... |
37285186108 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
LOAD QUESTIONIRES
Created on Fri Aug 29 13:20:15 2022
@author: Sophia
"""
import pandas as pd
import numpy as np
import load_utils as lu
import seaborn as sns
import matplotlib.pyplot as plt
# Import data sheets to python with pandas
#%%%
""" LOADING questionaires... | SophiaTherese/thesis | Script/load/load_questionaires.py | load_questionaires.py | py | 21,969 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_excel",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pandas.read_exc... |
37031478749 | from main import db # DB connection
from flask import Blueprint # Using a flask Blueprint because passing the app around is bad practice
db_commands = Blueprint("db", __name__) # Creating the blueprint
@db_commands.cli.command("create") # The 'create' command
def ... | brucemcclure/flask_starter_depricated | commands.py | commands.py | py | 1,934 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Blueprint",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "main.db.create_all",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "main.db",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "main.db.drop_all",
"line_... |
6067693102 | import argparse
import os
import re
def get_args():
parser = argparse.ArgumentParser('Apple and bananas', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('text', metavar='text', help='Input text or file')
parser.add_argument('-v','--vowel',help='The vowel(s) allowed', metavar='v... | feliperod0519/python | banana.py | banana.py | py | 4,014 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.isfile",
"line_number": 11,
"usage_type": "call"
},
{
"... |
72620131520 | import collections
import functools
import itertools
import multiprocessing
import random
import numpy as np
import tensorflow as tf
from absl import flags
from libml import utils, ctaugment
from libml.utils import EasyDict
from third_party.auto_augment import augmentations, policies
FLAGS = flags.FLAGS
POOL = None
... | google-research/fixmatch | libml/augment.py | augment.py | py | 15,708 | python | en | code | 1,035 | github-code | 97 | [
{
"api_name": "absl.flags.FLAGS",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "absl.flags",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "libml.utils.EasyDict",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "third_party.aut... |
28366448067 | # -*- coding: utf-8 -*-
import xlrd
import os
import json
def read_excel():
#open file
curdict=os.getcwd()
print(curdict)
file_path=curdict+r'\rent_package.xlsx'
workbook=xlrd.open_workbook(file_path)
sheet_name=workbook.sheet_names()[0]
print("店铺信息")
print(sheet_name)
sheet=workboo... | ghrhome/readexcel | rent_package/shopinfo.py | shopinfo.py | py | 2,288 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.getcwd",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "xlrd.open_workbook",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 68,
"usage_type": "call"
}
] |
72621690560 | import re
import os
import click
import uuid
class Resource(object):
TEST_ORG = "organizations/{org}".format(org=os.environ.get("TEST_ORG_ID"))
TEST_USER = "user:{email}".format(
email=os.environ.get("TEST_EMAIL")
).lower()
TEST_PROJECT_ID = os.environ.get("TEST_PROJECT_ID")
TEST_BILLING_A... | GoogleCloudPlatform/professional-services | tools/iam-permissions-copier/resources/base.py | base.py | py | 5,317 | python | en | code | 2,602 | github-code | 97 | [
{
"api_name": "os.environ.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_nu... |
74848270397 | from mongoengine import connect
from mongoengine.errors import MongoEngineException
from src.settings import settings
from src.utils.conflog import logger
class ConnectionNoSQLDatabase:
def __init__(self) -> None:
self.__client = self.create_connect()
def create_connect(self):
try:
... | anaplopes/bot-huntag | src/database/connection_nosql.py | connection_nosql.py | py | 762 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "src.utils.conflog.logger.info",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "src.utils.conflog.logger",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "mongoengine.connect",
"line_number": 15,
"usage_type": "call"
},
{
"api_na... |
33356936063 | import matplotlib.pyplot as plt
import pandas as pd
df = pd.read_csv("kandydaci_utf8.csv", delimiter=";")
url = 'https://prezydent20200628.pkw.gov.pl/prezydent20200628/pl/kandydaci'
dfs = pd.read_html(url)
# data from csv
y, x = df["Nazwisko"], df["Liczba głosów"]
# data from url
df2 = df[["Wiek"]]
# convert date... | SkrytyZubr/chart | main.py | main.py | py | 2,179 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pandas.read_html",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplot2grid",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "matplot... |
32932491680 | import requests
import json
with open('token.json', 'r') as file:
data = json.load(file)
TOKEN = data[0]['token']
class Group:
def __init__(self, id):
self.id = id
def get_params(self):
return {
'group_id': self.id,
'fields': 'members_count',
'acces... | pythonkzn/diploma_ext | modules/group.py | group.py | py | 839 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "json.load",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 22,
"usage_type": "call"
}
] |
6259707910 | '''
news_scrapper
v.2023-10-02
'''
import json
import os
import re
import string
import sys
from datetime import datetime # noqa
import openai
from dotenv import load_dotenv
from src._drv_mongodb import MongoCnx
# Load variables from .env
load_dotenv()
openai_apikey = os.getenv("OPENAI_APIKEY")
# print("DEBUG - ",... | machado000/news_scrapper | 3_rate_articles.py | 3_rate_articles.py | py | 4,808 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_n... |
25931150717 | from keras.models import Sequential,save_model
from keras.layers import Conv2D, MaxPooling2D
from keras.layers import Activation, Dropout, Flatten, Dense,BatchNormalization
from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img
import Augmentor
classes=26
pool_size = (2, 2) # s... | methi1999/scribble | Scripts/architecture.py | architecture.py | py | 3,215 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "keras.models.Sequential",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "keras.layers.Conv2D",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "keras.layers.Activation",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "k... |
36254854234 | from .utiles import es_alguna_instancia, obtener_cols_consola
from textwrap import wrap
from prettyTables import Table
from typing import NamedTuple, Union, List, Tuple
from os import get_terminal_size
MAX_TAM_COL = 15
MARGENES_Y_BORDES_TABLA_2_COLS = 7
# TODO mejorar para que pueda recibir tam desado de columnas
# ... | Kyostenas/siiau_consultas_api | siiau_consultas_api/servicio_tabla.py | servicio_tabla.py | py | 9,092 | python | es | code | 1 | github-code | 97 | [
{
"api_name": "typing.Union",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "typing.NamedTuple",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "prettyTables.Table",
"... |
38290205077 | # -*- mode: python -*-
from build import build_lib
Import('env')
target = 'mixtureRASModels'
sources = Split("""
RASModel/mxRASModel.cpp
laminar/mxRASLaminar.cpp
kOmegaSST/mxkOmegaSST.cpp
""")
caelus_inc = [
'turbulenceModels',
'transportModels/incompressible/lnInclude'
]
caelus_libs = [
'core',
'incompressibleTra... | egelja/caelus-cml | src/libraries/turbulenceModels/mixture/RAS/SConscript | SConscript | 498 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "build.build_lib",
"line_number": 25,
"usage_type": "call"
}
] | |
2379399129 | from PyQt5 import QtWidgets
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPixmap
from gui.edge_based_dices_detection_controller import EdgeBasedDicesDetectionController
import numpy as np
class EdgeBasedDicesDetectionScreen(QtWidgets.QWidget):
def __init__(self, title: str):
super().__init__()
... | TrueWarg/all-dreams | gui/edge_based_dices_detection_screen.py | edge_based_dices_detection_screen.py | py | 2,236 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QDesktopWidget",
"line_number": 17,
"usage_type": "call"
},
{
"api_nam... |
2981439883 | import os
import unittest
from datetime import datetime, timedelta
import numpy as np
from karabo.imaging.imager import Imager
from karabo.simulation.beam import BeamPattern
from karabo.simulation.interferometer import InterferometerSimulation
from karabo.simulation.observation import ObservationLong
from karabo.simu... | trailfog/Karabo-Pipeline | karabo/test/test_long_observation.py | test_long_observation.py | py | 5,552 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "unittest.TestCase",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
... |
21954824952 | # coding: utf-8
"""
VotingClassifiers.py is a file to deploy Hate Speech on Arabic
(Levantine dataset from twitter) using Word Embeddings.
We use voting on several classiefiers.
gard voting.
soft voting.
@author: Medyan
Date: Dec. 2020
"""
import argparse
from gensim.models import... | Medan-AbdelHamid/Hate-Speech | Python/SoureCode/VotingClassifiers.py | VotingClassifiers.py | py | 9,792 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "processData.get_test_seq",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "numpy.st... |
44021836532 | from bs4 import BeautifulSoup
import requests
import csv
import re
headers = {"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36"}
producct_details = []
def get_page(url):
html_text = requests.get(url,headers=headers).text
soup = BeautifulSou... | Govindvr/Amazon-Web-Scraper | webscrap.py | webscrap.py | py | 3,846 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number... |
19740731762 | """
flask module
"""
from flask import Flask, render_template, request # flask module
app = Flask(__name__)
@app.route('/')
def test():
"""
home of web
:return: hello.html
"""
return render_template('hello.html')
@app.route('/post', methods=['POST'])
def post():
"""
post value of input... | Minki-Kim95/Python_coaching | week2/main2.py | main2.py | py | 507 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "flask.reques... |
12766156164 | import random
from motor import Motor
from controller import Controller
from Distance import Distance
from Infrared import Infrared
from Tracking import Tracking
import time
import threading
from LED import LED
import RPi.GPIO as GPIO
GPIO.setwarnings(False)
smp_car = Motor() #初始化电机
smp_car.setup()
pwm1 = smp_car.p... | Rain-xyy/WiseCar | smartCar.py | smartCar.py | py | 5,482 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "RPi.GPIO.setwarnings",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "motor.Motor",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "controller.Controller",
... |
33638482258 | #! /usr/bin/env python
import numpy as np
import pickle
import os
from flask import Flask, render_template, url_for, send_from_directory
from flask_frozen import Freezer
# Global table data variable:
t = None
app = Flask(__name__)
app.config['DOC_FOLDER'] = os.path.join(os.path.dirname(__file__), 'doc/build/html/')
... | tumlinson/CIGMA | website/host_cigma.py | host_cigma.py | py | 3,380 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_num... |
34509738286 |
# Library imports
from bs4 import BeautifulSoup
import requests
# Generic web parser providing basic functionality to load a webpage
# Use this as a base class for more specific webpage parsers
class WebpageParser:
# WebpageParser version
version = '0.1'
# Used to request web page
headers = {'Use... | rtroper0/deep-learning-data-repo | Lib/GenericWebpageParser.py | GenericWebpageParser.py | py | 3,221 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 61,
"usage_type": "call"
}
] |
41987663873 | #PCA (principal component analysis) algorithm used for feature
# extraction and for dimensionality reduction.
#also can be used for explaining data behaviour
#Used in analysis of genome data and gene expression
#helps identify patterns based on correlation between features
#PCA aims to find directions of maximum varia... | Tulsani/PCA_Analyisis_Statistics | index.py | index.py | py | 5,430 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 52,
"usage_type": "call"
... |
35974728348 | import json
from flask import Flask, render_template, request, Response
from flask_restful import Resource, Api
from flask_cors import CORS
import requests
app = Flask(__name__)
api = Api(app)
CORS(app)
@app.route('/')
def video():
return render_template("video.html")
def setToken():
f = open(f'conf/token... | JeffWen0105/howhow | Python/Line/GintamaVideo/src/app.py | app.py | py | 1,509 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
... |
30734788580 | from nornir import InitNornir
from nornir_scrapli.tasks import send_configs_from_file
from nornir_utils.plugins.functions import print_result
nr = InitNornir(config_file = "config.yaml")
def random_configs(task):
task.run(task = send_configs_from_file, file = "002_bad_config.txt")
results = nr.run(task = random_... | asrivastav-aag/nornir | 002_push_bad_config.py | 002_push_bad_config.py | py | 889 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "nornir.InitNornir",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "nornir_scrapli.tasks.send_configs_from_file",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "nornir_utils.plugins.functions.print_result",
"line_number": 11,
"usage_type"... |
2239395310 | import numpy as np
import time
from ase import Atoms
from ase.calculators.calculator import Calculator, all_changes
from qml.kernels import (get_atomic_local_gradient_kernel,
get_atomic_local_kernel)
from qml.representations import generate_fchl_acsf
from rdkit import Chem
from rdkit.Chem im... | andersx/qml-ase | calculators.py | calculators.py | py | 8,534 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "rdkit.Chem.ChemicalForceFields.MMFFGetMoleculeProperties",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "rdkit.Chem.ChemicalForceFields",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "rdkit.Chem.ChemicalForceFields.MMFFGetMoleculeForceField"... |
26003979769 | import numpy as np
from scipy.linalg import khatri_rao
def cp_decomposition(
X : np.ndarray,
rank : int = 5,
max_iteration : int = 50
) -> tuple[np.ndarray, list[np.ndarray, np.ndarray, np.ndarray]]:
'''
'''
I, J, K = X.shape
A1 = np.random.randn(I, rank)
A2 = np.random.randn(J, rank)
... | Delpen9/data_analytics_mid | problem3/CPDecomposition.py | CPDecomposition.py | py | 1,348 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.ndarray",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.randn",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.r... |
71278306559 | import torch as T
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
import random
class DeepQNetwork(nn.Module):
def __init__(self,
lr,
):
super().__init__()
# FIXME: optimize for general case
self.conv1 =... | ghostcat404/DeepLearning | Reinforcement_Learning/model.py | model.py | py | 4,017 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.nn.Module",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
797652197 | # -*- coding: utf-8 -*-
"""
@File : analysis_list.py
@Time : 2023/5/18 1:02 下午
@Author : xxlaila
@Software: PyCharm
"""
from django.db import models
import logging
import uuid
from domains.models.domain_list import CLOUD_CHOICES
__all__ = ['AnalysisList']
logger = logging.getLogger(__name__)
MonitorStatus__CHO... | xxlaila/domainer | domains/models/analysis_list.py | analysis_list.py | py | 2,957 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.db.models.Model",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "django... |
6060779767 | import os
import numpy as np
import pandas as pd
import plotly
import plotly.express as px
import plotly.io as pio
from utilities.plotting_template import local_theme
pio.templates.default = local_theme
# Define population statistics
population_mean = 20
population_std = 3
# Number of samples to take f... | konnerhorton/resume_website | scripts/notebooks/small-numbers.py | small-numbers.py | py | 1,769 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "plotly.io.templates",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "plotly.io",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "utilities.plotting_template.local_theme",
"line_number": 17,
"usage_type": "name"
},
{
"api_na... |
70469762878 | """
The Purpose of this script is to download skins into the project image directory.
Further processing will be necessary to determine format of the skin. Ex. v1.8 Standard vs v1.8 Slim vs Legacy version
"""
import concurrent
from concurrent.futures.thread import ThreadPoolExecutor
import requests
from progress.bar i... | firestrand/minecraft_skin_gan | download_skins.py | download_skins.py | py | 1,547 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "progress.bar.Bar",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "concurrent.futures.thread.ThreadPoolExecutor",
"line_number": 28,
"usage_type": "call"
},
{
"api_na... |
31123472140 | from .abstract_handler import AbstractHandler
from database.dbconn import DBConn
from database.dbquery import DBQuery
from database.dbaccess_manager import access_manager
from server.key_data_checker import valid_key_checker
import json
import uuid
class DeleteUserHandler(AbstractHandler):
def request(self, req, res... | Painted-Black/BMSTU-DB-CourseWork | vet/vetserver/src/server/handlers/delete_user_handler.py | delete_user_handler.py | py | 1,472 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "abstract_handler.AbstractHandler",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.decoder",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "json.du... |
43214707369 | import torch
import torchvision
from torch import nn
from torchvision import models
from torch.autograd import Variable
from torch.utils.data import DataLoader
import torch.nn.functional as F
from torchvision import transforms
from torchvision.utils import save_image
from skimage.measure import compare_ssim as ssim
fro... | VITA-Group/All-In-One-Underwater-Image-Enhancement-using-Domain-Adversarial-Learning | train.py | train.py | py | 14,021 | python | en | code | 59 | github-code | 97 | [
{
"api_name": "torch.nn.MSELoss",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 62,
"usage_type": "name"
},
{
"api_name": "tqdm.tqdm",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "torch.autograd.Variable",
"li... |
71809647999 | from django.urls import path
from .views import cartitems, checkout, contact, detail, home, index, shop, updateItem
app_name = "shop"
urlpatterns = [
path("", home, name="home"),
path("contact/", contact, name="contact"),
path("cart/", cartitems, name="cart"),
path("checkout/", checkout, name="checko... | prashanthc1/ecom-with-auth | apps/shop/urls.py | urls.py | py | 517 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "views.home",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "views.contact",
"li... |
27303201351 | # this is sample python code
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in
import os
import pandas as pd
import numpy as np # linear al... | nbrrawal/Kaggle | Kaggle_gct/GCT_v1.py | GCT_v1.py | py | 4,719 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.set_option",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "o... |
71326622719 | import requests
import json
import log
import argparse
logger = log.get_logger(__name__)
def top_question(N, LABEL):
URL = 'https://api.stackexchange.com//2.2/questions?pagesize={}&order=desc&sort=votes&tagged={}&site=stackoverflow' # NOQA
ses = requests.Session()
resp = ses.get(URL.format(N, LABEL))
... | hoangvux116/top-quest-Stack | top-question_stack.py | top-question_stack.py | py | 1,293 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "log.get_logger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "requests.Session",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
... |
44793218206 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 30 14:02:04 2017
@author: michael
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import numpy as np
import tensorflow as tf
from deepchem.nn import activations
from deepchem.nn imp... | hssinejihene/deepchem1 | deepchem/models/tensorgraph/graph_layers.py | graph_layers.py | py | 24,719 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "deepchem.models.tensorgraph.layers.Layer",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "deepchem.models.tensorgraph.layers.convert_to_layers",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "deepchem.models.tensorgraph.layers.Layer",
"lin... |
18630340109 | """
This module provides python bindings for the Firecloud API.
For more details see https://software.broadinstitute.org/firecloud/
To see how the python bindings map to the RESTful endpoints view
the README at https://pypi.python.org/pypi/firecloud.
"""
from __future__ import print_function
import json
import sys
im... | broadinstitute/fiss | firecloud/api.py | api.py | py | 61,356 | python | en | code | 28 | github-code | 97 | [
{
"api_name": "firecloud.__about__.__version__",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "logging.ERROR",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "... |
10612848872 | """citizens table
Revision ID: 52f55f2e67de
Revises: 52cb6fc73223
Create Date: 2019-08-18 16:44:03.507728
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '52f55f2e67de'
down_revision = '52cb6fc73223'
branch_labels = None
depends_on = None
def upgrade():
#... | innaV13/analytics | migrations/versions/52f55f2e67de_citizens_table.py | 52f55f2e67de_citizens_table.py | py | 1,024 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "alembic.op.alter_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.VARCHAR",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "alembic.op.alte... |
32026814411 | from datetime import datetime
from flask_login import UserMixin
# from flask import current_app
# from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from website import db, login_manager
"""
I messed up the relationships and figured it out to late so making changes meant i had to change alot of co... | Allena101/Pizza-Store-BBB | ¤ DDD/website/models.py | models.py | py | 3,330 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "website.login_manager.user_loader",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "website.login_manager",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "website.db.Model",
"line_number": 17,
"usage_type": "attribute"
},
{
... |
17968780261 | import collections
import hashlib
import time
import multiprocessing as mp
import torch
import numpy as np
import torch.nn as nn
import scipy.stats
import matplotlib.pyplot as plt
from PIL import Image
import jax
import jax.numpy as jn
import objax
import scipy.optimize
import numpy as np
import multiprocessing as m... | tensorflow/privacy | research/neuracrypt_attack_2021/attack.py | attack.py | py | 20,831 | python | en | code | 1,824 | github-code | 97 | [
{
"api_name": "objax.Module",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "objax.nn.Sequential",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "objax.nn",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "objax.nn.Linear",... |
26597708500 | from PIL import Image
import numpy
from torchvision import transforms
import torch
import torch.cuda as cuda
from utils.logo.cnn.resnet.resnet import resnet18
def preprocess_image(numpy_array):
image = Image.fromarray(numpy_array).convert('RGB')
transform = init_transforms()
image = transform(image).unsqu... | muladzevitali/football_project | utils/ocr/ocr_resnet.py | ocr_resnet.py | py | 1,474 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "PIL.Image.fromarray",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torchvis... |
41063196956 | # -*- coding: utf-8 -*-
from __future__ import print_function, absolute_import
import argparse
import os
from pprint import pformat
import pandas as pd
from desed.logger import create_logger
from desed.download_real import download
LOG = create_logger("tripletEmbedding", "Triplet.log")
def download_from_csv(csv_p... | CO18325/DESED | real/code/download_real.py | download_real.py | py | 2,198 | python | en | code | null | github-code | 97 | [
{
"api_name": "desed.logger.create_logger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "desed.download_real.download",
"line_number": 21,
"usage_type": "call"
},
{
"api_name"... |
39768951870 | #!/usr/bin/env python
import argparse
import obspy
import os
from typing import Union
from collections import namedtuple
from obspy import UTCDateTime
no_merged_traces = 0
sample_deficit = []
total_sample_deficit = []
def add_zero_if_below_10(val):
if val < 10:
ret = '0'+str(val)
else:
ret =... | heavelock/taurus-centaur-converter | convert_taurus_centaur.py | convert_taurus_centaur.py | py | 11,204 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentTypeError",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 53,
"usage_type": "call"
},
{
"api_nam... |
3291244486 | # -*- coding: utf-8 -*-
"""
Created on Sat Jul 11 11:49:45 2020
@author: Charles
"""
print("Welcome to GitHell")
import pandas as pd
import sqlite3 as s3
# it is better to use DB Browser to load data directly to the db
# this is provided as a round trip example
#
# Read the csv file, write it as a table to an existi... | chasbecker/python-sqlite | ViaPandas.py | ViaPandas.py | py | 1,800 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql_query... |
1669491950 |
from flask import Flask, jsonify, request
from flask_cors import CORS
import pymongo
from pymongo import MongoClient
import requests
from bs4 import BeautifulSoup
import re
import time
number_pattern = "^\\d+$"
re.match(number_pattern, '42') # Returns Match object
re.match(number_pattern, 'notanumber') # Returns None... | Natez13/Proyecto_AltaDisponibildad | API/app.py | app.py | py | 5,351 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "re.match",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 19... |
25000023357 | import unittest
from test import test_support
from google.appengine.api import apiproxy_stub_map
from canvas_models import User
from dataloader import Loader
from test_data import test_users
class TestCaseUsers(unittest.TestCase):
# Only use setUp() and tearDown() if necessary
def setUp(self):
#Wipe... | wgilpin/social | social/test/test_users.py | test_users.py | py | 2,617 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.api.apiproxy_stub_map.apiproxy.GetStub",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "google.appengine.api.apiproxy_stub_map.apiproxy",
"line_number"... |
37753932049 | import pathlib
import re
import typing
import timewarp.error
import timewarp.service.package
class ALPM(timewarp.service.package.Database):
"""Arch Linux Package Manager database."""
def __init__(self, root: pathlib.Path) -> None:
super().__init__(root)
self._path = root / "var" / "lib" / "p... | branchonequal/timewarp | src/timewarp/service/package/database/alpm.py | alpm.py | py | 1,592 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "timewarp.error.service",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "timewarp.error",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "timewarp.e... |
29747615065 | import os
import sys
import logging
from PySide6 import QtWidgets, QtCore
from PySide6.QtUiTools import QUiLoader
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
import matplotlib.pyplot as plt
from simulator.launch import execute_simulator
logging... | 6G-XTREME/PoF_Simulator | start_x.py | start_x.py | py | 13,708 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.basicConfig",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "PySide6.QtCore.QThread",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "PyS... |
23924784658 | import pymysql
from datetime import datetime
import pandas as pd
from pandas import DataFrame
import time
import json
class database():
def __init__(self,host,user,password,database,port): #資料庫連線設定
self.host=host
self.user=user
self.password=password
self.database=database
... | EasonLee1128/io_database | io_database.py | io_database.py | py | 4,447 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pymysql.connect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"l... |
28740602887 | import requests
from datetime import datetime, timedelta
from flask import Flask, render_template, request
import os
app = Flask(__name__)
current_datetime = datetime.now()
today_date = current_datetime.strftime('%d-%m-%Y')
def format_date(date):
formatted_date = date.strftime("%d %b %Y")
inte... | SourabGarg/IRCTC-Live-Train-Tracking | main.py | main.py | py | 5,247 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.to... |
35953359032 | #!/usr/bin/env python
"""
This script is used to create the release package.
"""
# Imports ######################################################################
from __future__ import print_function
import os
import sys
import shutil
import argparse
import pypandoc
import subprocess
# Metadata #######################... | mtik00/obfuscator | scripts/create-package.py | create-package.py | py | 4,198 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "os.path.dirname",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.realpath",
... |
21131138879 | from requests.structures import CaseInsensitiveDict
from opentelemetry.propagators.aws.aws_xray_propagator import (
TRACE_HEADER_KEY,
AwsXRayPropagator,
)
XRAY_PROPAGATOR = AwsXRayPropagator()
def test_extract_single_header(benchmark):
benchmark(
XRAY_PROPAGATOR.extract,
{
TR... | open-telemetry/opentelemetry-python-contrib | propagator/opentelemetry-propagator-aws-xray/tests/performance/benchmarks/test_benchmark_aws_xray_propagator.py | test_benchmark_aws_xray_propagator.py | py | 561 | python | en | code | 527 | github-code | 97 | [
{
"api_name": "opentelemetry.propagators.aws.aws_xray_propagator.AwsXRayPropagator",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "opentelemetry.propagators.aws.aws_xray_propagator.TRACE_HEADER_KEY",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "requests.st... |
39269211779 | import itertools
from typing import List, Tuple
from satispy import Variable, Cnf
from satispy.solver import Minisat
import argparse
from functools import reduce
def get_adjacent_cells(i, j, rows, cols) -> List[Tuple[int, int]]:
def in_boundaries(p: Tuple[int, int]):
return rows >= p[0] >= 1 and 1 <= p[... | NikitaMishin/sat_solver | minesweep_via_sat/solver.py | solver.py | py | 11,389 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "typing.Tuple",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "satispy.Cnf",
"line_number"... |
75035990719 | import socket
import time
import select
import pygame
import pickle
from threading import Thread
pygame.init()
class Client():
def __init__(self):
self.serverHost = "127.0.0.1"
self.serverPort = 5000
self.s = None
def connect(self):
self.s = socket.socket()
self.s.connect((self.serverHost, s... | CamronW/PyGameNetworking | client.py | client.py | py | 4,335 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pygame.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "select.select",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pygame.time.Clock",
"line_... |
22395290924 |
from keras.datasets import mnist
from sklearn.preprocessing import StandardScaler
from Package.PCA import PCA
import matplotlib.pyplot as plt
import seaborn as sns
# CARGAR EL DATASET
(X_train, y_train), (X_test, y_test) = mnist.load_data()
# DISTINGUIR ENTRE UNOS Y OCHOS
X_train = X_train[(y_train==0)|(y_train==8)... | alejandrocorrealoaiza1/No-supervisado | Punto_6.py | Punto_6.py | py | 968 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "keras.datasets.mnist.load_data",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "keras.datasets.mnist",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 24,
"usage_type": "call"
},
{... |
33460498374 | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('requirements.txt') as f:
install_requires = f.read().strip().split('\n')
# get version from __version__ variable in hepsiburadacom/__init__.py
from hepsiburadacom import __version__ as version
setup(
name='hepsiburadacom',
ver... | Framras/hepsiburadacom | setup.py | setup.py | py | 589 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "setuptools.setup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "hepsiburadacom.__version__",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "setuptools.find_packages",
"line_number": 16,
"usage_type": "call"
}
] |
23359639833 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Benchmarks for this package.
To run all benchmarks and print a report to the console::
python -m healpix.bench
You can also run the benchmarks first, save the results dict
to disk as a JSON file (or share it with others) and then
print the result... | astropy/astropy-healpix | astropy_healpix/bench.py | bench.py | py | 6,706 | python | en | code | 45 | github-code | 97 | [
{
"api_name": "timeit.Timer",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "astropy.table.Table",
"line_number": 181,
"usage_type": "call"
}
] |
73055755200 | import os
import numpy as np
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
from cv2 import cv2
from pytorch_helper.utils.array import normalize_range
from pytorch_helper.utils.array import to_numpy
from pytorch_helper.utils.image import overlay_images
from pytorch_helper.utils.image import ... | daizhirui/BEVNet | src/utils/visualize.py | visualize.py | py | 3,477 | python | en | code | 19 | github-code | 97 | [
{
"api_name": "pytorch_helper.utils.array.to_numpy",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pytorch_helper.utils.array.normalize_range",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pytorch_helper.utils.array.to_numpy",
"line_number": 23,
"... |
70502516159 | import cv2
import os
import argparse
import logging
logging.log(1, 'Using OpenCV {}'.format(cv2.__version__))
parser = argparse.ArgumentParser()
parser.add_argument('--dataroot', type=str,
required=True,
help='Path to videos folder to extrat frames from')
parser.add_argument('--outf', type=str,
require... | fducau/v2v_nba | data/vid2frames.py | vid2frames.py | py | 1,388 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.log",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.__version__",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",... |
38676384120 | import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from wd import *
# VIZUALIZE DATA FOR PRESENTATION
def city_groups(x):
if x in ['21.0', '12.0', '8.0']:
return 1 # Southwest
elif x in ['10.0', '5.0', '4.0', '3.0', '6.0', '15.0']:
return 2 # Midwest
... | yvonnekmatos/kkbox-churn-project | data_viz.py | data_viz.py | py | 2,944 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.bar",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyp... |
29154174209 | import requests
import robot
from robot.api.deco import keyword
from robot.libraries.BuiltIn import BuiltIn
from RequestsLibrary import log
from RequestsLibrary.compat import urljoin
from RequestsLibrary.utils import is_file_descriptor, warn_if_equal_symbol_in_url_session_less
class RequestsKeywords(object):
ROB... | MarketSquare/robotframework-requests | src/RequestsLibrary/RequestsKeywords.py | RequestsKeywords.py | py | 15,887 | python | en | code | 454 | github-code | 97 | [
{
"api_name": "robot.utils.ConnectionCache",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "robot.utils",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "robot.libraries.BuiltIn.BuiltIn",
"line_number": 16,
"usage_type": "call"
},
{
"api_... |
28414063791 | # coding=utf-8
import xml.etree.ElementTree as ET
from xml.etree.ElementTree import Element
import os
# 批量修改整个文件夹所有的xml文件
def change_all_xml(xml_path):
filelist = os.listdir(xml_path)
#print(filelist)
# 打开xml文档
cnt=0
for xmlfile in filelist:
doc = ET.parse(xml_path + xmlfile)
#pr... | Shimadaaaaa/Rotate_label_tools | Label_tools/obb2hbb.py | obb2hbb.py | py | 2,087 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "os.listdir",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "xml.etree... |
17807089786 | # -*- coding: utf-8 -*-
import re
import scrapy
class JobboleSpider(scrapy.Spider):
name = 'jobbole'
allowed_domains = ['python.jobbole.com']
# start_urls = ['http://python.jobbole.com/']
start_urls = ['http://python.jobbole.com/89012/']
def parse(self, response):
# chrome中提取的xpath //*[@id... | abc20899/PythonLearn | src/scrapyLearn/articleSpider/ArticleSpider/spiders/jobbole.py | jobbole.py | py | 1,577 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "scrapy.Spider",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "re.match",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 25,
"usage_type": "call"
}
] |
41993915390 | import random
import logging
import json
from itertools import combinations, filterfalse
logger = logging.getLogger(__name__)
class BalanceService:
def CombinaisonsJoueurs(self, listeNJEJ):
logger.info('Création liste équipe possible')
EquipesPossibles = combinations(listeNJEJ, 4)
Equipes... | SpiritWhite66/aoe-api-balance | balancer/balance/balance.py | balance.py | py | 8,028 | python | fr | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "itertools.filterfalse",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "json.du... |
24117950791 | """
A simplistic etcd orm.
"""
import json
from bridge_common.etcdobj.fields import Field
from bridge_common.logging import LOG
__version__ = '0.0.1'
class _Server(object):
"""
Parent class for all Server implementations.
"""
def __init__(self, client, *args, **kwargs):
"""
Creates... | alfredodeza/bridge_common | bridge_common/etcdobj/__init__.py | __init__.py | py | 5,950 | python | en | code | null | github-code | 97 | [
{
"api_name": "bridge_common.logging.LOG.debug",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "bridge_common.logging.LOG",
"line_number": 62,
"usage_type": "name"
},
{
"api_name": "bridge_common.logging.LOG.debug",
"line_number": 76,
"usage_type": "call"
},
... |
21130113989 | from logging import getLogger
from typing import List, Optional
from opentelemetry import context, propagate
from opentelemetry.propagators import textmap
from opentelemetry.semconv.trace import (
MessagingDestinationKindValues,
MessagingOperationValues,
SpanAttributes,
)
from opentelemetry.trace import Li... | open-telemetry/opentelemetry-python-contrib | instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/utils.py | utils.py | py | 4,507 | python | en | code | 527 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "opentelemetry.propagators.textmap.Getter",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "opentelemetry.propagators.textmap",
"line_number": 42,
"usage_type": "nam... |
11733177420 | import unittest
from pyramid import testing
class MailinRunner2Tests(unittest.TestCase):
def setUp(self):
self.config = testing.cleanUp()
def tearDown(self):
testing.cleanUp()
def _getTargetClass(self):
from karl.utilities.mailin import MailinRunner2
return MailinRunner2
... | karlproject/karl | karl/utilities/tests/test_mailin.py | test_mailin.py | py | 11,971 | python | en | code | 48 | github-code | 97 | [
{
"api_name": "unittest.TestCase",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pyramid.testing.cleanUp",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pyramid.testing",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "pyramid.t... |
32176327342 | from pathlib import Path
correct_ref_file = False
correct_thickness = False
list_of_files = []
ref_spectrum_name = ''
reference_spectrum = []
fitting = False
spektri = []
current_real_data = []
real_data_history = []
fitted_parameters = [0, 1]
thickness_history = []
current_fitted_data = []
fitted_data_history = []
#... | LZP-2020-1-0200/RealTime_PAAO | RealTime_PAAO/common/shared.py | shared.py | py | 624 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pathlib.Path",
"line_number": 22,
"usage_type": "call"
}
] |
29510141872 | from django.db import models
from django.conf import settings
from mygpo.core.models import UpdateInfoModel
from mygpo.podcasts.models import Episode
class FavoriteEpisode(UpdateInfoModel):
# the user that has a favorite episode
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
... | gpodder/mygpo | mygpo/favorites/models.py | models.py | py | 872 | python | en | code | 257 | github-code | 97 | [
{
"api_name": "mygpo.core.models.UpdateInfoModel",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.models.ForeignKey",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.db.models",
"line_number": 11,
"usage_type": "name"
},
{
"api... |
30692813898 | import random
from typing import TextIO
import requests
from bs4 import BeautifulSoup
import pandas as pd
url='https://www.imdb.com/chart/top'
# request the url
response=requests.get(url)
html=response.text
soup=BeautifulSoup(html,'html.parser')
movietags=soup.select('td.titleColumn')
# scrape all tabe... | AmeenReda1/IMDB_web_spcraping | imdb_with_python_eng.py | imdb_with_python_eng.py | py | 1,782 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"lin... |
5840143309 | #coding=utf-8
import scrapy
from scrapy.spiders import CrawlSpider
from scrapy.selector import Selector
from scrapy.http import Request
from doubanMovie.items import DoubanmovieItem
import urllib
class doubanMovie(CrawlSpider):
name='doubanMovie'
start_urls=['https://movie.douban.com/top250?start=0&filter=']
... | LorraineZhou/doubanMovie | doubanMovieTop250/doubanMovieTop250/spiders/movieSpider.py | movieSpider.py | py | 1,713 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "scrapy.spiders.CrawlSpider",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "doubanMovie.items.DoubanmovieItem",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scrapy.selector.Selector",
"line_number": 17,
"usage_type": "call"
},
{
... |
25825178201 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import jsonpath
import requests
# DS_004 商品详情-验证输入的商品ID不存在提示用户
# 01 执行登陆获取token
data = {
"accounts": "zz",
"pwd": "123456",
"type": "username"
}
params = {
"application": "app",
"application_client_type": "weixin",
}
r1 = requests.post(url="http://shop... | fanfanwo/interfaceStudy | 资料包_01_接口测试基础与原理/代码包/class01/class01/testcase/homework/test_DS_004.py | test_DS_004.py | py | 840 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.post",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "jsonpath.jsonpath",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 33,
"usage_type": "call"
}
] |
73843159038 | from datetime import datetime, timedelta
from ebedke.utils.date import on_workdays
from ebedke.utils import facebook
from ebedke.pluginmanager import EbedkePlugin
FB_PAGE = "https://www.facebook.com/Finomfalat17/"
FB_ID = "270764739711603"
def fb_filter(post, today):
created = datetime.strptime(post['created_ti... | ijanos/ebedke | ebedke/plugins/finomfalat.py | finomfalat.py | py | 1,052 | python | en | code | 34 | github-code | 97 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "ebedke.utils.facebook.get_filtered_post",
"line_number": 21,
"usage_type": "call"
},
{
... |
17580223209 | #!/usr/bin/python
"""
IDMC:
------------
Reads IDMC HXLated csvs and creates datasets.
"""
import logging
import re
from datetime import timedelta
from operator import itemgetter
from os.path import join
from hdx.data.dataset import Dataset
from hdx.data.hdxobject import HDXError
from hdx.data.showcase import Showca... | OCHA-DAP/hdx-scraper-idmc-idu | idmc.py | idmc.py | py | 7,260 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "hdx.location.country.Countr... |
3954221937 | """
PC-BASIC 3.23 - rnd.py
Random number generator
(c) 2013, 2014 Rob Hagemans
This file is released under the GNU GPL version 3.
"""
import fp
import vartypes
import state
rnd_step = 4455680 # 0x43fd00
rnd_period = 2**24
rnd_a = 214013
rnd_c = 2531011
def prepare():
""" Initialise the rnd module. """
cl... | NestorAlbelo/PC_Basic_Brewer | pcbasic-15.03.4/rnd.py | rnd.py | py | 2,450 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "state.basic_state",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "vartypes.sint_to_value",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "state.basic_state",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "... |
3430199128 | import pandas as pd
import requests
import json
import os
from flask import Flask, request, Response
# telegram bot token
TOKEN = os.environ['TOKEN_BOT'] # return token value
def send_message(chat_id, text):
#print('TOKEN is: ', TOKEN)
url = 'https://api.telegram.org/bot{}/'.format(TOKEN)
url = url + 'se... | joaomj/telegram_api | RossmanBot.py | RossmanBot.py | py | 4,124 | python | pt | code | 0 | github-code | 97 | [
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "requests.post",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"l... |
25229687441 | from collections import namedtuple
from datetime import datetime, timedelta
TimeOffset = namedtuple('TimeOffset', 'offset date_str divider')
NOW = datetime.now()
MINUTE, HOUR, DAY = 60, 60*60, 24*60*60
TIME_OFFSETS = (
TimeOffset(10, 'just now', None),
TimeOffset(MINUTE, '{} seconds ago', None),
TimeOffse... | buzonek/PyBitesExcersises | 92/humanize_date.py | humanize_date.py | py | 1,137 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "collections.namedtuple",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "datetime.... |
7945824161 | # -*- coding: utf-8 -*-
"""
Created on Fri Sep 8 17:07:00 2017
@author: Spencersun
"""
import requests
from bs4 import BeautifulSoup
import os
html = requests.get("https://en.wikipedia.org/wiki/Music_(disambiguation)")
plain_text = html.text
soup = BeautifulSoup(plain_text, "html.parser")
print (soup... | flarefansy/ASE_lab-Assignments | ICE3/Lesson3_ICE_1.py | Lesson3_ICE_1.py | py | 684 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 14,
"usage_type": "call"
}
] |
20934731302 | import urllib
import logging
import json
def bch_run_cmd(line, config):
logger = logging.getLogger('bot.cmd.bch')
url = urllib.urlopen('https://api.gdax.com/products/BCH-USD/stats')
if url.getcode() != 200:
logger.error('Request failed with http error: ' + str(url.getcode()))
return False
... | WKNiGHT-/btc-bot | commands/bch/__init__.py | __init__.py | py | 900 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "urllib.urlopen",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 11,
"usage_type": "call"
}
] |
74129456959 | import pyrebase
import RPi.GPIO as GPIO
import time
#Firebase credentials
config = {
"apiKey": "",
"authDomain": "",
"databaseURL": "",
"storageBucket": ""
}
firebase = pyrebase.initialize_app(config)
db = firebase.database()
# GET bulbs
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
pin_dict = {
"bulb... | DhilipBinny/_SwithBulbs-iot-PYTHON-DIALOGFLOW-FIREBASE | Raspberry_control.py | Raspberry_control.py | py | 1,083 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pyrebase.initialize_app",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO.setmode",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "RPi.GPIO.BCM",
... |
3357316272 | import scrapy
from scrapy_splash import SplashRequest
import csv
class AppSpider(scrapy.Spider):
name = 'app'
with open("BarbersData.csv","w") as f:
writer = csv.writer(f)
writer.writerow(['Category','Name','Phone','Street Address','Locality','Region','Postal Code'])
allowed_domains = [... | huzaifabaloch/Web-Crawling | Daraz Mobiles/Daraz/Daraz/spiders/truelocal.py | truelocal.py | py | 1,992 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "scrapy.Spider",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "csv.writer",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "scrapy_splash.SplashRequest",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "scrapy_splash... |
5710313148 | from django.core.management.base import BaseCommand, CommandError
from tree_sitter import Language, Parser, Tree
from plagiarism.tokens import Token, parse_tree
from plagiarism.sources import parse_source, match_sequences, tokenize_source
class Command(BaseCommand):
def handle(self, *args, **options):
fi... | Kandeel4411/peam-backend | src/plagiarism/management/commands/test_plagiarism.py | test_plagiarism.py | py | 2,712 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "tree_sitter.Tree",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "plagiarism.sources.parse_source",
"line_number": 34,
"usage_type": "call"
},
... |
25739299952 | from django.conf import settings
from django.test.simple import DjangoTestSuiteRunner
from pyelasticsearch.exceptions import IndexAlreadyExistsError
# custom test changes elasticsearch index name
class CustomTestSuiteRunner(DjangoTestSuiteRunner):
def setup_test_environment(self, **kwargs):
super(CustomTe... | CENDARI/editorsnotes | editorsnotes/testrunner.py | testrunner.py | py | 1,281 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "django.test.simple.DjangoTestSuiteRunner",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.ELASTICSEARCH_PREFIX",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 11,
"usage_t... |
22596051055 | import sqlite3 as s
con = s.connect('orders.db')
cur = con.cursor()
delete = input("Please enter the Order ID to delete: ")
cur.execute('DELETE FROM orders WHERE order_id=?', (delete,))
con.commit()
con.close() | jakekeaneHO/OrderManagement | Program Files/deleteorder.py | deleteorder.py | py | 214 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sqlite3.connect",
"line_number": 3,
"usage_type": "call"
}
] |
33149491285 | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 29 15:39:57 2021
@author: norab
"""
import sys
import yaml
from treeRun import treeRun
import timeit
def main(configFilepath=None):
"""
Function:
- call function to run program
- path to configuration file given as 1st argu... | norabbull/Willow2 | Willow1.0/src/treeMain.py | treeMain.py | py | 1,726 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.argv",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "yaml.safe_load",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "treeRun.treeRun",
"line_number": 34,
"usage_type": "call"
}
] |
73189061439 |
## Uncomment for Jupyter notebook:
## %matplotlib inline
import pandas
import numpy as np
import matplotlib.pyplot as plt
# Can use the 'Institution 1 Location' to select "domestic" (US and FN) students:
US_states = ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA",
"HI", "ID", "IL", "IN",... | arangb/GraduateAdmissions | Analytics.py | Analytics.py | py | 26,761 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot.rc",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pandas.read_excel",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.Serie... |
15748338637 | import time
import asyncio #для ассинхронных запросов
import aiohttp #для ассинхронных запросов
import json
from hooks import (
write2TxtFile,#params = text, file_name ; save text to 'data' folder
getDataSync,#params = url ; return soup
# try:
... | RodinOleksandr/web_scraping_core_tmpl | main.py | main.py | py | 3,166 | python | ru | code | 1 | github-code | 97 | [
{
"api_name": "time.time",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "aiohttp.ClientSession",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "asyncio.Event",
"line_n... |
2033492031 | """
该脚本用于抓取 Jenkins 的历史构建信息,保存为一个 xlsx 表格。
用法:
pip install jenkinsapi openpyxl
python fetch_jenkins_build_history.py
"""
import jenkinsapi
import openpyxl
def get_build_history(jk) -> list:
for job_name in jk.keys():
job = jk.get_job(job_name)
number = job.get_next_build_number()
if number... | LeoHsiao1/python_apps | scripts/fetch_jenkins_build_history.py | fetch_jenkins_build_history.py | py | 1,672 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "jenkinsapi.custom_exceptions",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "jenkinsapi.jenkins.Jenkins",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "jenkinsapi.jenkins",
"line_number": 36,
"usage_type": "attribute"
},
{
... |
27663656009 | import requests
import json,hashlib,sys
import gevent
from gevent.queue import Queue
import time
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
class gwhatweb(object):
def __init__(self,url):
self.tasks = Queue()
self.url = url.rstrip("/")
fp = open('file/data.json')
webdata ... | TheYuuu/Osmotic-visualization | cms_scan.py | cms_scan.py | py | 2,265 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "gevent.queue.Queue",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
... |
19514042734 | from django.conf.urls import url
from django.urls import path
from book import views
app_name = 'book'
urlpatterns = [
path('<slug:slug>/', views.BookViewSet.as_view(), name='book_detail'),
path('<slug:slug>/readers/', views.ReadersOfBook.as_view(), name='readers_of_book'),
path('<slug:slug>/reviews/', v... | ducksonmoon/Book-Social-Platform | book/urls.py | urls.py | py | 813 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "book.views.BookViewSet.as_view",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "book.views.BookViewSet",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name... |
36094301587 | import sys
from setuptools import find_packages, setup
assert sys.version_info >= (3,), 'Python 3 is required'
VERSION = '1.0'
setup(
name='automation-exercise',
version=VERSION,
description='Automation example',
author='Heber Parrucci',
author_email='heber013@gmail.com',
url='',
packag... | heber013/behave-selenium | setup.py | setup.py | py | 481 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.version_info",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "setuptools.setup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 17,
"usage_type": "call"
}
] |
16022075727 | import datetime
import backtrader as bt
import backtrader.analyzers as btanalyzers
import pandas as pd
from collections import defaultdict
# Create a subclass of Strategy to define the indicators and logic
class SmaCross(bt.Strategy):
# list of parameters which are configurable for the strategy
params = dict(... | lacanese/lacuna | ivy.py | ivy.py | py | 3,525 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "backtrader.Strategy",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "backtrader.ind.SMA",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "backtrader.ind",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "backtr... |
496684232 | #usage
# python3 ns4tunnels.py genconfigs ns4virtunnels.json
# python3 ns4tunnels.py create ns4virtunnels.json
# python3 ns4tunnels.py start ns4virtunnels.json
# python3 ns4tunnels.py stop ns4virtunnels.json
# python3 ns4tunnels.py destroy ns4virtunnels.json
import json
import traceback
import sys
import subprocess
im... | vewe-richard/sd-wan-env | ns4tunnels.py | ns4tunnels.py | py | 6,512 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "json.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_number": 112,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_... |
17425620839 | import argparse
from re import T
from tqdm import tqdm
import matplotlib.pyplot as plt
import os
import numpy as np
import habitat
import torch.optim as optim
import torch
from models import QNet
from Environment import is_done, get_environment, get_action_by_id
from Agent import RandomAgent
from visual import put_m... | MhdMohammadi/Explore | main.py | main.py | py | 8,878 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "models.QNet",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "datasets.ReplayMemory",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "torch.optim.Adam",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "torch.optim",... |
35588207677 | from pylab import *
from scipy.stats import spearmanr
from utils.read_data import read_from_csv
import modules.infotheo.info_theo as info
def get_high_entropy_atts(data, start=0.3, end=0.4, steps=0.01, cut=0.0001, alpha=0.01, debug=False):
# treatment="'"+treatment+"'"
samplesizez = []
dic = dict()
bl... | CoreyCole/HypDB | HypDB/core/att_filtering.py | att_filtering.py | py | 2,878 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "modules.infotheo.info_theo.Info",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "modules.infotheo.info_theo",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "scipy.stats.spearmanr",
"line_number": 32,
"usage_type": "call"
},
{
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.