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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
25249132378 | import torch
import torch.nn as nn
from functools import partial
import torch.nn.functional as F
from nets.mobilenetv2 import mobilenetv2
###### 构建deeplabv3_plus网络 ######
# 修改MObileNetV2网络
class MobileNetV2(nn.Module):
def __init__(self):
super(MobileNetV2, self).__init__()
model = mobilenetv2(... | zdfb/Deeplabv3_plus | nets/deeplabv3_plus.py | deeplabv3_plus.py | py | 6,388 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "nets.mobilenetv2.mobilenetv2",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "functools.... |
15695204571 | from django.urls import path
from .views import index, login_vista, logout_vista, dashboard, listaTareas, crearTarea, TareaDeleteView, TareaUpdateView, TareaDetailView, completarTarea
urlpatterns = [
path('', index ,name='index'),
path('login/', login_vista, name='login'),
path('logout/', logout_vista, nam... | rodrigobiotech/sprint_modulo_7 | Sprint_final_m7/tareas/app/urls.py | urls.py | py | 810 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "views.index",
"line_number": 5,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.login_vista",
... |
25266897185 | import random
from pathlib import Path
import requests
import pickle
import gzip
import torch
from torchvision import datasets, transforms
random.seed(1000)
DATA_PATH = Path("data")
PATH = DATA_PATH / "mnist"
PATH.mkdir(parents=True, exist_ok=True)
URL = "https://github.com/pytorch/tutorials/raw/master/_static/"
FIL... | M0hammadmahdi/Semi-Supervised-Learning-with-covariate-shift | Experiment 2/create_MNIST.py | create_MNIST.py | py | 3,058 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "random.seed",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "gzip.open",
"line_number": 2... |
33429287920 | import os
import sys
from collections import OrderedDict
from polyaxon.cli.errors import handle_cli_error
from polyaxon.config_reader.spec import ConfigSpec
from polyaxon.polyaxonfile.manager import PolyaxonFile
from polyaxon.polyaxonfile.params import parse_params
from polyaxon.utils import constants
from polyaxon.u... | gregmbi/polyaxon | core/polyaxon/polyaxonfile/check.py | check.py | py | 2,411 | python | en | code | null | github-code | 6 | [
{
"api_name": "polyaxon.polyaxonfile.manager.PolyaxonFile.check_default_path",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "polyaxon.polyaxonfile.manager.PolyaxonFile",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "polyaxon.utils.list_utils.to_list",
... |
19567997687 | """
Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands.
An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water.
"""
from typing ... | p1kit/CodeVoyagerX | src/200.py | 200.py | py | 2,699 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 34,
"usage_type": "name"
}
] |
1802793790 | from selenium.webdriver.support.wait import WebDriverWait
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.chrome.options import Options
from selenium import webdriver
from parsel ... | Zilan-Ouyang/socialMediaScraper | twitterScraperMedia.py | twitterScraperMedia.py | py | 5,195 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.support.wait.WebDriverWait",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.support.expected_conditions.presence_of_element_located",
"l... |
39294257220 | import os
import datetime
from flask import Flask, render_template, redirect, url_for
from flask_login import LoginManager, login_user, logout_user, login_required, user_logged_in, current_user
from review_db.data import _MainForm, _MapForms, _RatingsForm, _RegisterForm, _LoginForm
from MapCompiler import Compile_Map
f... | StephenFireball/WEBPROJECT | main.py | main.py | py | 5,902 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.urandom",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask_login.LoginManager",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "review_db.data._MainFo... |
41165744016 | # -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os
import warnings
import gc
from tqdm.notebook import tqdm
from scipy.stats import pearsonr,spearmanr
from random import sample,choice
import random
import argparse
random.seed(1234)
pd.set_option('... | abu-compbio/netcentric | src/evaluations_on_metrics.py | evaluations_on_metrics.py | py | 37,014 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "random.seed",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.log",
... |
19603158624 | import math
from functools import reduce
import numpy
def check_auth(v):
sum_sqr = reduce(lambda x, y: x + y**2, v, 0)
return reduce(lambda x, y: x + (y/math.sqrt(sum_sqr))**2, v, 0)
page_n = 4
auth = list()
hub = [[1] * page_n]
A = numpy.array([
[0, 1, 1, 1],
[0, 0, 1, 1],
[1, 0, 0, 1],
[... | YunusovSamat/HITS_algorithm | linear_algorithm.py | linear_algorithm.py | py | 560 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "functools.reduce",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_numb... |
72947595068 | import os
import sys
import time
import struct
import uuid
import re
import platform
import netifaces as ni
import json
__author__ = "Balaji Sriram"
__version__ = "0.0.1"
__copyright__ = "Copyright 2018"
__license__ = "GPL"
__maintainer__ = "Balaji Sriram"
__email__ = "balajisriram@gmail.com"
__status__ = "Production"... | balajisriram/bcore | bcore/__init__.py | __init__.py | py | 2,594 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.path.split",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"line_... |
30308885116 | from gi.repository import Gtk
from gi.repository import GLib
from wearnow.tex.const import WEARNOW_LOCALE as glocale
_ = glocale.translation.gettext
#-------------------------------------------------------------------------
#
# WEARNOW classes
#
#-----------------------------------------------------------------------... | bmcage/wearnow | wearnow/gui/editors/displaytabs/backrefmodel.py | backrefmodel.py | py | 2,639 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "wearnow.tex.const.WEARNOW_LOCALE.translation",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "wearnow.tex.const.WEARNOW_LOCALE",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "gi.repository.Gtk.ListStore",
"line_number": 17,
"usage_... |
8891102547 | import cv2 as cv
import numpy as np
import pytesseract as pyt
from tkinter.filedialog import askopenfilename
filename = askopenfilename()
image = cv.imread(filename)
image_work = np.copy(image)
gray = cv.cvtColor(image,cv.COLOR_BGR2GRAY)
gray = cv.bitwise_not(gray)
ret,thresh = cv.threshold(gray,0,255,... | RudraCS18/Object-Detection-using-openCV-python | ocr from rotated image.py | ocr from rotated image.py | py | 1,016 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tkinter.filedialog.askopenfilename",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.copy",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
... |
35327061406 | # -*- coding: utf-8 -*-
"""
Created on Sun Feb 12 20:49:40 2017
@author: rsotoc
"""
#Packages
import pandas as pd
import numpy as np
#from numpy.random import random
#from math import ceil
#from pandas.compat import StringIO
#from pandas.io.common import urlopen
#from IPython.display import display, display_pretty, J... | rsotoc/pattern-recognition | Data sets/Magic/script_magic.py | script_magic.py | py | 6,170 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "pandas.read_json",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
... |
26385676255 | from django.contrib import admin
from .models import Team
from django.utils.html import format_html
# Register your models here.
class TeamAdmin(admin.ModelAdmin):
def thumbnail(self, object): # created the pic in data table
return format_html('<img src="{}" width="40" style="border-radius: 50px;" />'.fo... | 24ARNAK/gala-cars-gitproject | pages/admin.py | admin.py | py | 829 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.utils.html.format_html",
"line_number": 8,
"usage_type": "call"
},
{
... |
75059747067 | #coding:gbk
import re
import pymel.core as pm
import maya.OpenMayaAnim as OpenMayaAnim
import utils
dt = {'L_':'R_', 'l_':'r_', 'left_':'right_', 'Left_':'Right_', 'R_':'L_', 'r_':'l_', 'Right_':'Left_', 'right_':'left_'}
def getMirrorCtrl(ctrl):
ctrlName = ctrl.name()
for key, value in dt.iteritems():
... | TianD/TianD_KX_TOOL | TFM_mirrorCmd.py | TFM_mirrorCmd.py | py | 4,341 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pymel.core.PyNode",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pymel.core",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pymel.core.PyNode",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pymel.core",
"line... |
9392505045 | import time
import torch
import os
import cv2
import random
import numpy as np
from skimage import io, img_as_float64
from utils import convert_from_color, get_random_pos, convert_to_color
import matplotlib.pyplot as plt
import albumentations as A
from albumentations.pytorch import ToTensorV2
EXTS = ['tif', 'tiff', 'j... | fabricioifc/icmbio | dataset.py | dataset.py | py | 5,090 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.utils",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.isfile",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "random.random",
"lin... |
70745675708 | import torch
import torch.nn as nn
class DynamicSparseReparameterizationLayer(nn.Module):
def __init__(self, n_input, n_output, sparsity) -> None:
super().__init__()
self.n_weights = n_input * n_output
self.sparsity = sparsity
weight = torch.Tensor(n_input, n_output)
... | emilhaugstvedt/sparsity | dynamic_sparse_reparameterization/DynamicSparseReparameterizationNet.py | DynamicSparseReparameterizationNet.py | py | 7,549 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn.Parameter",
"li... |
38740082175 | # Applies S or S^{-1} to a given image
import matplotlib.pyplot as pl
import numpy as np
from scipy.ndimage import imread # needs pillow!
import os
from uncoverml import filtering
test_file = os.path.expanduser('~/Data/badger.jpg')
def main():
# Make the inputs
mass_attenuation_air = 0.09 # assume some s... | GeoscienceAustralia/uncover-ml | gamma_sensor/conversion_tool.py | conversion_tool.py | py | 1,621 | python | en | code | 32 | github-code | 6 | [
{
"api_name": "os.path.expanduser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "scipy.ndimage.imread",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
... |
10914033538 | #!/usr/bin/python
#coding: utf-8
import telepot.api
import urllib3
# posto retry = 3 per evitare exception sul send.message casuale
telepot.api._pools = {
'default': urllib3.PoolManager(num_pools=3, maxsize=10, retries=3, timeout=30),
}
# DEFINIZIONE VARIABILI DI PERSONALIZZAZIONE
import sys
#PROPRIETARIO = sys... | feranto63/thermostat | test_read_sensor.py | test_read_sensor.py | py | 9,199 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "telepot.api.api",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "telepot.api",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "urllib3.PoolManager",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "configparser.Config... |
44119622306 | import os
import shutil
from scipy.io import loadmat, savemat
# noinspection PyPackageRequirements
import cv2
import numpy as np
def find_gt_from_files_copy(img_location, gt_folder, gt_new_folder):
"""
Function finds the equivalent ground truth images from a file in the gt folder
:param img_loc... | CipiOrhei/eecvf | Benchmarking/Util/dataset_processing.py | dataset_processing.py | py | 3,710 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "os.walk",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "shutil.copy2",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "scipy.io.loadmat",
"line_number": 46... |
16874799224 | import os
import json
import argparse
from typing import List
import numpy as np
def convert_format(fi_json, fo_jsonl):
data: List[dict] = json.load(open(fi_json))
with open(fo_jsonl, 'w') as fo:
for line in data:
out = {
'dialog': {
i: {'style': d[0],... | haruki-N/VL | src/data/convert_imagechat.py | convert_imagechat.py | py | 1,736 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 25,... |
21608206554 | import sqlite3
import uuid
from model.team import Team
from model.team_member import TeamMember
DB_PATH = '../db/hzs.db' # can do abs path too!
def _connect():
conn = sqlite3.connect(DB_PATH,timeout=10)
c = conn.cursor()
c.execute("PRAGMA foreign_keys = ON;")
conn.commit()
return conn
def get_... | hzsKrekeri/ProjektniZadatak | backend-master/app/controller/main_controller.py | main_controller.py | py | 6,747 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "model.team.Team",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "model.team_member.TeamMember",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "model.te... |
33050175354 | from odoo import models, fields, api, exceptions
from datetime import datetime
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT as dt
class chambre(models.Model):
_name = 'myhotel.chambre'
room_id = fields.Integer()
name = fields.Char(string="nom", required=True)
categorie_id = fields.Many2one(... | afafdriouech/myhotel_odoo_module | models/hotelmodels.py | hotelmodels.py | py | 4,803 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "odoo.models.Model",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Integer",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "odoo.fields",
... |
5454493041 | """
Problem:
396. Rotate Function
Difficulty:
Medium
URL:
https://leetcode.com/problems/rotate-function
Tags:
Array, Math, Dynamic Programming
Date:
2022-05-10T14:05:03.938886+08:00
"""
from typing import List
class Solution:
def maxRotateFunction(self, nums: List[int]) -> int:
nums_l... | s0u0b/leetcode | solutions/a00396_rotate_function.py | a00396_rotate_function.py | py | 779 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 17,
"usage_type": "name"
}
] |
74370498748 | from typing import List
from typing import Optional
from typing import TypeVar
from ..schema import validators
from .annotation import Annotation
from .annotation import bind_annotation
from .info import Contact
from .info import License
T = TypeVar("T")
class Api(Annotation):
version: str
title: str
de... | dkraczkowski/opyapi | opyapi/api/api.py | api.py | py | 2,061 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "typing.TypeVar",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "annotation.Annotation",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "info.License",
... |
36397409604 | """
Test the percent change function in modeling/math_percent_expressions.py.
percent_change(
df: DataFrame,
percent_change_col: str,
init_col: str,
final_col: str,
) -> DataFrame
"""
from pyspark.sql import types as T, DataFrame
from ..unit_test_utils import answer_check
from transformations_librar... | phil-trinh/pyspark_utilities_sample | unit_tests/modeling/test_percent_change.py | test_percent_change.py | py | 1,649 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyspark.sql.types.StructType",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.types",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "pyspark.sql.types.StructField",
"line_number": 32,
"usage_type": "call"
},
{
"api_... |
12898742552 | from django.shortcuts import render, redirect
from . models import Team
from cars.models import car
from django.contrib.auth.models import User
from django.core.mail import send_mail
from django.contrib import messages
from base64 import encodebytes
from base64 import b64encode
# Create your views here.
#homepage:... | waqasbcs/CarZone-project | pages/views.py | views.py | py | 2,714 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.Team.objects.all",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "models.Team.objects",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "models.Team",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "cars.mod... |
12932838258 | from .common import (
CACHES,
DEBUG,
MIDDLEWARE,
REST_FRAMEWORK,
WEBPACK_LOADER,
swh_web_config,
)
from .common import * # noqa
MIDDLEWARE += [
"swh.web.utils.middlewares.HtmlMinifyMiddleware",
]
if swh_web_config.get("throttling", {}).get("cache_uri"):
CACHES.update(
{
... | SoftwareHeritage/swh-web | swh/web/settings/production.py | production.py | py | 1,655 | python | en | code | 11 | github-code | 6 | [
{
"api_name": "common.MIDDLEWARE",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "common.swh_web_config.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "common.swh_web_config",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "com... |
42602486403 | #!/usr/bin/env python
import numpy as np
def argparse():
import argparse
parser = argparse.ArgumentParser(description = """
View alist with specific species.
""")
# Positional arguments
parser.add_argument('alist_file', type=str, help='ASE readable atoms list file name.')
parser.add_argumen... | hitergelei/tools | ase-gui-spec.py | ase-gui-spec.py | py | 1,503 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "a... |
13209650063 | import tkinter as tk
from PIL import ImageTk, Image
from tkinter import filedialog as fd
import grayscale
import mosaic
class MainApp:
def __init__(self, parent):
self.parent = parent
self.frame = tk.Frame(self.parent, pady = 25, padx = 25)
self.ratios=[0,0]
self.ph... | RogerLamTd/Cuhacking | ImageMosaic/UI.py | UI.py | py | 3,381 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tkinter.Frame",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tkinter.Frame",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tkinter.Frame",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tkinter.Label",
"line_n... |
28212226489 | import requests
import re
import json
import os
from hashlib import md5
def parsePage(url):
try:
res = requests.get(url)
except:
print('page get wrong')
pass
else:
print('ok')
if res.status_code == 200:
pattern = re.compile('BASE_DATA.galleryInfo = (.*?)gallery: JSON.parse\\((.*?)\\),'... | wengdanyu/pythonScrawl | spider.py | spider.py | py | 1,177 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.S",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "re.search",
"line_number": 19,
... |
43633617263 | # pylint: disable=invalid-name,no-self-use
from __future__ import with_statement
from __future__ import division
from __future__ import absolute_import
import argparse
import re
import shutil
import pytest
from allennlp.common.testing import AllenNlpTestCase
from allennlp.commands.fine_tune import FineTune, fine_t... | plasticityai/magnitude | pymagnitude/third_party/allennlp/tests/commands/fine_tune_test.py | fine_tune_test.py | py | 5,560 | python | en | code | 1,607 | github-code | 6 | [
{
"api_name": "allennlp.common.testing.AllenNlpTestCase",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "allennlp.commands.fine_tune.FineTune",
"line_number": 29,
"usage_type": ... |
32584450273 | import json
import tablib
# json.text文件的格式: [{"a":1},{"a":2},{"a":3},{"a":4},{"a":5}]
# 获取json数据
with open('jsontest.txt', 'r', encoding='utf-8') as f:
rows = json.load(f)
# print(rows)
# 将json中的key作为header, 也可以自定义header(列名)
header = tuple([i for i in rows[0].keys()])
# print('header',header)
... | songg009/mgcode | json2xlsx.py | json2xlsx.py | py | 722 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tablib.Dataset",
"line_number": 21,
"usage_type": "call"
}
] |
10621584926 | import requests
import sys
import sentry_sdk
SERVER_URL = "http://localhost:5000"
def main(value):
sentry_sdk.init(
dsn="https://e0f002c997e841828595584ace084210@o447951.ingest.sentry.io/4505160406990848",
debug=True,
release="0.0.0",
)
sentry_sdk.capture_message("main.py start... | getsentry/test-tracing-wo-performance-python | main.py | main.py | py | 683 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sentry_sdk.init",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sentry_sdk.capture_message",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sys.argv",
... |
4904842653 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import os
import sys
import numpy as np
import tensorflow as tf
from tqdm import tqdm
import glob
import string
import re
import num2words
from distill.data_util.prep_sentwiki import SentWik... | samiraabnar/SolutionDistillation | distill/data_util/prep_lm1b.py | prep_lm1b.py | py | 5,172 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.version_info",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "distill.data_util.prep_sentwiki.SentWiki",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "tensorflow.gfile.GFile",
"line_number": 74,
"usage_type": "call"
},
{
... |
32119021201 | # pylint: disable=C0103,R0801
import django.db.models.deletion
import ovinc_client.core.models
import ovinc_client.core.utils
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_depende... | OVINC-CN/iWikiAPI | apps/cos/migrations/0001_initial.py | 0001_initial.py | py | 1,817 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.swappable_dependency",
"line_number": 15,
"usage_type": "ca... |
75242931706 |
import scipy.io
'''
digits=scipy.io.loadmat('DMU/digits.mat')
y1=digits['Ys'].T
y1=list(y1[0])
for i in range(1,11):
print(y1.count(i))
print()
print()
mnist=scipy.io.loadmat('DMU/mnist.mat')
y1=mnist['Ys'].T
y1=list(y1[0])
for i in range(1,11):
print(y1.count(i))
print()
print()
usps=scip... | Cavin-Lee/1SMT | num.py | num.py | py | 562 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scipy.io.io.loadmat",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "scipy.io.io",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "scipy.io",
"line_number": 27,
"usage_type": "name"
}
] |
37562190424 | import os
import setuptools
_ROOT = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(_ROOT, "README.rst")) as f:
long_description = f.read()
with open("bin/ants", "r") as f:
for line in f:
if "__version__ =" in line:
version = line.split(" ")[2].rstrip().replace('"', "")... | ANTS-Framework/ants | setup.py | setup.py | py | 1,969 | python | en | code | 42 | github-code | 6 | [
{
"api_name": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
6276056591 | #!/usr/bin/env python
import keras_segmentation
import os
import glob
import argparse
'''
out = model.predict_segmentation(
inp=os.path.join(data_folder,'images_prepped_test/frogn_10008.png'),
out_fname="out.png"
)
print('out shape',out.shape)
print(out)
#Run from command line:
python -m keras_segmentation p... | vigneshrajap/vision-based-navigation-agri-fields | cmd_line_scripts/lane_detection_segnet_predict.py | lane_detection_segnet_predict.py | py | 1,713 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
70915319869 | import numpy
from numpy import *
import math
import os
import cv2
import scipy.misc
from PIL import Image
from sklearn.model_selection import train_test_split
from sklearn.svm import SVR, SVC
from sklearn.multiclass import OneVsRestClassifier
from sklearn.model_selection import GridSearchCV
from sklearn.metr... | xia15/Faceshibie | facerecognition.py | facerecognition.py | py | 14,311 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.zeros",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_... |
20985893876 | import requests
from bs4 import BeautifulSoup
import time
import json
url = ""
page = requests.get(url)
soup = BeautifulSoup(page.content, "html.parser")
content = soup.find(id="web")
table = soup.find("table", class_="npy_modTableInt")
arrCuentas = []
data = {}
data['cuentas'] = []
for numero in table.find_al... | maximmacari/WebScraping_Python | scrap1.py | scrap1.py | py | 2,857 | python | es | code | 1 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_num... |
1128195519 | from django.http import HttpResponse,JsonResponse
from django.shortcuts import render
from django.shortcuts import redirect
from Gaming.models import Game
from Gaming.models import NewC
from django.shortcuts import get_object_or_404
from django.urls import reverse
from Gaming.models import Big
from django.vie... | Slayer9999/Web-DEV | mysite/mysite/views.py | views.py | py | 6,771 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "Gaming.models.NewC.objects.all",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "Gaming.models.NewC.objects",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "Gaming.models.NewC",
"line_number": 21,
"usage_type": "name"
},
{
... |
71226260029 | import os
from copy import copy
from PIL import Image
import tensorflow as tf
import tensorflow.keras as keras
class DecimerImageClassifier:
"""Class that wraps up the functionalities of the image classifier"""
def __init__(self):
# Establish GPU growth, load default GPU
os.environ["CUDA_VISI... | Iagea/DECIMER-Image-Classifier | decimer_image_classifier/decimer_image_classifier.py | decimer_image_classifier.py | py | 4,728 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.config.experimental.list_physical_devices",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tensorflow.config",
"line_number": 14,
"usage_type": "attribute"
}... |
13041204843 | import falcon
import json
import logging
logger = logging.getLogger(__name__)
class SeriesLatest:
def __init__(self, store):
self.__store = store
def on_post(self, req, resp):
params = json.load(req.bounded_stream)
logger.info('request: {}'.format(params))
try:
r... | Qinode/final-visual-api | src/resources/data/series_latest.py | series_latest.py | py | 868 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "falcon.HTTP_200",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "json.dumps",
"lin... |
9836556844 | import numpy as np
import matplotlib.pyplot as pl
fig=pl.figure()
x=np.arange(-20,20,0.001)
n=100
a=1
y=0
for i in range (1,n,2):
y+=((2*a)/(i*np.pi))*np.sin(i*x)
pl.plot(x,y)
pl.axhline(y=0)
pl.axvline(x=0)
pl.show() | Rohan-Chakravarthy/Basic-Mathematics-Programs | differential equn first order.py | differential equn first order.py | py | 238 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "numpy.arange",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"... |
28725634508 | #!/usr/bin/python3
# This script is used to download a random video from pexels and pixabay and to download a random quote from forismatic
import random
import requests
import json
headers = {'Authorization': '563492ad6f91700001000001491ff09e5b194ec5bbf3c33fc9c4edb1'}
# Pexels api call to get random popular video
de... | lesageduvillage/YoutubeChannelAutomation | src/PythonScripts/GetData.py | GetData.py | py | 2,138 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_numb... |
20909551752 | # Some of the intrsutions are taken from (https://1883magazine.com/how-to-play-blackjack-online-step-by-step-guide/)
from termcolor import cprint, colored
import random
import os
os.system('color')
class Terminal():
"""
Class that controls the terminal service
"""
def __init__(self) -> None:
... | Abstact/CSE210-projects | Group_Work/BlackJack/terminal_service.py | terminal_service.py | py | 4,839 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "os.system",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number... |
2688115877 | from fastapi import FastAPI, Response, status, HTTPException
from fastapi.params import Body
from pydantic import BaseModel
from typing import Optional
from random import randrange
app = FastAPI()
class Post(BaseModel):
title: str
content: str
rating: Optional[int] = None
published: bool = True
my_... | rubenVillalvazo/api | main.py | main.py | py | 2,447 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "fastapi.Response",
... |
10849331039 | #!/usr/bin/env python3
import csv
import tqdm
import copy
import argparse
import os
from pyjetty.mputils import perror, pinfo, pwarning, treewriter
import ROOT
ROOT.gROOT.SetBatch(True)
def make_dict(scols, row):
d = {}
for i, s in enumerate(scols):
d[s] = float(row[i])
return d
def main():
parser = argparse.A... | matplo/pshower | test/csv2root.py | csv2root.py | py | 1,169 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "ROOT.gROOT.SetBatch",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "ROOT.gROOT",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.b... |
10383148703 | from typing import Dict
import torch
from executorch.backends.qualcomm.builders.utils import is_parameter
from executorch.exir.dialects._ops import ops as exir_ops
from executorch.exir.pass_base import ExportPass, PassResult
class InsertIOQDQ(ExportPass):
"""
For delegated QNN subgraph, no more QDQ operator... | pytorch/executorch | backends/qualcomm/passes/insert_io_qdq.py | insert_io_qdq.py | py | 4,140 | python | en | code | 479 | github-code | 6 | [
{
"api_name": "executorch.exir.pass_base.ExportPass",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "executorch.exir.dialects._ops.ops.edge",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "executorch.exir.dialects._ops.ops",
"line_number": 20,
"... |
7276688241 | import pandas as pd
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
#from openpyxl import load_workbook
# Load the Excel s... | camarcano/tbox | tbox.py | tbox.py | py | 3,739 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "selenium... |
16306278489 | import os, time
import numpy as np
from screeninfo import get_monitors
import pybullet as p
from .util import Util
from .bodies.body import Body
from .bodies.panda import Panda
envir = None
directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'assets')
class Env:
def __init__(self, time_step=0.0... | dkguo/Pushing-Imitation | mengine/mengine/env.py | env.py | py | 12,562 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.realpath",
"lin... |
70768926908 | #!.env/Scripts/python.exe
__doc__ = '''Скрипт для разметки корпуса частями речи.'''
from pathlib import Path
from collections import Counter
import os
import nltk
from tqdm import tqdm
def file_searcher(path):
"""Находим названия всех файлов"""
list_files = []
for address, _, files in os.walk(path):
... | fateevda/creating_dataset | 09_baseline.py | 09_baseline.py | py | 2,577 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.walk",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 26,
... |
23642029467 | import psycopg2
from Core.Issuer import Issuer
from Core.Stock import Stock
class DataProvider:
def __init__(self):
self.host = '127.0.0.1'
self.port = 5432
self.dbname = 'exchangedb'
self.user = 'postgres'
self.password = 'postgres'
self.connection = None
s... | sergey-rush/AlgoStock | Data/DataProvider.py | DataProvider.py | py | 3,404 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "psycopg2.connect",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "psycopg2.DatabaseError",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "Core.Issuer.Issuer",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "Core.... |
4997609881 | # -*- coding: utf-8 -*-
import copy
from datetime import datetime
from mamba import runnable
from mamba.example import PendingExample
class ExampleGroup(runnable.Runnable):
def __init__(self, description, parent=None, tags=None):
super(ExampleGroup, self).__init__(parent=parent, tags=tags)
sel... | nestorsalceda/mamba | mamba/example_group.py | example_group.py | py | 3,833 | python | en | code | 509 | github-code | 6 | [
{
"api_name": "mamba.runnable.Runnable",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "mamba.runnable",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "copy.copy",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "datetime.dateti... |
39920900834 | """
task module holds the logic regarding TaskList and Task classes.
These two classes are used by the services to managed the requested actions
"""
import hashlib
import logging
import os
import pprint
import sys
import time
import traceback
import gevent
import requests
from gevent.lock import Semaphore
from js9 ... | BolaNasr/0-robot | zerorobot/task/task.py | task.py | py | 5,702 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "js9.j.logger.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "js9.j.logger",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "js9.j",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"lin... |
29280538469 | import os
import tornado
from notebook.base.handlers import IPythonHandler
import rospkg
class Pkgs(IPythonHandler):
rospack = rospkg.RosPack()
@tornado.web.authenticated
def get(self, *args, **kwargs):
cls = self.__class__
if not args:
self.write("Error - no argument suppl... | ihuicatl/jupyter-rospkg | jupyter_rospkg/pkgs.py | pkgs.py | py | 996 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "notebook.base.handlers.IPythonHandler",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "rospkg.RosPack",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "rospkg.ResourceNotFound",
"line_number": 31,
"usage_type": "attribute"
},
{
"... |
31207213424 | #!/usr/local/bin/python3.6
# -- coding: utf-8 -- –
import os,base64,re,psycopg2,threading,logging,csv,telegram,json,time,sys
import tweepy
from random import randint
from time import sleep,strftime,gmtime
from functools import wraps
from pprint import pprint
from functions import dot,Map
from telegram import InputMed... | dreamitvn/TeleChatbot | bot.py | bot.py | py | 81,347 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
10262066380 | import requests
from requests.exceptions import ReadTimeout,HTTPError,RequestException
import re
import json
import time
from bs4 import BeautifulSoup
from SqlHelper import MySQLHelper
import schedule
import time
import datetime
import threading
import hashlib
import logging
import logging.handlers
CNBLOG_URL="https:/... | fyj78910/cnBlogData | crawData.py | crawData.py | py | 7,056 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "SqlHelper.MySQLHelper",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "requests.post",... |
2705641177 | import abc
from typing import ClassVar, Type
from basic_notion.block import (
NotionBlock, ParagraphBlock,
Heading1Block, Heading2Block, Heading3Block,
CalloutBlock, BulletedListItemBlock, NumberedListItemBlock,
ToDoBlock, ToggleBlock, CodeBlock,
ChildPageBlock, ChildDatabaseBlock,
)
def test_nes... | altvod/basic-notion | tests/test_block.py | test_block.py | py | 5,772 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "basic_notion.block.ParagraphBlock.make_as_children_data",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "basic_notion.block.ParagraphBlock",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "basic_notion.block.ParagraphBlock",
"line_number": ... |
14560011192 |
import cv2
# Loading the Cascades
"""
We have two cascade xml files in the folder. There is one cascade file for the face and one cascade for the eyes.
First step is to load the cascades one for the face and one for the eye.
We have cascade Classifier class in open cv . We will use that class
We will us... | CosmicHunter/Real-Time-Happy-Face-Detection-Using-Haar-Like-Features- | face_recog.py | face_recog.py | py | 7,437 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "cv2.rectang... |
26112447575 | import numpy.random
from silx.gui import qt
from silx.gui.widgets.WaitingOverlay import WaitingOverlay
from silx.gui.plot import Plot2D
class MyMainWindow(qt.QMainWindow):
WAITING_TIME = 2000 # ms
def __init__(self, parent=None):
super().__init__(parent)
# central plot
self._plot =... | silx-kit/silx | examples/waiterOverlay.py | waiterOverlay.py | py | 1,622 | python | en | code | 106 | github-code | 6 | [
{
"api_name": "silx.gui.qt.QMainWindow",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "silx.gui.qt",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "silx.gui.plot.Plot2D",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "silx.gui.... |
21795707683 | # (c) 2015-2018 Acellera Ltd http://www.acellera.com
# All Rights Reserved
# Distributed under HTMD Software License Agreement
# No redistribution in whole or part
#
import os
from htmd.queues.simqueue import SimQueue
from protocolinterface import ProtocolInterface, val
import logging
import random
import string
logg... | abdulsalam-bande/KDeep | training_with_htmd/htmd/queues/acecloudqueue.py | acecloudqueue.py | py | 6,908 | python | en | code | 19 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.CRITICAL",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "logging.get... |
15208346848 | from django.shortcuts import render
from account.models import Startup,Mentor,Waitlist
from django.http import HttpResponseRedirect, HttpResponse
from .serializers import StartupSerializer,MentorSerializer,AccountSerializer
from django.views.decorators.csrf import csrf_exempt
from rest_framework.response import Respons... | Kashishjain02/cocreatebackend | account/api/views.py | views.py | py | 8,728 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.views.decorators.csrf.csrf_exempt",
"line_number": 82,
"usage_type": "name"
},
{
"api_name": "rest_framework.decorators.api_view",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "rest_framework.decorators.permission_classes",
"line_number": 85,... |
6093948969 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 27 09:37:21 2020
@author: alex_chiang
"""
##### Features Engineering #####
'''
Using past N days to predict future N days TWII
'''
import numpy as np
import pandas as pd
df = pd.read_pickle("/Users/alex_chiang/Documents/GitHub/An-example-for-Ma... | AlexChiang0208/An-example-for-Machine-Learning-to-Predict-TWII | TWII_prediction.py | TWII_prediction.py | py | 7,897 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_pickle",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.read_pickle",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "sklearn.prepr... |
73349892668 | import logging
import torch
import torch.nn as nn
import torch.nn.functional as F
from tagger.encoder import RecurrentEncoder
from tagger.utils import PAD_TOKEN, ROOT_TOKEN, END_TOKEN
from tagger.nn import ChainCRF, ChainCRFallenNLP
from AllenNLPCRF import ConditionalRandomField
use_cuda = True if torch.cuda.is_avail... | LauraRuis/BiLSTM-CNN-CRF-POStagger | tagger/tagger/backupworkingcrf/model.py | model.py | py | 8,013 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn.Mo... |
37219479093 | # att fixa
#
import os
import geocoder
import pandas as pd
import numpy as np
import requests
import json
from datetime import datetime
import sys
# print(f"{sys.path[0]}/date.txt")
# os.path.join(sys.path[0], "filename") funkar bra för lokal folder
def same_dir(name):
return os.path.join(sys.path[0], name)
def ... | GGisMee/Python | Projekten/Kombo/weather app/info/get_df.py | get_df.py | py | 1,987 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "sys.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"... |
16242057426 | import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
import scipy # pip install scipy
def GIF_compress(img):
img_array = np.asarray(img)
# print(type(img_array))
compressed = np.floor_divide(img_array, 32) * 32
# print(compressed)
return compressed
# image = random_repeat_img... | Nibor20000/ITS-project | lossly_compressions.py | lossly_compressions.py | py | 1,810 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.asarray",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.floor_divide",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "scipy.fftpack.dct",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "scipy.fftpack",
... |
72255302268 | from __future__ import annotations
import datetime
import time
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, Literal, Optional, Sequence, TypeAlias, Union
import asyncpg
import discord
from discord.ext import commands
from ..vars import BlankException
from . import timer as timer_module
fr... | LeoCx1000/fish | src/utils/helpers/classes.py | classes.py | py | 5,487 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "asyncpg.Record",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "typing.Sequence",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "typing.Any",... |
31334060262 | from string import ascii_lowercase as letters
import pyocr
import sympy as sp
from PIL import Image
import cv2
import numpy as np
import img_from_phone
import imgformat
import text_utils
import sympy_utils
#Identifier for solve call with image from phone camera
FROM_PHONE = object()
NOPRINT = la... | pgrynfelder/mathsolver | read_solve.py | read_solve.py | py | 4,148 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyocr.tesseract",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "img_from_phone.load",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
... |
71987294587 | import base64
import json
import logging
import time
from datetime import datetime
from config import APP_CODE as app_code, SECRET_KEY as app_secret
from blueking.component.shortcuts import get_client_by_request, get_client_by_user
from blueapps.utils.logger import logger
class CC_API:
def __init__(self, bk_to... | Alfred-Alan/bk_api | cc_api.py | cc_api.py | py | 8,277 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "blueking.component.shortcuts.get_client_by_request",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "config.APP_CODE",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "config.SECRET_KEY",
"line_number": 31,
"usage_type": "name"
},
{
... |
35351497247 | from fastapi import Depends, HTTPException
from fastapi.requests import Request
from fastapi.security import SecurityScopes
from fastapi.security.utils import get_authorization_scheme_param
from jose import JWTError, jwt
from src.core.database import get_repository
from src.core.exceptions import AuthHTTPException
from... | zelnkup/fast-api-ticket-selling-platform | src/core/dependencies.py | dependencies.py | py | 1,686 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.requests.Request",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "fastapi.security.SecurityScopes",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "src.repositories.users.UserRepository",
"line_number": 16,
"usage_type": "name"
... |
27099723306 | import xlwt
from colour import ColourGradient
from ..core.status import Status
from power_deviation_matrix import PowerDeviationMatrixSheet
class ShareMatrixReport(object):
def __init__(self):
self.normal_style = xlwt.easyxf('font: bold 0')
self.bold_style = xlwt.easyxf('font: bold 1')
se... | PCWG/PCWG | pcwg/reporting/share_matrix_report.py | share_matrix_report.py | py | 2,450 | python | en | code | 23 | github-code | 6 | [
{
"api_name": "xlwt.easyxf",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "xlwt.easyxf",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "xlwt.easyxf",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "xlwt.easyxf",
"line_number": ... |
16551732854 | '''
Created on May 7, 2015
@author: wohlhart
'''
import cPickle
import matplotlib.pyplot as plt
import sys
import numpy
def loadTrainResults(fileName):
with open(fileName, 'rb') as f:
descrNet = cPickle.load(f)
trainProgressData = cPickle.load(f)
# wvals = cPickle.load(f)
cfg = cP... | paroj/ObjRecPoseEst | src/main_plot_train_cost_evolution.py | main_plot_train_cost_evolution.py | py | 932 | python | en | code | 71 | github-code | 6 | [
{
"api_name": "cPickle.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cPickle.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cPickle.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cPickle.load",
"line_numbe... |
277830031 | from collections import deque
TOWER_HEIGHT = 5
NUM_RODS = 3
rods = []
for i in range(NUM_RODS):
rod = deque()
rod.append(TOWER_HEIGHT + 1)
rods.append(rod)
for i in range(TOWER_HEIGHT, 0, -1):
rods[0].append(i)
def transfer(rod_1, rod_2):
l_1 = len(rod_1)
l_2 = len(rod_2)
if l_1 > 1 an... | scott858/interview | python/hanoi.py | hanoi.py | py | 1,231 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 8,
"usage_type": "call"
}
] |
20845110036 | import numpy as np
import cv2
from core.config import cfg
import utils.blob as blob_utils
import roi_data.rpn
from AugSeg import get_new_data
from AugSeg import AugSegConfig
from datasetsAug.roidb import combined_roidb_for_training
from PIL import Image, ImageEnhance, ImageOps, ImageFile
def get_minibatch_blob_names... | AnonymousCodeShare/InstaBoost | detectron/lib/roi_data/minibatch.py | minibatch.py | py | 5,756 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "core.config.cfg.RPN",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "core.config.cfg",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "roi_data.rpn.rpn.get_rpn_blob_names",
"line_number": 20,
"usage_type": "call"
},
{
"api_... |
18835090932 | import functools
import time
from datetime import datetime, timedelta
import pandas as pd
import plotly.graph_objects as go
from dash_apps.lib.events_28d import events
from dash_apps.lib.filters import select_project
from style.theme import (BLUE, PURPLE, TRANSPARENT, WHITE, colors_map,
graph_... | slyg/dash-plotly | src/dash_apps/figures/nightly_vs_daily.py | nightly_vs_daily.py | py | 2,068 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dash_apps.lib.filters.select_project",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "dash_apps.lib.events_28d.events",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "dash_apps.lib.events_28d.events",
"line_number": 17,
"usage_type": "... |
72782971387 | from http.server import BaseHTTPRequestHandler,HTTPServer, SimpleHTTPRequestHandler
import re
import mysql.connector
import json
mydb = mysql.connector.connect(
host="localhost",
user="root",
password="admin",
database='books'
)
def create_book(row):
if 'isbn' in row.keys():
return Book(str(row['t... | BogdanLionte/wade | api.py | api.py | py | 3,907 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "mysql.connector.connector.connect",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "mysql.connector",
"line_number": 6,
"usage_type": "name"
},
{
"api... |
8043416296 | from selenium import webdriver
from bs4 import BeautifulSoup
import csv
import pandas as pd
#class to represent a team
class Team:
def __init__(self):
self.name = ""
self.league = ""
self.ATT = 0
self.MID = 0
self.DEF = 0
self.OVR = 0
self.icon = ""
def ... | sachinboban/datavis-fifa20-dashboard | scripts/scrape-web.py | scrape-web.py | py | 3,155 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "seleni... |
40762125660 | import os
import shutil
import pandas as pd
import numpy as np
import nmslib
instance_map = {}
def NMSLIBIndex(index_name):
if index_name not in instance_map:
instance_map[index_name] = _nmslibIndex(index_name)
return instance_map[index_name]
def get_index_path(index_name):
"""
Get the .h5 ... | NhatMinh2208/Ecommerce-ImageSearcher | imsearch/nmslib.py | nmslib.py | py | 7,604 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.getcwd",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_numb... |
28463908380 | #!/usr/bin/ python
# -*- coding: utf-8 -*-
import urllib.request
import urllib.parse
import json
from tkinter import *
import hashlib
import time
LOG_LINE_NUM = 0
class MY_GUI():
def __init__(self,init_window_name):
self.init_window_name = init_window_name
#设置窗口
def set_init_window(self):
... | hy546880109/python_study | gui/gui_pc.py | gui_pc.py | py | 4,635 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "urllib.request.parse.urlencode",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "urllib.request.parse",
"line_number": 63,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 63,
"usage_type": "name"
},
{
"api_name"... |
21924784578 | import argparse
import os
import ruamel.yaml as yaml
import numpy as np
import random
import time
import datetime
from pathlib import Path
import PIL
import math
import torch
import torch.backends.cudnn as cudnn
import torch.distributed as dist
import torchvision.datasets as datasets
from models.model_classification ... | zhangxinsong-nlp/XFM | Imagenet.py | Imagenet.py | py | 25,130 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "torchvision.datasets.CelebA",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "torchvision.datasets",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "torchvision.datasets.CIFAR10",
"line_number": 39,
"usage_type": "attribute"
},
... |
45269145266 | import numpy as np
from PIL import Image
import sys
import random
import math
import requests
#Gray Scale values in text: http://paulbourke.net/dataformats/asciiart/
grayscale_complex = "$@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\|()1{}[]?-_+~<>i!lI;:,\"^`'. "
grayscale_simple = '@%#*+=-:. '
def imageDownload(url):
... | McCune1224/kusagari-bot | asciify.py | asciify.py | py | 2,568 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number"... |
25166826445 | # -------------------------------------------------------------------------------
# Description: 把一些常用的optimizer函数放在同一个文件夹下,非必要
# Description:
# Description:
# Reference:
# Author: Sophia
# Date: 2021/7/7
# -------------------------------------------------------------------------------
import torch
'''
python模块... | namespace123/Deep-learning-ReID | core/optimizers.py | optimizers.py | py | 1,105 | python | zh | code | 4 | github-code | 6 | [
{
"api_name": "torch.optim.Adam",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.optim",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "torch.optim.SGD",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.optim",
"... |
6174869547 | from pymongo import MongoClient
import requests
from bs4 import BeautifulSoup
import datetime
client = MongoClient('localhost',27017)
db = client.fortess
collection = db.blog
r = requests.get('http://www.santostang.com/',timeout=20)
soup = BeautifulSoup(r.text,'lxml')
boxes = soup.find_all('h1',class_='post-title')
f... | BooleanlN/crawlers | chapter1/9.py | 9.py | py | 522 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.n... |
36084030093 | import os
import subprocess
import configparser
def processFolder(folder_path:str):
global png2atf_path
convert_config = configparser.ConfigParser()
convert_config.read('asset_settings.ini')
png2atf_path = os.path.join(".", "png2atf", "png2atf.exe")
convertFolderToAtf(folder_path, convert_confi... | gogoflash/street-cats-concept | bingo_assets/convert_to_atf.py | convert_to_atf.py | py | 1,657 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"... |
31487323124 | """
Copyright © 2021 Wallbreaker5th
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute... | Wallbreaker5th/fourier-linkage | ft.py | ft.py | py | 1,677 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
17555382725 | from datetime import datetime
import requests
import socket
import os
patient = str(socket.gethostname())
serverIP = os.environ["SERVER_IP"]
upload_audio_adress = 'http://'+serverIP+':5000/uploadAudio'
upload_log_adress = 'http://'+serverIP+':5000/uploadLog'
def send_audio():
if not os.path.exists('audios'):
... | DeustoTech/AutoFlow | RPI/sendAudio.py | sendAudio.py | py | 1,884 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "socket.gethostname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_n... |
17728554047 | import os
from collections import OrderedDict
from typing import List, Union
import logging
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.utils.tensorboard import SummaryWriter
import matplotlib.pyplot as plt
from tqdm import trange
os.env... | Junxiao-Zhao/Physical-Informed_Neural_Network | pinn_1d.py | pinn_1d.py | py | 5,505 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
... |
35003228446 | #!/bin/python
import os
import sys
import datetime
import paramiko
import pymysql
import hashlib
from celery import Celery
SECRET_FIELDS = ['cert_no', 'id_card']
app = Celery('jiebei')
app.config_from_object('celeryconfig')
@app.task
def fetch(is_all=False):
client = paramiko.Transport(('10.11.73.11', 22))
... | taojy123/chips | jiebei_task.py | jiebei_task.py | py | 7,439 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "celery.Celery",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "paramiko.Transport",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "paramiko.SFTPClient.from_transport",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "p... |
71359785147 | # from __init__ import *
import torch
import numpy as np
from transformers import BertTokenizer, FNetModel
from transformers import BertModel
from transformers import FNetTokenizer
from progress.bar import Bar
class CustomBar(Bar):
fill='█'
suffix=r'%(percent).1f%% - %(remaining_hours)dh %(remaining_mins)dm %(remai... | bennit6/EC523 | dataprocess/encode.py | encode.py | py | 2,632 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "progress.bar.Bar",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "transformers.FNetTokenizer.from_pretrained",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "transformers.FNetTokenizer",
"line_number": 27,
"usage_type": "name"
},
{
... |
21987230356 | import pytest
@pytest.fixture(name="fixer")
def fixer_fixture(two_to_three_test_case):
return two_to_three_test_case("standarderror")
def test(fixer):
b = """x = StandardError()"""
a = """x = Exception()"""
fixer.check(b, a)
b = """x = StandardError(a, b, c)"""
a = """x = Exception(a,... | ryanwersal/crosswind | fixer_suites/two_to_three/tests/test_standarderror.py | test_standarderror.py | py | 459 | python | en | code | 11 | github-code | 6 | [
{
"api_name": "pytest.fixture",
"line_number": 4,
"usage_type": "call"
}
] |
16409517930 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib import colors, ticker, cm
from matplotlib.mlab import bivariate_normal
#from numpy.linalg import inv
# Function to get the GP solution
def gp_solve(x_train, y_train, x_pred, kernel, sig_noise=0, **kwargs):
k_xx = kernel(x_train, x_train... | masterfulEJ/pythonProjects | SM/gp_utils.py | gp_utils.py | py | 1,629 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "numpy.linalg.inv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "numpy.identity",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"li... |
19425042967 | #!/usr/bin/python
from argparse import ArgumentParser
import socket
import numpy as np
def stop_robot():
'''
Stop the robot by sending it 's'.
'''
return sock.send("s\n".encode())
def locate_robot():
sock.send('q\n'.encode())
return [float(str) for str in sock.makefile().readline().split()]
... | timtro/vme-nmpc | tools/go-home.py | go-home.py | py | 1,912 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK... |
3177289636 | #!venv/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import serial
import hashlib
import argparse
from distutils.util import strtobool
CONFIG = {}
def load_config():
parser = argparse.ArgumentParser(description="Flipper zero CLI")
show_banner = os.environ.get("FLIPPER_ZERO_SHOW_BANNER", "False"... | nledez/flipperzero-cli | flipperzero_cli/__init__.py | __init__.py | py | 4,466 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get... |
10481591899 | #!/usr/bin/env python
import dbus
from dbus.mainloop.glib import DBusGMainLoop
# Initialize DBUS
DBusGMainLoop(set_as_default=True)
_bus = dbus.SessionBus()
_proxy = _bus.get_object(
"org.freedesktop.Tracker1",
"/org/freedesktop/Tracker1/Resources"
)
_interface = dbus.Interface(_proxy, "org.freedesktop.Tracker1.Res... | jreinhardt/Phorg | tracker.py | tracker.py | py | 613 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "dbus.mainloop.glib.DBusGMainLoop",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "dbus.SessionBus",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "dbus.Interface",
"line_number": 13,
"usage_type": "call"
}
] |
10086019258 | import requests
from config import headers,url,url2,data
requests.packages.urllib3.disable_warnings()
def login():
sLogin=requests.Session()
r=sLogin.post(url, data=data, headers=headers, allow_redirects=False, verify=False)
#print(r.headers['location'])
sBB = requests.Session()
r2=sBB.get(r.header... | EZ4NO1/USTCBBhelper | login.py | login.py | py | 715 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "requests.packages.urllib3.disable_warnings",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "requests.packages",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "requests.Session",
"line_number": 5,
"usage_type": "call"
},
{
"a... |
13002880478 | from typing import Dict, Optional, Any
from flask import request, abort
from flask_restful import Resource
from marshmallow import Schema, fields, validate, ValidationError
from sudoku_api.models.Puzzle import get_puzzles, get_puzzle_by_id
class Puzzle(Resource):
def get(self, puzzle_id: Optional[int] = None) ->... | kapppa-joe/python-sudoku-api | sudoku_api/controllers/puzzles_controller.py | puzzles_controller.py | py | 1,904 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask_restful.Resource",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "sudoku_api.models.Puzzle.get_puzzle_by_id",
"line_number": 12,
"usage_type": "call"
},
{
"a... |
29585538855 | import streamlit as st
import pandas as pd
import numpy as np
st.title('Uber - viajes en New York City')
DATE_COLUMN = 'date/time'
DATA_URL = ('https://s3-us-west-2.amazonaws.com/'
'streamlit-demo-data/uber-raw-data-sep14.csv.gz')
@st.cache_data
def load_data(nrows):
data = pd.read_csv(... | Willy71/uber_viajes | uber_pickups.py | uber_pickups.py | py | 1,345 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "streamlit.title",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "streamlit.cache_dat... |
17014536657 | """Creating histograms with GPUs.
This module can be used for testing `gpu_hist.py`. You may create histograms
and plot them or you may create a full test. A more detailed description
can be found here: https://github.com/PolygonAndPixel/histogramming/wiki
Examples:
Create a 2D histogram and compare it with all a... | mhieronymus/histogramming | main.py | main.py | py | 40,308 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "matplotlib.use",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.float64",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"li... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.