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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3471857383 | import datetime
def message(msg):
print("\n------------------- "+msg.title()+" -------------------\n")
def box_message(msg):
s = "-" * (len(msg)+6)
print(s + "\n| "+msg.title()+" |\n"+ s)
def transformDate(date):
try:
splitted = list(map(lambda item : int(item), date.split("-")))
... | trset/Auction-System | utils.py | utils.py | py | 621 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime",
"line_number": 20,
"usage_type": "call"
}
] |
25234742924 | import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Conv2D, Flatten, Dropout, MaxPool2D
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.models import load_model
from tensorflow.keras.callbacks import EarlyStoppi... | Ashish2Parimi/Chrome-Bot | Network.py | Network.py | py | 2,533 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tensorflow.keras.models.Sequential",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.layers.Conv2D",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.layers.MaxPool2D",
"line_number": 14,
"usage_type": "c... |
4909866886 | from tkinter import *
from tkinter import ttk
import sqlite3
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter, A4
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.platypus import SimpleDocTemplate,Image
import webbrowser
root = Tk()
... | Felipe500/CRUD-CADASTRO-CLIENTES-PYTHON-TKINTER-SQLITE | main.py | main.py | py | 10,777 | python | pt | code | 6 | github-code | 36 | [
{
"api_name": "webbrowser.open",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "reportlab.pdfgen.canvas.Canvas",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "reportlab.pdfgen.canvas",
"line_number": 23,
"usage_type": "name"
},
{
"api_name":... |
36278467986 | import numpy
import scipy.linalg
from utils import utils
def compute_Sw_Sb(D, L):
num_classes = L.max()+1
D_c = [D[:, L==i] for i in range(num_classes)]
n_c = [D_c[i].shape[1] for i in range(num_classes)]
mu = utils.vcol(D.mean(1))
mu_c = [utils.vcol(D_c[i].mean(1)) for i in range(len(D_c))]
S... | aldopietromatera/2023_biometric_identity_verification_ML | BIV/biv/dimred/LDA.py | LDA.py | py | 1,155 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "utils.utils.vcol",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "utils.utils",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "utils.utils.vcol",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "utils.utils",
"line... |
26377828934 | from django.urls import path
from .views import *
urlpatterns = [
path('', BaseView.as_view(), name='base'),
path('catalog/all', CatalogView.as_view(), name='catalog'),
path('catalog/<str:slug>/', CategoryDetailView.as_view(), name='category_detail'),
path('catalog/<str:ct_model>/<str:slug>/', Product... | IvanPogorenko/MoonPie | todo/mainapp/urls.py | urls.py | py | 1,207 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
216944000 | # compose_flask/app.py
from flask import Flask
from redis import Redis
app = Flask(__name__)
redis = Redis(host='redis-container', port=6379)
@app.route('/')
def hello():
redis.incr('hits')
return ' - - - great has viewed {} time(s) - - -'.format(redis.get('hits'))
if __name__ == "__main__":
app.run(deb... | BigNews3/Docker | jour 2 - docker-compose/app/app.py | app.py | py | 356 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "redis.Redis",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "redis.incr",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "redis.get",
"line_number": 11,
... |
29288381937 | from src.futureLoc import futureLoc
import pytest
from unittest.mock import Mock, patch
from datetime import datetime
import requests
infoMessage = "On the 25/10/2023 at MLA airport: \n"
coldMessage = "It will be cold so you should wear warm clothing.\n"
warmMessage = "It will be warm so you should wear light clothing... | benbezz02/SoftwareTestingAssignment1 | tests/futureLoc_test.py | futureLoc_test.py | py | 3,395 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "src.futureLoc.futureLoc.getFutureInfo",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "src.futureLoc.futureLoc",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.today",
"line_number": 21,
"usage_type": "call"
},
{
... |
41242720350 | # -*- coding: utf-8 -*-
# @Author : lileilei
# @File : views.py
# @Time : 2017/12/7 12:19
from flask import Blueprint
from flask import redirect,request,render_template,url_for,flash,session,abort,jsonify,make_response
from flask.views import MethodView
from app import db
from app.models import *
from app.fo... | mingming2513953126/pythondemo | FXTest-master/app/task/views.py | views.py | py | 12,466 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "time.time",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number":... |
17883605005 | import sys
from typing import TYPE_CHECKING, Callable, Dict, List
from PySide2.QtWidgets import QApplication
from PySide2.QtCore import Signal, QLocale, QTranslator
from lib.extensions.extensionlib import BaseExtension, BaseInterface
if TYPE_CHECKING:
pass
from lib.extensions.extensionlib import extension_li... | pyminer/pyminer | pyminer/packages/applications_toolbar/main.py | main.py | py | 5,307 | python | en | code | 77 | github-code | 36 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"... |
10770344019 | import subprocess
import logging
import cliff.command
import configparser
import workflowlister
import json
import os
import sys
class Generator(cliff.command.Command):
"This Generator will generate new job orders based on the contents of ~/ini-dir. Be aware that it will also rewrite your params.json file and your... | ICGC-TCGA-PanCancer/cli | scripts/commands/generator.py | generator.py | py | 12,326 | python | en | code | 8 | github-code | 36 | [
{
"api_name": "cliff.command.command",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cliff.command",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "workflowli... |
6105238329 | import numpy as np
import cv2
cap = cv2.VideoCapture(1 + cv2.CAP_V4L)
cap.set(cv2.CAP_PROP_CONVERT_RGB, 0) # turn off RGB conversion
while(True):
# Capture frame-by-frame
_, frame = cap.read()
bf81 = np.array(frame // 16, dtype=np.uint8)
# Create the mask
#binary = cv2.imread('Masked_Image.png', ... | maykef/Fluorometer | opencv_contours.py | opencv_contours.py | py | 736 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_V4L",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "cv2.CAP_PROP_CONVERT_RGB",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.ar... |
33540682823 | #!/usr/bin/env python3
import logging
from apache_beam.runners import DataflowRunner
from modules import combined_pipeline
def run(argv=None):
logging.getLogger().setLevel(logging.INFO)
p = combined_pipeline.create_pipeline()
pipeline_result = p.run(argv)
if not isinstance(p.runner, DataflowRunner)... | HTTPArchive/data-pipeline | run_combined.py | run_combined.py | py | 405 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "modules.combined_pipeline.create_pipeline",
"line_number": 12,
"usage_type": "call"
},
{
"api... |
3449199506 | # -*- coding: utf-8 -*-
r"""
Módulo ``cpwc``
===============
O CPWC (*Coherent Plane Wave Compounding*) é um algoritmo utilizado para
reconstruir imagens quando o tipo de inspeção é por ondas planas (*plane
waves*). Nesse método, todos os elementos de um transdutor do tipo *array*
linear são disparados simultaneamente... | matheusfdario/role-finder | AUSPEX-smart_wedge/imaging/cpwc.py | cpwc.py | py | 19,398 | python | pt | code | 0 | github-code | 36 | [
{
"api_name": "framework.data_types.ImagingROI",
"line_number": 102,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "framework.data_types.DataInsp",
"line_number": 186,
"usage_type": "name"
},
{
"api... |
260051339 | #!/usr/bin/env python
'''
Handy script to prepare the data for Tensorflow object detection API.
'''
import tensorflow as tf
import yaml
import os
import sys
from object_detection.utils import dataset_util
flags = tf.app.flags
flags.DEFINE_string('output_path', 'out.record', 'Path to output TFRecord')
flags.DEF... | iamfaisalkhan/CarND-Capstone | traffic_light_detection/prepare_tf_record.py | prepare_tf_record.py | py | 3,358 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "tensorflow.app",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.gfile.GFile",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "tensorflow.gfile",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "tens... |
37709437793 | from datetime import timedelta
from flask import Flask, render_template, session, url_for, request, jsonify, app
from pymongo import MongoClient
import hashlib
import json
client = MongoClient('mongodb://bibi:6666667!@3.34.129.197', 27017)
db = client.MyPick31
app = Flask(__name__)
############
#라우팅 함수# : 홈 / 디테일 /... | JiHoon-JK/MyPick31 | app/run.py | run.py | py | 34,199 | python | ko | code | 0 | github-code | 36 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.app",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_nu... |
16779725846 | #quicksort
from random import shuffle
import pygame, time
from math import ceil
from random import shuffle
import pygame, time
sizex = 1800
sizey = 1200
surface = pygame.display.set_mode((sizex,sizey))
colour = [255, 5, 5]
black = (0,0,0)
red = (255, 5, 5)
black = (0,0,0)
green = (0, 255, 5)
blue = (5, 5, 255)
n ... | FergusMunro/Sorting-Algoritms-in-Pygame | quicksort.py | quicksort.py | py | 2,098 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.display.set_mode",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "random.shuffle",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pygame.dra... |
13990607578 | """
This is faster approach leveraging counting sort algorithm,
whose complexity is linear; O(n), where n = len(s)
It may not be evident that algorithm below is linear, given the
intrinsic nested loops (3 levels). But one way to look at that,
is that we are imposing a tree structure of 2 levels above the list.
On the ... | dariomx/topcoder-srm | leetcode/zero-pass/google/sort-characters-by-frequency/Solution1.py | Solution1.py | py | 1,767 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.defaultdict",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "itertools.imap",
"line_number": 46,
"usage_type": "call"
}
] |
18540102269 |
import random
import numpy as np
import cv2
import matplotlib.pyplot as plt
from torch.utils.data import Dataset, DataLoader
import os
import random
import math
from datetime import datetime
from collections import Counter
import pandas as pd
import numpy as np
import cv2
from PIL import Image
from pathlib import Pa... | byrongt12/CNN_fruit_disease_detection | code/dataset.py | dataset.py | py | 6,842 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "numpy.rollaxis",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
... |
19271830686 | import uuid
from flask import request
from flask.views import MethodView
from flask_smorest import abort, Blueprint
from resources.db import *
from schemas import StoreSchema
from models import StoreModel
from resources.db import db
from sqlalchemy.exc import SQLAlchemyError, IntegrityError
blb = Blueprint("stores", _... | ahmad22us/rest-apis-project | resources/store.py | store.py | py | 2,426 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask_smorest.Blueprint",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.views.MethodView",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "models.StoreModel.query.get_or_404",
"line_number": 18,
"usage_type": "call"
},
{
... |
40857498901 | from __future__ import print_function
import numpy as np
import scipy as sp
from healpy import query_disc
from numba import jit
from picca import constants
from picca.utils import print
# npb = number of parallel bins (to avoid collision with numpy np)
npb = None
ntb = None
ntm= None
npm= None
rp_max = None
rp_min =... | vserret/picca | py/picca/cf.py | cf.py | py | 24,065 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "healpy.query_disc",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "healpy.query_disc",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"li... |
22729212301 | #!/usr/bin/python3
import argparse
import os
import re
parser = argparse.ArgumentParser(description='Creates a directory with rasdaman import-ready files structure by creating symlinks to the cubeR native file structure.')
parser.add_argument('--dataDir', default='/media/GFTP/landsupport/cubeR/tiles/', help='directo... | IVFL-BOKU/landsupport | python/rename2rasdaman.py | rename2rasdaman.py | py | 2,855 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
... |
11488764915 | from enum import Enum
from pathlib import Path
from typer import Option, Typer
from .upload import upload
class Track(str, Enum):
internal = "internal"
alpha = "alpha"
beta = "beta"
production = "production"
rollout = "rollout"
app = Typer()
@app.callback()
def callback():
"""
Androi... | leynier/androidpublisher | androidpublisher/main.py | main.py | py | 1,007 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "enum.Enum",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typer.Typer",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 4... |
32341359777 | '''
Created on Jul 19, 2011
@author: rtaylor
'''
from segment import Segment
from shell import Shell
from circle import Circle
from mymath import reflect,calcShellAngle
from math import tan,atan
from numpy.linalg import norm
class Module:
'''
A complete foxsi module. By default, it consists of seven nested sh... | humatic/foxsi-optics-sim | src/foxsisim/module.py | module.py | py | 8,412 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "mymath.calcShellAngle",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "shell.Shell",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "math.tan",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "math.atan",
"line_numb... |
7055227899 | #from django.shortcuts import render
from django.shortcuts import get_object_or_404, render
from django.http import HttpResponse
import redis
# Create your views here.
def home(request): # load page home
return render(request,'task/home.html')
#*************************************************************
def is_... | rasoolgh71/isredis | task/views.py | views.py | py | 947 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.shortcuts.render",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "redis.StrictRedis",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 30,
"usage_type": "call"
}
] |
23012205675 | """
Este código implementa a parte Coletora de um programa de fila de mensagens que coleta,
classifica e distribui tweets de acordo com tópicos selecionados pelo cliente.
Autores:
- Caio Miglioli @caiomiglioli
- Ryan Lazaretti @ryanramos01
Data de Criação: 30 de Maio de 2023
Ultima alteração: 31 de Maio de 2023
"... | caiomiglioli/sistemas-distribuidos | mq/colector/colector.py | colector.py | py | 2,464 | python | pt | code | 0 | github-code | 36 | [
{
"api_name": "csv.reader",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "pika.BlockingConnection",
"line_... |
34684398194 | #!/Users/kalindbl/bin/virtualenv/biopython/bin/python
'''
Take an xml file of MDS-IES annotations and produce a new XML file with these added annotations:
- whether the MDS annotation is "valid," i.e. covers the MAC chromosome completely with only pointer overlap
- which MAC contigs come from multiple MIC loci
- wh... | kelind/scrambling-pfsa | annotate_xml_maps.py | annotate_xml_maps.py | py | 5,720 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 89,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 90,
"usage_type": "call"
},
{
"api_name"... |
21144519916 | import json
import logging
import os
import pickle
import random
import multiprocessing
from copy import deepcopy
import torch
from torch.utils.data import DataLoader, Dataset
from tqdm import tqdm
from ipdb import set_trace
from transformers import AutoTokenizer, BertTokenizer
class MemExamples:
def __init__(se... | KeDaCoYa/MKG-GC | knowledge_embedding/src/utils/lpbert_dataset.py | lpbert_dataset.py | py | 17,076 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "random.choice",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
... |
75260155305 | from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from rest_framework.test import APIClient
from rest_framework import status
from core.models import Tag, Recipe
from recipes.serializers import TagSerializer
TAG_URL = reverse("recipes:tag-list")
def sa... | trolliama/recipes-api | app/recipes/tests/test_tags_api.py | test_tags_api.py | py | 3,796 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.reverse",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.test.TestCase",
"line_number": 19,
"usage_type": "name"
},
{
"api_n... |
11188337575 | import subprocess
import shlex
import re
import os
import time
import platform
import json
import sys
import base64
import random
import datetime
import traceback
import robot_util
import _thread
import copy
import argparse
#import audio_util
import urllib.request
import rtc_signaling
from subprocess import Popen, PIP... | robotstreamer/robotstreamer_win_obs | send_video_obs_webrtc.py | send_video_obs_webrtc.py | py | 9,495 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "robot_util.getWithRetry",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "copy.deepc... |
34450879227 | import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import ListedColormap
from matplotlib.lines import Line2D
import pandas as pd
#Max R during main sequence and max R in general
z = [0.001, 0.02]
Rgen = np.zeros([70,3])
Rms = np.zeros([70,3])
n = 0
for metal in z:
i... | kajasiek/Astrophysics5 | Task 2/task2-data.py | task2-data.py | py | 4,441 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.zeros",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_numbe... |
36902270914 | from fenics import *
from mshr import *
import scipy.io
import numpy as np
data = scipy.io.loadmat('neuron_input_1.hdf5')
if MPI.rank(MPI.comm_world) == 0:
print(data.keys())
x = data['x']
y = data['y']
z = data['z']
xlen = x.max() - x.min()
ylen = y.max() - y.min()
zlen = z.max() - z.min()
if MPI.rank(MPI.com... | CINPLA/KNPsim | examples/hay_model/make_mesh.py | make_mesh.py | py | 1,247 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "scipy.io.io.loadmat",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "scipy.io.io",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "scipy.io",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "numpy.sqrt",
"line_num... |
17752793066 | import socket
from jsonNetwork import Timeout, sendJSON, receiveJSON, NotAJSONObject, fetch
from threading import Thread, Timer
import importlib
import sys
from championship import Championship, addPlayer, getAllPlayers, getState, changePlayerStatus, updateState, hookRegister
from graphics import ui
def checkClient(ad... | jmimassi/IA-Abalone | server.py | server.py | py | 3,582 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "jsonNetwork.fetch",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "championship.getAllPlayers",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "championship.getState",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "ch... |
8912694482 | from config.config_train import dataset_type
model_file = {
"noun" : { "pretrain" : "cnn_noun_pretrain.pt", "train" : "cnn_noun_train.pt" },
"pronoun" : { "pretrain" : "cnn_pronoun_pretrain.pt", "train" : "cnn_pronoun_train.pt" },
"verb" : { "pretrain" : "cnn_verb_pretrain.pt",... | philgookang/pcr | config/config_file.py | config_file.py | py | 2,527 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "config.config_train.dataset_type",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "config.config_train.dataset_type",
"line_number": 29,
"usage_type": "name"
}
] |
22533622469 | import requests
from config import API_KEY
# from flask import jsonify
def get_data(query):
# query = "Bread"
print(query)
url = "https://api.nal.usda.gov/fdc/v1/foods/search?"
query_url = f"{url}api_key={API_KEY}&query={query}"
x = requests.get(query_url)
# x = requests.get('https://ap... | reginesgit/Nutritional-Analysis-of-USDA-Foods | get_foods.py | get_foods.py | py | 634 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "config.API_KEY",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
}
] |
19699158710 | import json
MANDATORY_SETTINGS = ('FunctionName', 'Handler', 'Role', 'Runtime')
def load_settings(filepath):
with open(filepath, 'r') as f:
settings = json.loads(f.read())
for key in MANDATORY_SETTINGS:
try:
assert key in settings
except AssertionError:
raise K... | InfraPixels/powerlibs-aws-lambda-deployer | powerlibs/aws/λ/deployer/lambda_settings.py | lambda_settings.py | py | 398 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.loads",
"line_number": 8,
"usage_type": "call"
}
] |
30609717940 | # Python: v3.9.13, OS: Windows 11
import os
import sys
import json
import random
import geojson
import folium
import webbrowser
import pandas as pd
# GTFS folder location
input_folder = r'D:\dev\github\GTFS_Visualization\01_source\Open_Data_MMTS_Hyd'
# Output folder location to store geojson, html files
output_fold... | sahachandan/GTFS_Visualization | 02_script/visualize_routes_without_shapes_txt.py | visualize_routes_without_shapes_txt.py | py | 8,835 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.exists",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numb... |
21654121522 | from requests import request
from json import loads
emails = [
("hello.world", "failure"),
("hello.world@company.com", "success"),
("hello.world@", "failure"),
("hello.world@.com", "failure"),
("hello.world@company.gov.in", "success"),
("hello.world@company.edu", "success")
]
for email in ... | Amitroshan1/python | JSON/email_api.py | email_api.py | py | 770 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.request",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 23,
"usage_type": "call"
}
] |
59323449 | import f90nml
import sys
import os
import shutil
import numpy as np
import subprocess
import integral2d
import math
from scipy.special import *
cwd = os.getcwd()
args = sys.argv
root = args[1]
dest = args[2]
opt = args[3]
coef = float(dest)
fdtd_path = "/home/b/b36288/large0/drude/fdtd"
root... | takagi-junya/pyprogs | param.py | param.py | py | 4,849 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.getcwd",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 2... |
8446087178 | import pickle
import unittest
from cupy.cuda import cutensor
@unittest.skipUnless(cutensor.available, 'cuTensor is unavailable')
class TestExceptionPicklable(unittest.TestCase):
def test(self):
e1 = cutensor.CuTensorError(1)
e2 = pickle.loads(pickle.dumps(e1))
assert e1.args == e2.args
... | cupy/cupy | tests/cupy_tests/cuda_tests/test_cutensor.py | test_cutensor.py | py | 353 | python | en | code | 7,341 | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cupy.cuda.cutensor.CuTensorError",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cupy.cuda.cutensor",
"line_number": 11,
"usage_type": "name"
},
{
"api_nam... |
23959473202 | import pymongo
from datetime import datetime, timedelta
from db import DBHandler
from tinkof import FetchPrices, quotation2float
import asyncio
import os
connString = os.getenv('MONGODB_CONNSTRING')
dbName = os.getenv('MONGODB_DATABASE')
client = pymongo.MongoClient(connString)
db2 = client[dbName]
def CalcProfit(b... | Ne0Ment/nomisma | updateprices.py | updateprices.py | py | 2,162 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.getenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"li... |
29290633558 | __author__ = "Hao Qin"
__email__ = "awww797877@gmail.com"
import numpy as np
from data import dummy
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
BATCH_SIZE = 32
def get_y(poses, index_pose1, index_pose2, num_batch_images, max_transform, max_rotation):
transform = np.square(
... | QinHarry/CNN_SLAM | temp.py | temp.py | py | 1,927 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "numpy.square",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.square",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.absolute",
"line_numbe... |
15985105295 | from inspect import signature
import torch
import torch.nn as nn
from mmcv.runner import force_fp32
from mmdet.core import images_to_levels, multi_apply, unmap, MaxIoUAssigner
from mmrotate.core import (build_assigner, obb2hbb, build_sampler,
rotated_anchor_inside_flags, )
from ..builder i... | zhangiguang/EOOD | mmrotate/models/dense_heads/rotated_eood_head.py | rotated_eood_head.py | py | 23,502 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "rotated_anchor_head.RotatedAnchorHead",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "builder.build_loss",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "builder.build_loss",
"line_number": 81,
"usage_type": "call"
},
{
"api_n... |
7253701477 | from core.models import Habit, DailyRecord, User
from rest_framework import serializers
class DailyRecordSerializer(serializers.ModelSerializer):
class Meta:
model = DailyRecord
fields = ("date", "note",)
class HabitSerializer(serializers.ModelSerializer):
daily_records = DailyRecordSerializ... | Momentum-Team-9/django-habit-tracker-esparr | api/serializers.py | serializers.py | py | 875 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "core.models.DailyRecord",
"line_number": 7,
"usage_type": "name"... |
36521165263 | import json
import pandas as pd
from sklearn.ensemble import RandomForestClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.metrics import accuracy_score, f1_score
def train_model(features, target, train_params):
mt = train_params.model_type
if train_params.model_type == 'RandomForestClas... | made-mlops-2022/made_obarskayats | ml_project/models/model_fit_predict.py | model_fit_predict.py | py | 1,782 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sklearn.ensemble.RandomForestClassifier",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sklearn.tree.DecisionTreeClassifier",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.f1_score",
"line_number": 29,
"usage_type": "... |
74497600425 | #!/usr/bin/env python3
import asyncio
import atexit
import json
import socket
from collections import deque
from datetime import datetime
from logging import getLogger, INFO, StreamHandler, FileHandler
from time import sleep
from subprocess import run
from os import path
from simple_pid import PID
from tinkerforge.i... | BenVosper/heated | regulated.py | regulated.py | py | 17,089 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 29,
"usage_type": "argument"
},
{
"api_name": "logging.StreamHandler",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "collections.... |
38724560306 | # import the packages
from getAnimePics.items import GetanimepicsItem
import datetime
import scrapy
from scrapy.exceptions import CloseSpider
pageNumber = 0
class CoverSpider(scrapy.Spider):
name = "gelbooruSearch"
allowed_domains = ['gelbooru.com']
start_urls = ["https://gelbooru.com/index.php?page=post&... | kkc028/Animage-Scraper | getAnimePics/spiders/coverspider.py | coverspider.py | py | 2,990 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "scrapy.Spider",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "getAnimePics.items.GetanimepicsItem",
"line_number": 65,
"usage_type": "call"
}
] |
38697493522 | # TODO: import 見直し
import numpy as np
from collections import deque
from tqdm import tqdm # progress bar
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import gym
from gym import spaces
from gym.spaces.box import Box
import cv2
cv2.ocl.setUseOpenCL(False)
from stabl... | retrobighead/space_invaders | lib/environments.py | environments.py | py | 11,257 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.ocl.setUseOpenCL",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.ocl",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "gym.make",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
... |
27519529329 | import urllib
import urllib.request
from bs4 import BeautifulSoup
import os
def table(url):
thepage=urllib.request.urlopen(url)
soup=BeautifulSoup(thepage,"html.parser")
return soup
# soup=table("https://www.marmiton.org/recettes/")
# page1=soup.findAll('h4',{'class':'recipe-card__title'})
# tab=[]
# fo... | mousaa32/web-scrapping | marmiton.py | marmiton.py | py | 1,671 | python | fr | code | 0 | github-code | 36 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "urllib.request",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 8,
"usage_type": "call"
}
] |
6631832723 | import numpy as np
from tqdm import tqdm
import random
import matplotlib.pyplot as plt
from simplenn.layers import *
class Model:
def __init__(self, layers, verbose=False):
self.layers = layers
def set_verbosity(self, verbose):
for l in self.layers:
if hasattr(l, 'verbose'):
... | tlsdmstn56/simple-nn | example/train_linear_model.py | train_linear_model.py | py | 3,129 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.uniform",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.... |
37229458402 | from django.conf import settings
from django.contrib import admin
from django.urls import path, include
from . import views
from django.conf.urls.static import static
from django.contrib.staticfiles.storage import staticfiles_storage
from django.views.generic.base import RedirectView
from filebrowser.sites import site
... | awsomkiller/onlineTutorial | onlineTutorial/urls.py | urls.py | py | 1,649 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.contrib.admin.site",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 12,
"usage_type": "attribute"
},
{
... |
20940467211 | import torch
import torch.nn as nn
from collections import OrderedDict
class OrientedRPN(nn.Module):
def __init__(self, cfg: dict = {}):
super().__init__()
self.fpn_level_num = cfg.get("fpn_level_num", 5)
self.fpn_channels = cfg.get("fpn_channels", 256)
self.num_anchors = cfg.get("n... | Simon128/pytorch-ml-models | models/oriented_rcnn/oriented_rpn/oriented_rpn.py | oriented_rpn.py | py | 1,346 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.ModuleDict",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
40311915793 | import backtrader as bt
from datetime import datetime
import pandas as pd
import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = (15,8)
import csv
cerebro = bt.Cerebro(stdstats=False)
cerebro.addobserver(bt.observers.BuySell)
cerebro.addobserver(bt.observers.Broker)
data = bt.feeds.GenericCSVData(
datan... | webclinic017/volatility-strategy | backtest/DemoVolatility.py | DemoVolatility.py | py | 6,703 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "backtrader.Cerebro",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bac... |
42456044912 | import time
import numpy as np
import scipy.io as sio
from datetime import datetime
import cPickle as pickle
import sys
# local modules
import wtahash as wh
import cluster
import utils
class Evaluation:
''' Class for evaluating the speed and storing the rankings of a dataset
using WTAHash.
'''
def... | pombredanne/wtahash | evaluation.py | evaluation.py | py | 13,985 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "cPickle.load",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "datetime.datetim... |
7813321006 | import json
from typing import List
import click
import requests
import sqlalchemy as sa
from aspen.config.config import Config
from aspen.database.connection import (
get_db_uri,
init_db,
session_scope,
SqlAlchemyInterface,
)
from aspen.database.models import Pathogen, PathogenLineage
from aspen.util... | chanzuckerberg/czgenepi | src/backend/aspen/workflows/import_lineages/load_lineages.py | load_lineages.py | py | 5,861 | python | en | code | 11 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number":... |
8425228760 | import os
from cv2.cv2 import CascadeClassifier, imread
def detect_face(image_path):
# Get user supplied values
casc_path = os.path.join(os.path.dirname(__file__), "haarcascade_frontalface_default.xml")
# Create the haar cascade
face_cascade = CascadeClassifier(casc_path)
# Read the image as gr... | wobeng/zappa_resize_image_on_fly | detect_face.py | detect_face.py | py | 748 | python | en | code | 17 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.cv2.CascadeClassifier",
... |
16609451607 | from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.chrome.options import Options
from dat... | kronolith1/ps5-bot | src/selenium_driver.py | selenium_driver.py | py | 2,797 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 18,
"usage_type": "call"
},
{
... |
31414845762 | from lib2to3.pytree import Node
from pythonds import Stack
obj = Stack() # Creating object of stack class
class Prime:
prime = {}
prime_anagram = [] # Creating prime_anagram list
prime_list = prime.prime(0, 1000) # Creating list of prime number in given range
for num in prime_list: # Checking ... | AkashBG3010/PythonPracticePrograms | DataStructuresPrograms/prime_stack.py | prime_stack.py | py | 977 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pythonds.Stack",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "lib2to3.pytree.Node",
"line_number": 27,
"usage_type": "call"
}
] |
10744162091 | import numpy as np
from pydub import AudioSegment
import librosa
def get_segment(audio, start, end):
return audio[int(start * 1000): int(end * 1000)]
def to_librosa(audiosegment):
channel_sounds = audiosegment.split_to_mono()
samples = [s.get_array_of_samples() for s in channel_sounds]
fp_arr = np.... | SergWh/datasets_processing | model/model.py | model.py | py | 1,776 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.iinfo",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "librosa.util.pad_center",
... |
2808409231 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__version__ = "0.3.0"
__author__ = "Abien Fred Agarap"
import argparse
from utils.data import plot_confusion_matrix
def parse_args():
parser = argparse.ArgumentParser(
description="Confusion Matr... | AFAgarap/gru-svm | utils/results_summary.py | results_summary.py | py | 2,156 | python | en | code | 136 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "utils.data.plot_confusion_matrix",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "utils.data.plot_confusion_matrix",
"line_number": 41,
"usage_type": "call"
}
] |
73313411625 | # -*- coding: utf-8 -*-
# @Time : 2022 09
# @Author : yicao
import csv
import os
import math
import numpy as np
import torch
from utils import model_utils
class TopKUtil:
def __init__(self, mod_len: int, sparse_rate: float = 0.05, record_top_k_value=False,
record_top_k_value_csv_name=None, ... | zhengLabs/FedLSC | utils/top_k_utils.py | top_k_utils.py | py | 7,698 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "numpy.ones",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 35,
... |
72745850025 | from django.http import HttpResponse
from django.shortcuts import render, redirect
from .models import Movies
from .form import MovieForm
# Create your views here.
def Home(request):
movies = Movies.objects.all()
context = {
'movie_list': movies
}
return render(request, "home.html", context)
... | neetutom/movieProject | movie_project/movieApp/views.py | views.py | py | 1,327 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "models.Movies.objects.all",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.Movies.objects",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "models.Movies",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "djang... |
29197648237 | import re
from . import Target, Entity
from geotext import GeoText
from spacy.lang.en.stop_words import STOP_WORDS
class LocationParser(Target):
def __init__(self):
super().__init__()
self.stop_words = STOP_WORDS
self.stop_words.add("university")
self.stop_words.add("central")
... | kherud/native-language-identification | pipeline/pipes/geolocation.py | geolocation.py | py | 1,801 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "spacy.lang.en.stop_words.STOP_WORDS",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "geotext.GeoText",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.finditer",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "re.IG... |
264247579 | """
https://portswigger.net/web-security/csrf/lab-referer-validation-broken
"""
import sys
import requests
from bs4 import BeautifulSoup
site = sys.argv[1]
if 'https://' in site:
site = site.rstrip('/').lstrip('https://')
s = requests.Session()
login_url = f'https://{site}/login'
resp = s.get(login_url)
soup = ... | brandonaltermatt/penetration-testing-scripts | csrf/referer-validation-broken.py | referer-validation-broken.py | py | 1,002 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "requests.Session",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 17,
"usage_type": "call"
}
] |
42046912149 | import gdal2tiles
from osgeo import gdal
# -b это слой, который берем, порядок слоев 1, 2, 3 так как sample.tif в формате rgb.
def sliceToTiles(
geotiffName,
geotiffBytes,
slicesOutputPath,
optionsTranslate=['-if GTiff', '-ot Byte', '-b 1', '-b 2', '-b 3', '-of vrt', '-scale'],
... | moevm/nosql2h23-ecology | worker/app/image_processing/geotiff_slicer/slice2tiles.py | slice2tiles.py | py | 1,282 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "osgeo.gdal.FileFromMemBuffer",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "osgeo.gdal",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "osgeo.gdal.Open",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "osgeo.gdal",
... |
2405850792 | import torch
from torch import nn
import torch.nn.functional as F
import numpy as np
import matplotlib.pyplot as plt
class FixedRandomPermutation(nn.Module):
"""Layer with random but fixed permutations in order to mix the data"""
def __init__(self, input_dim, seed):
super(FixedRandomPermutation, self)... | thomasbbrunner/tum-adlr-ws20-06 | src/models/INN.py | INN.py | py | 7,218 | python | en | code | 0 | 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": "numpy.random.seed",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"lin... |
74588530663 | # coding=utf-8
"""
Encore REST services
REST Documentation : https://www.encodeproject.org/help/rest-api/
# ### Encode REST TEST
# BioREST import Encode
# encode = Encode()
# response = encode.biosample('ENCBS000AAA')
# encode.show_response(response)
"""
__author__ = "Arnaud KOPP"
__copyright__ = "© ... | ArnaudKOPP/BioREST | BioREST/Encode.py | Encode.py | py | 3,029 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "BioREST.Service.REST",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 70,
"usage_type": "call"
}
] |
35815327993 | from collections import defaultdict
from random import randint
import numpy as np
class GridWorldEnv():
def __init__(self,
height,
width,
forbidden_grids,
target_grids,
target_reward = 1,
forbidden_reward = -1,
... | zhilu1/rl_practice | rl_envs/grid_world_env.py | grid_world_env.py | py | 4,674 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.zeros",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "collectio... |
29007233825 | from encodings import search_function
from selenium import webdriver
import os
from selenium.webdriver.common.keys import Keys
class Home2(webdriver.Edge):
def __init__(self,driver_path=r"C:/Users/vaish/Desktop/Self Learning/Cloud/DEVOPS/SELENIUM",teardown=False):
self.teardown=teardown
self.driv... | Donuts252001/Netmeds | ENTERING_VALUES/home2.py | home2.py | py | 929 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "selenium.webdriver.Edge",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "seleniu... |
22630594275 | # insert check
# db에 입력할 것인지 안할 것인지 확인
# module
import sys
import json
from modules import Insert_data
def func(items):
franchise_list = []
# get franchise list from ./franchise_list.json
with open('franchise_list.json') as json_file:
franchise_list = json.load(json_file)
ans = ""
for i i... | unChae/store_list | dist/modules/Insert_check.py | Insert_check.py | py | 939 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.stdin.readline",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "modules.Insert_data.func"... |
72424386023 | import json
# Path to your file
file_path = 'conv_sample'
def extract_text_from_data(data):
try:
post_list = data.get('post_list', [])
if post_list:
first_post = post_list[0]
return first_post.get('text', 'Text not found')
else:
return 'No posts in the l... | charlieaccurso/charlie_research | Emoji/extract_text.py | extract_text.py | py | 1,179 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.loads",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.JSONDecodeError",
"line_number": 33,
"usage_type": "attribute"
}
] |
40097697635 | import base64
import sys
import os
import datetime
import json
import requests
import scrapy
import urllib.parse
from utils import *
def findphone(name):
print(f'searching {name}')
qname=urllib.parse.quote_plus(name)
response=requests.get(f'https://www.google.com/search?hl=fr&ie=UTF-8&oe=UTF-8&q={qname}+t%C3%A9... | acrowther/findphone | main.py | main.py | py | 866 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "urllib.parse.parse.quote_plus",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "urllib.parse.parse",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "urllib.parse",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "re... |
70606557225 | # 使用AKSHARE + mysql 实现动态抓取个股的交易历史数据
# 同理外面再包一层循环就可以把所有的交易历史数据下载每个股票一个表。
# 后续下载历史数据并且定制下每天更新脚本这样历史交易数据就解决了。
#
# 后续就是弄个回测框架
#
# 添加宏观因素 再添加个股微观因素 再历史回测因素相关性
import time
from datetime import datetime
import pandas as pd
import warnings
from sqlalchemy import create_engine
import akshare as ak
warnings.filterwarnings("ig... | cgyPension/pythonstudy_space | 04_learn_quantitative/akshare采集/source.py | source.py | py | 4,440 | python | zh | code | 7 | github-code | 36 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.options",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pandas.options",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "panda... |
75174338985 | import cv2, sys
import numpy as np
def main():
if len(sys.argv) < 2:
print("usage: python edgedetector.py <imagename>")
exit()
# read in the image as color and greyscale
color = cv2.imread(sys.argv[1],1)
# remove noise
color = cv2.GaussianBlur(color,(3,3),0)
cv2.imwrite("contour... | squeakus/bitsandbytes | opencv/sobel.py | sobel.py | py | 1,368 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "sys.argv",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "cv2.GaussianBlur",
"line_numb... |
6752261336 | # -*- coding: utf-8 -*-
from PyQt5.QtWidgets import QDialog, QTreeWidgetItem
from PyQt5.QtCore import pyqtSignal, pyqtSlot
from product.controllers.productcontroller import ProductController
from labrecord.controllers.labrecordscontroller import LabrecordsController
from verification.views.selectrecords import Ui_Dia... | zxcvbnmz0x/gmpsystem | verification/modules/selectrecordsmodule.py | selectrecordsmodule.py | py | 2,672 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "verification.views.selectrecords.Ui_Dialog",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 12,
"usage_type": "call"
},... |
6994689610 | from lib.cuckoo.common.abstracts import Signature
class InjectionRunPE(Signature):
"""Works much like InjectionThread from injection_thread.py - so please
read its comment there to find out about the internal workings of this
signature."""
name = "injection_runpe"
description = "Executed a process... | cuckoosandbox/community | modules/signatures/windows/injection_runpe.py | injection_runpe.py | py | 1,453 | python | en | code | 312 | github-code | 36 | [
{
"api_name": "lib.cuckoo.common.abstracts.Signature",
"line_number": 3,
"usage_type": "name"
}
] |
41538262741 | import random
import string
from django.db import transaction
from django.db.models import Q
from django.shortcuts import render,redirect
from django.core.mail import send_mail
from django.http import HttpResponse, response
from django_redis import get_redis_connection
from redis import Redis
from user.captcha.image ... | pengbin0205/git_one | user/views.py | views.py | py | 5,801 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "user.captcha.image.ImageCaptcha",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "random.sample",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "string.ascii_letters",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name"... |
16825022923 | import collections
import numpy as np
import pandas as pd
import nltk, string
from nltk import word_tokenize # Convert paragraph in tokens
from sklearn.feature_extraction.text import TfidfVectorizer
nltk.download('punkt')
text_data = pd.read_csv("Text_Similarity_Dataset.csv")
stemmer = nltk.stem.porter.PorterStemm... | centipede13/Text_Similarity | STS_Pred.py | STS_Pred.py | py | 1,235 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "nltk.download",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "nltk.stem.porter.PorterStemmer",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "nltk.ste... |
74032141222 | """
Extract loss plots from log file
"""
import matplotlib.pyplot as plt
import numpy as np
import Config
def main():
train_loss_l = np.empty((0, 5))
train_class_l = np.empty((0, 3))
train_metric_l = np.empty((0, 3))
valid_loss_l = np.empty((0, 5))
valid_class_l = np.empty((0, 3))
valid_metr... | Tianananana/Angio-Stenosis-Detection | LossPlot.py | LossPlot.py | py | 7,644 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "numpy.empty",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": ... |
23413091064 | # -*- coding: utf-8 -*-
"""
A auto compressed disk cache backed requests maker.
"""
import typing
import requests
from diskcache import Cache
from .decode import decoder
class CachedRequest(object):
"""
Implement a disk cache backed html puller, primarily using ``requests`` library.
Usage:
.... | MacHu-GWU/crawlib-project | crawlib/cached_request.py | cached_request.py | py | 5,737 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "diskcache.Cache",
"line_number": 59,
"usage_type": "name"
},
{
"api_name": "diskcache.Cache",
"line_number": 72,
"usage_type": "argument"
},
{
"api_name": "requests.Response",
"line_number": 87,
"usage_type": "attribute"
},
{
"api_name": "decode.dec... |
14878275140 | import argparse
import csv
import itertools
import os
import subprocess
import sys
import tempfile
from typing import Any, Callable, Dict, Generic, Iterable, List, NamedTuple, TextIO, Tuple, TypeVar, Optional, Union
# The following command line options participate in the combinatorial generation.
# All other arguments... | AndroidBBQ/android10 | frameworks/base/startop/scripts/app_startup/app_startup_runner.py | app_startup_runner.py | py | 12,868 | python | en | code | 176 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.realpath",
"lin... |
13989593352 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QMainWindow, QApplication
from PyQt5.QtWidgets import QPushButton
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
btn... | shellever/Python3Learning | thirdparty/pyqt5/signals/event-sender.py | event-sender.py | py | 952 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QPushButton",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QPushButton",
"line_number": 19,
"usage_type": "call"
},
{
... |
27766460728 |
import pygame
from pygame.locals import *
from utils import *
os.path.dirname(__file__)
class Mouse(pygame.sprite.Sprite):
def __init__(self):
pygame.sprite.Sprite.__init__(self)
self.load_sprite()
def load_sprite(self):
self.sheet, self.sheet_rect = load_image('CURSORS_SHEET_1.png')
self.frames = []
wi... | aladdin83/airport_control | lib/mouse.py | mouse.py | py | 775 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pygame.sprite",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.Sprite.__init__",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "py... |
72021503465 | from django.urls import path
from .views import loginPage, loginWithFlutter, logout, logoutFlutter, signupPage, signupWithFlutter
urlpatterns = [
path('signup/', signupPage, name='signup'),
path('login/', loginPage, name='login'),
path('logout/', logout, name='logout'),
path('loginflutter/', loginWithF... | chrisbagas/C08 | login_form/urls.py | urls.py | py | 488 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "views.signupPage",
"line_number": 5,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.loginPage",... |
6752686356 | # -*- coding: utf-8 -*-
from PyQt5.QtWidgets import QWidget, QTreeWidgetItem
from stuff.controllers.stuffcontroller import StuffController
from product.controllers.productcontroller import ProductController
from workshop.views.productioninstruction import Ui_Form
import datetime
class PorductionInstructionModule(Q... | zxcvbnmz0x/gmpsystem | workshop/modules/productioninstructionmodule.py | productioninstructionmodule.py | py | 3,775 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "workshop.views.productioninstruction.Ui_Form",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "stuff.controllers.stuffcontroller.StuffController",
"line_number": 18,
... |
980796399 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.metrics import accuracy_score
import sys
import os
sys.path.append("/Users/forute/Documents/Academy/Resaech/Clustering_Worker")
import experiment_syn.worker_num.create_worker_labeling_number_dataset as csd
import not_public.model.Dawid... | HideakiImamura/MinimaxErrorRate | experiment1/main.py | main.py | py | 4,253 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.arange",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "experiment_syn.worker_num.cr... |
12867831014 | ############################################################
# Author: Aravind Potluri <aravindswami135@gmail.com>
# Description: A simple python based video streaming app.
############################################################
# Libraries
import cv2
import socket
import pickle
import struct
# Set up the... | name-is-cipher/pyVidStream | vidPlay.py | vidPlay.py | py | 1,439 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "socket.socket",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "struct.calc... |
37734863671 | from __future__ import print_function
import time
import numpy as np
import matplotlib.pyplot as plt
from stats232a.classifiers.fc_net import *
from stats232a.data_utils import *
from stats232a.gradient_check import eval_numerical_gradient, eval_numerical_gradient_array
from stats232a.solver import Solver
from stats232... | riemanli/UCLA_STATS_232A_Statistical_Modeling_and_Learning_in_Vision_and_Cognition | project2/stats232a/test.py | test.py | py | 27,975 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.max",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.maximum",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 47,... |
211978352 | """Contains models to use for prediction and classification."""
import pandas as pd
import joblib
from pandas import DataFrame
from sklearn.feature_selection import RFECV
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVC
from visualise im... | MikeyJL/fetal-health | src/model.py | model.py | py | 2,762 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.DataFrame",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
... |
19544623520 | # pyCharm and pyQT5 require significant setup
# https://pythonpyqt.com/how-to-install-pyqt5-in-pycharm/
# install pyqt5. pyqt5-sip, pyqt5-tools for use with pycharm
# PyCharm select File | Settings | Tools | PyCharm. External Tools, click + New Tools, Create QTdesigner and PyUIC tools
from PyQt5 import QtGui, QtC... | Richard-Kershner/Audio-Video-Screen-TimeStamp-Recorder | main.py | main.py | py | 4,362 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.getcwd",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "os.path.isdir",
... |
23078124291 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, copy
from spa.clientside import CSocketPool, CConnectionContext, CSqlite
class MyStruct(object):
def __init__(self):
self.reset()
def reset(self):
self.dmax = 0.0
self.dmin = 0.0
self.davg = 0.0
self.returned = ... | udaparts/socketpro | samples/auto_recovery/test_python/test_python.py | test_python.py | py | 2,569 | python | en | code | 27 | github-code | 36 | [
{
"api_name": "spa.clientside.CSocketPool",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "spa.clientside.CSqlite",
"line_number": 18,
"usage_type": "argument"
},
{
"api_name": "spa.clientside.CConnectionContext",
"line_number": 32,
"usage_type": "call"
},
... |
13600318080 | import scrapy
from common.util import xpath_class
from event.items import ResponseItem
class BIOEventSpider(scrapy.Spider):
name = 'bio_event'
base_url = 'https://www.bio.org'
events_path = '/events'
source = 'BIO'
custom_settings = {
'ITEM_PIPELINES': {
'event.spiders.bio.p... | JuroOravec/knwldg | event/event/spiders/bio/spiders.py | spiders.py | py | 1,199 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "scrapy.Spider",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "scrapy.http",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "common.util.xpath_c... |
36714514227 | from dash import html
import dash_bootstrap_components as dbc
from dash.development.base_component import Component
from dataviz.irenderer import IDataStudyRenderer
from dash import dcc
from dataviz.plot_types import name_to_plot
from dataviz.assets.ids import IDAddPlotModal as ID
horizontal_line = html.Hr(style={'... | adangreputationsquad/theriver | dataviz/pages/add_plot_modal.py | add_plot_modal.py | py | 3,145 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "dash.html.Hr",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "dash.html",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "dataviz.irenderer.IDataStudyRenderer",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "dash_boot... |
40082631108 | # import packages / libraries
import torch
from torchvision.models import resnet
class MNIST_classifier(torch.nn.Module):
""" implements a simple ConvNet for classifying MNIST images """
def __init__(self, seed):
""" initializes two Conv-Layers followed by two linear layers """
super().__... | michaelhodel/adversarial-training-with-lots | models.py | models.py | py | 3,745 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.manual_seed",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn.ModuleList",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"li... |
5546998859 | from brownie import interface
from utils.voting import create_vote
from utils.config import (lido_dao_voting_address,
lido_dao_token_manager_address,
lido_dao_node_operators_registry,
get_deployer_account)
from utils.evm_script import encode... | lidofinance/scripts | archive/scripts/set_node_operators_limit.py | set_node_operators_limit.py | py | 1,967 | python | en | code | 14 | github-code | 36 | [
{
"api_name": "brownie.interface.NodeOperatorsRegistry",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "utils.config.lido_dao_node_operators_registry",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "brownie.interface",
"line_number": 15,
"usage_t... |
30389517296 | import os
import sys
import pytest
from logpyle import LogManager, LogQuantity
# {{{ mpi test infrastructure
def run_test_with_mpi(num_ranks, f, *args, extra_env_vars=None):
pytest.importorskip("mpi4py")
if extra_env_vars is None:
extra_env_vars = {}
from base64 import b64encode
from pick... | illinois-ceesd/logpyle | test/test_distributed.py | test_distributed.py | py | 3,200 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "pytest.importorskip",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "base64.b64encode",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pickle.dumps",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "subprocess.check_ca... |
11998014126 | #!/usr/bin/python
import json
import math
cpus = 0
with open('/proc/cpuinfo') as f:
for line in f:
if 'processor' in line:
cpus += 1
meminfo = {}
with open('/proc/meminfo') as f:
for line in f:
meminfo[line.split(':')[0]] = line.split(':')[1].strip()
memory = int(meminfo['MemTotal... | prominence-eosc/prominence | htcondor/images/worker/write-resources.py | write-resources.py | py | 498 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "math.floor",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 21,
"usage_type": "call"
}
] |
9105847241 | # coding=utf-8
import webapp2
import sys
import config
import services.files
import services.event
import services.restore
from services.template import render
try:
from google.appengine.api import taskqueue
except ImportError:
pass
reload(sys) # Reload does the trick!
sys.setdefaultencoding('utf8')
class... | nicklasos/gae-data-fallback | controllers/restore.py | restore.py | py | 2,551 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "webapp2.RequestHandler",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "services.files.files.group_files",
"line_number": 25,
"usage_type": "call"
},
{
... |
16957389593 | from collections import deque
from variables import graph
from variables import vertex
def breadth_first_search(searchG, s, d):
R = dict()
R[s] = s
Q = deque()
Q.append(s)
while Q:
u = Q.popleft()
for v in searchG.neighbours(u):
if v not in R:
R[v] = u
... | MichaelQi11/Mid-Age-Plane-War | Functions.py | Functions.py | py | 1,451 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "variables.graph",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "variables.vertex",
"line_number": 37,
"usage_type": "call"
}
] |
16129025675 | from twisted.internet import reactor, defer
from twisted.web.client import getPage
count = 0
class Request:
def __init__(self, url, callback):
self.url = url
self.callback = callback
class HttpResponse:
def __init__(self, content, request):
self.content = content
self.request = ... | czasg/ScrapyLearning | czaSpider/dump/异步/scrapy模拟/test.py | test.py | py | 3,582 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "queue.Queue",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "types.GeneratorType",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "twisted.web.client.getPage",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "twist... |
32919021229 | import logging
import multiprocessing_logging
logging.basicConfig(filename="parsing.log", level=logging.INFO)
multiprocessing_logging.install_mp_handler()
import os
import sys
from seamr import parsers
from seamr.core import Store
import argparse
from tqdm import tqdm
from datetime import datetime
... | zewemli/seamr | seamr/cli/check_label_parsing.py | check_label_parsing.py | py | 2,364 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "multiprocessing_logging.install_mp_handler",
"line_number": 5,
"usage_type": "call"
},
{
"api... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.