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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
35600607709 | import json
import logging
import re
from django.contrib.auth import authenticate, login
from django.contrib.sites.models import Site
from django.core.signing import BadSignature, SignatureExpired, loads
from django.http import HttpResponse
from django.middleware.csrf import CSRF_TOKEN_LENGTH
from django.shortcuts imp... | AngellusMortis/django_microsoft_auth | microsoft_auth/views.py | views.py | py | 6,184 | python | en | code | 140 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.views.View",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "django.utils.translation.gettext",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "... |
12238934240 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 27 15:16:06 2019
@author: ydurand
Fonction to check the depth of the isotherm of 12 °C
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from fonctionRadius import *
from stockData import *
from stockDiagKEs import *
#%... | YannickDurand/AirSeaInteraction | Isotherm.py | Isotherm.py | py | 3,999 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.divide",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "numpy.newaxis",
"line_number": 59,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_n... |
29788034249 | import os
import glob
import torch
import torch.utils.data as data
from datasets.datahelpers import default_loader
class DigitsDataset(data.Dataset):
""" Digits dataset."""
def __init__(self, mode, data_root, transform=None, loader=default_loader):
# self.img_names = glob.glob('{}/*.jpg'.format(label... | RongTouchTouch/Crnn | datasets/dataset.py | dataset.py | py | 2,442 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "datasets.datahelpers.default_loader",
"line_number": 11,
"usage_type": "name"
},
{
"... |
70732180385 | import pygsheets
c = pygsheets.authorize()
s = c.open('Example solar calcs')
ws = s.worksheet('title', 'real_data')
# ws.update_col(2 , ["helloworld"], row_offset=2)
# ws.insert_rows(2, number=2, values=["hellohellohello", "hhhh"], inherit=False)
ws.append_table(["helloworld1"], start='A1', end=None, dimension='ROW... | gityizhou/googlesheet | googlesheet.py | googlesheet.py | py | 431 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pygsheets.authorize",
"line_number": 3,
"usage_type": "call"
}
] |
70300223904 | import paramiko
def run(host='13.127.47.153', port=2200, user='grader',
command="mpstat | grep 'all'", bufsize=-1, key_filename='/home/ubuntu/grader_key',
timeout=120, pkey=None):
"""
Excecutes a command using paramiko and returns the result.
:param host: Host to connect
... | juluahamed/TelegramBot | bot/ssh_paramiko.py | ssh_paramiko.py | py | 1,216 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "paramiko.SSHClient",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "paramiko.AutoAddPolicy",
"line_number": 16,
"usage_type": "call"
}
] |
11778922805 | import numpy as np
import matplotlib.pyplot as plt
def _get_spline_basis(node_points, j, k=3):
"""
replaces template place holder with values
@param node_points 1d-array that is also called Knot sequence by lecture notes, is assumed to be sorted
@param int j index of basis function
@par... | Stronkness/LTH | FMNN25 - Advanced Course in Numerical Algorithms with Python and SciPy/Project 1/splines/__init__.py | __init__.py | py | 8,034 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.zeros",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.searchsorted",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.searchsorted",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"... |
37973510562 | import pandas
from bokeh.io import curdoc
from bokeh.plotting import figure, show, output_file, ColumnDataSource
from bokeh.models import Range1d
from bokeh.models.tools import HoverTool
from bokeh.models.widgets import CheckboxGroup
from motion_detector import df #runs motion_detector.py and grabs the df out... | 201912119/SMDV | MDOcvBokeh/MotionDetector-openCV-bokeh/analyze_motion_detector.py | analyze_motion_detector.py | py | 1,333 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "bokeh.io.curdoc",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "motion_detector.df",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "motion_detector.df",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "bokeh.plotting.... |
70897326942 | #Use do to store functions that may depend on models
from Factz.models import Number, Variable, Message, Subscription, customMessage, activeSubscription, sentMessage
from django.core.exceptions import ValidationError
from django.core.mail import EmailMultiAlternatives
from django.template.loader import render_to_string... | bcorwin/MsgSender | Factz/do.py | do.py | py | 8,876 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "Factz.models.Variable.objects.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "Factz.models.Variable.objects",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "Factz.models.Variable",
"line_number": 16,
"usage_type": "name"
},... |
2143003717 | file_name = "some_file.txt"
log = "results.txt"
# создадим файл с рандомным IP адресами:
with open(file_name, 'w') as f:
f.writelines(["8.8.8.8\n", "192.192.192.192\n", "10.29.136.59\n", "127.0.0.2"])
# из этого же файла прочитаем IP адреса
with open(file_name, 'r') as ff:
data = ff.read().split('\n')
pri... | sanishchuk/pythonProject | Anishchuk task2_v2.py | Anishchuk task2_v2.py | py | 1,170 | python | ru | code | 0 | github-code | 7 | [
{
"api_name": "subprocess.Popen",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "subprocess.STDOUT",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "datetime... |
7031225988 | ""
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
from functools import partial
__all__ = ['resnet152']
from .auxillary_classifier import auxillary_classifier2
class View(nn.Module):
def __init__(self, *args):
super(View, self).__init__()
self.shape = args
de... | eugenium/DGL | imagenet_dgl/models/resnet.py | resnet.py | py | 6,764 | python | en | code | 24 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"li... |
72863513182 | import importlib
from pathlib import Path
_PROJECTS = {
"point_rend": "PointRend",
"deeplab": "DeepLab",
"panoptic_deeplab": "Panoptic-DeepLab",
}
_PROJECT_ROOT = Path(__file__).parent.parent.parent / "projects"
if _PROJECT_ROOT.is_dir():
# This is true only for in-place installation (pip install -e, ... | Ascend/ModelZoo-PyTorch | PyTorch/contrib/cv/detection/centernet2/detectron2/projects/__init__.py | __init__.py | py | 1,076 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "pathlib.Path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "importlib.abc",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "importlib.util.spec_from_file_location",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": ... |
70642725344 | from typing import List
def read_data(filename: str):
with open(f"input/{filename}") as f:
lines = f.readlines()
map = []
for line in lines:
seats = []
for c in line.strip():
seats.append(c)
map.append(seats)
return map
def get_... | Elizaveta239/AdventOfCode2020 | day11.py | day11.py | py | 3,705 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 66,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 89,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": ... |
37886174338 | import os
import imageio
from dataloader_util import *
def get_training_poses(basedir, translation=0.0, sc_factor=1.0, trainskip=1):
all_poses, valid = load_poses(os.path.join(basedir, 'trainval_poses.txt'))
train_frames = []
for idx in range(0, len(all_poses), trainskip):
if valid[idx]:
... | dazinovic/neural-rgbd-surface-reconstruction | load_scannet.py | load_scannet.py | py | 3,327 | python | en | code | 521 | github-code | 7 | [
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "imageio.imread",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numbe... |
31871458021 | import logging
import re
import subprocess
from timeit import default_timer as timer
import os
BENCHMARK_CONFIG = """
mock_benchmark:
description: Illustrative mock example benchmark.
provider: aws
region: us-east-1
endpoint: DYNAMIC
"""
def prepare(spec):
logging.info('prepare(): building and deploying... | ServiBench/ReplicationPackage | servi-bench/benchmarks_old/mock_benchmark/mock_benchmark.py | mock_benchmark.py | py | 1,498 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "logging.info",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "timeit.default_timer... |
16890560246 | # -*- coding: utf-8 -*-
# @Time :2021/4/26 10:41 上午
from django.http import HttpResponse
from django.shortcuts import render
from TestModel.models import Test
import simplejson as json
from random import randint
# 数据库操作
def insert(request):
test1 = Test(name='runoob')
test1.save()
return HttpResponse(... | amuqiao/django_init | django_init/django_init/test_db/views.py | views.py | py | 2,337 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "TestModel.models.Test",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "TestModel.models.Test",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "... |
38455475180 | from flask import Flask, request, jsonify, abort
from dotenv import load_dotenv
import os
import time
if os.getenv("IS_PROD") == "true":
print("Loading in prod")
else:
print("Loading in dev")
load_dotenv(verbose=True)
from chalicelib import log_config
from chalicelib.db import ModelsDatabase
from chalicel... | data-skeptic/model-hosting-in-lambda-example | app.py | app.py | py | 3,281 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.getenv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number"... |
39022069873 | import torch
import numpy as np
import torch.multiprocessing as mp
from collections import deque
from ..utils import *
class Replay:
def __init__(self, memory_size, batch_size):
self.memory_size = memory_size
self.batch_size = batch_size
self.data = []
self.pos = 0
def feed(sel... | xfgao/VRKitchen | Script/deep_rl/component/replay.py | replay.py | py | 3,731 | python | en | code | 18 | github-code | 7 | [
{
"api_name": "numpy.random.randint",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "numpy.asarray",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "torch.multiproce... |
17702706216 | """ This module defines methods to configure an instance of Chrome """
from typing import List, Optional
from blaze.config import Config
def get_chrome_flags(user_data_dir: str, extra_flags: Optional[List[str]] = None) -> List[str]:
"""
Returns the default flags to run chrome with. Allows extra flags to be in... | nkansal96/alohamora | blaze/chrome/config.py | config.py | py | 1,393 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "typing.Optional",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "blaze.config.Config",
"line... |
1381225371 | import requests
from bing_maps_api_key import bing_maps_api_key
def get_lat_lon(city, state):
"""
input: city name, state postal code
output: latitude, longitude
Get the latitude and longitude for a certain city in the united states to get its weather data
"""
#Get the api key
bing_maps_ke... | jimmyshultz/weather_forecast_application | forecast_console_app/console_weather_forecast.py | console_weather_forecast.py | py | 5,264 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "bing_maps_api_key.bing_maps_api_key",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "request... |
26121604596 | from PyQt5.QtGui import QFont
from PyQt5.QtWidgets import QWidget, QGridLayout, QVBoxLayout, QLabel, QGroupBox, QHBoxLayout, QPushButton, QLineEdit
from board import board
class sideBar(QWidget):
def __init__(self):
super().__init__()
self.font = QFont("Arial", 13)
self.sideBarVertical = Q... | ellitrym1/GoGame | sideBar.py | sideBar.py | py | 4,486 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtGui.QFont",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QVBoxLayout",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "P... |
14325430050 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import time
import sys
import numpy as np
_logger = logging.getLogger(__name__)
class Experiment(object):
"""
Base class for all experiment implementations.
"""
def __init__(se... | cowhi/lab_rl | experiments.py | experiments.py | py | 2,290 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.random.RandomState",
... |
36834311800 | from pathlib import Path
import eyed3
def real_main():
print("Starting")
path = Path(".").resolve()
album_name = path.name
artist_name = Path(path, "..").resolve().name
for file in path.iterdir():
if file.is_file() and file.name.endswith(".mp3"):
first_part = file.name.split("... | retrodaredevil/mp3-helper | mp3_helper/__init__.py | __init__.py | py | 965 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "eyed3.load",
"line_number": 20,
"usage_type": "call"
}
] |
17256327710 | from django.contrib import admin
from modelodjango.turmas.models import Turma
class MatriculaInline(admin.TabularInline): # tbm tem o 'StackedInline'
model = Turma.alunos.through
extra = 1 # por default vao aparecer 3 campos(para adicionar 3 matriculas por vez, mas vc pode alterar)
readonly_fields = ('d... | phswdjango/estudo-django | modelodjango/turmas/admin.py | admin.py | py | 864 | python | pt | code | 0 | github-code | 7 | [
{
"api_name": "django.contrib.admin.TabularInline",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "modelodjango.turmas.models.Turma.alunos",
"line_number": 6,
"usage_type": "att... |
18033990477 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# @Time: 2020/4/6 19:23
# @Author: qyh
import numpy as np
import pandas as pd
import re
import jieba
import warnings
warnings.filterwarnings("ignore")
# 将岗位名称标准化:目前岗位名称太多太杂,需要统一
job_list = ['数据分析', "数据统计", "数据专员", '数据挖掘', '算法', '大数据',
'开发工程师', ... | QCloudHao/51jobs | data_preprocess.py | data_preprocess.py | py | 6,875 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"li... |
10383025226 | import numpy as np
import pandas as pd
import scipy.spatial.distance as sci
import matplotlib.pyplot as plt
from scipy.stats import norm
from matplotlib.ticker import FormatStrFormatter
# Figure 6A
# Determination of Hamming distance
# Python script was used in JupyterLab
# Save figures as . . .
save = 'fig_hamming_... | HackelLab-UMN/PriSM-Inhibition-and-Seq-Analysis | Deep Sequence Analysis/Hamming.py | Hamming.py | py | 8,174 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_pickle",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.read_pickle",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.read_pickle",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.empty"... |
36725108557 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/3/21 17:37
# @Author : whq
# @File : redisPy.py
import redis
import json
#redis-py使用connection pool来管理对一个redis server的所有连接,避免每次建立、释放连接的开销
pool = redis.ConnectionPool(host='127.0.0.1', port=6379)
r = redis.Redis(connection_pool=pool)
# r = redisPy.Redis(host... | whqbd/plane | redisPy.py | redisPy.py | py | 1,142 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "redis.ConnectionPool",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "redis.Redis",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 36,
"usage_type": "call"
}
] |
20445341538 | """Contains useful functions for plotting neural network architecture."""
import tensorflow as tf
import matplotlib.pyplot as plt
import numpy as np
import context
import plot_utils
from tensorno.layers import MaxOut, ChannelOut
def group_nodes(x: float, nodes: int, groups: int, ax):
"""Plots rectangles around e... | hkve/FYS-STK4155 | Project3/src/analysis/network_plot_tools.py | network_plot_tools.py | py | 4,547 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.Rectangle",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "plot_utils.colors",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "... |
2555076745 | from typing import List, cast
from traffic.core.flightplan import (
Airway,
CoordinatePoint,
Direct,
FlightPlan,
Point,
SpeedLevel,
_ElementaryBlock,
)
from traffic.data.basic.airways import Airways
import pandas as pd
class ExtraData(Airways):
name = "extra_for_test"
available =... | xoolive/traffic | tests/test_flightplan.py | test_flightplan.py | py | 7,737 | python | en | code | 325 | github-code | 7 | [
{
"api_name": "traffic.data.basic.airways.Airways",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame.from_records",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 22,
"usage_type": "attribute"
},
{... |
2560152841 | from abc import ABC, abstractmethod
import requests
import json
import os
SJ_TOKEN: str = os.getenv('SJ_TOKEN')
class ApiJobSites(ABC):
"""
Абстрактный класс для работы с API сайтов.
"""
@abstractmethod
def get_vacancy(self):
"""
Получение вакансий с НН и SJ по API.
:para... | Soulgrimm/Parsing_job_search_sites | src/vacancies_from_api.py | vacancies_from_api.py | py | 1,477 | python | ru | code | 0 | github-code | 7 | [
{
"api_name": "os.getenv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "abc.ABC",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": ... |
16976164204 | from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import DateTime
from sqlalchemy.orm import relationship
import datetime
db = SQLAlchemy()
class Event_comments(db.Model):
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.Integer, db.ForeignKey('user.id'),
null... | RodriMaldonadoMedina/RidersCrew | src/api/models.py | models.py | py | 10,964 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.DateTime",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 17,
"usage_type": "call"
},
{
"api_n... |
71907637024 | """
Module dertining the general variables
"""
import sys
import torch
import subprocess
# defining which device to use, darwin=Mac
if sys.platform=="darwin":
try:
device = torch.device("mps") # GPU acceleration for Mac
except:
device="cpu"
else:
device = 'cuda' if torch.cu... | kunschg/NN_Attack_IASD | settings.py | settings.py | py | 685 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.platform",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
... |
13392917340 | from telegram import Update, error
from telegram.ext import (
CallbackContext,
ConversationHandler,
JobQueue,
DispatcherHandlerStop,
)
from constants import Messages, ConversationsStates
from db import getUsers
from utils import chunk
def _sendMessages(context: CallbackContext):
job = context.job
... | abdullahahmeda/copouns-bot-py | send_message_conversation.py | send_message_conversation.py | py | 1,400 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "telegram.ext.CallbackContext",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "telegram.Update",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "telegram.ext.CallbackContext",
"line_number": 22,
"usage_type": "name"
},
{
"api_nam... |
25215179510 | import logging
from telegram import Update
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
from datetime import datetime
from fpdf import FPDF
import os
# Enable logging
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO)
... | Behzod0317/attendance | exit2.py | exit2.py | py | 4,554 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "fpdf.FPDF",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "telegram.Update",
... |
20087200318 | from libs.connection import MySQLConnection
import datetime
class Estadisticas:
def __init__(self):
self.conexion = MySQLConnection()
def getBestSellingProducts(self):
query = """
SELECT producto.nombre, SUM(DetallesCompra.Cantidad) AS TotalVendido FROM DetallesCompra
... | JesusHT/SCDOTR | SCDOTR-vPro/libs/estadisticas.py | estadisticas.py | py | 6,889 | python | es | code | 0 | github-code | 7 | [
{
"api_name": "libs.connection.MySQLConnection",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 87,
"usage_type": "attribute"
},
{
"... |
35104152123 | import json
import re
from tqdm import tqdm
import random
def process_one_line(line):
question = line.split("col : ")[0].strip()
if not question:
return None, None
header = line.split("col : ")[1].split("row 1 : ")[0].strip()
header = [i.strip() for i in header.split("|")]
num_col = l... | Yale-LILY/ReasTAP | synthetic_tableqa_generation/prepare_tapex_pretrain_data.py | prepare_tapex_pretrain_data.py | py | 1,936 | python | en | code | 10 | github-code | 7 | [
{
"api_name": "re.split",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 70,
"... |
758272418 | import os
import time
from multiprocessing import Semaphore, Process
def f1():
print("%d 想要执行事件" % os.getpid())
sem.acquire() # 拿到信号量的执行 信号量-1 只有3个拿到(因为信号量只有3) 其他7个没有拿到的阻塞 等着其中一个执行完+1 剩下7个进程抢
# 直到其他7个都抢到 并执行完 程序结束
print("%d 拿到信号量开始执行" % os.getpid())
time.sleep(1)
# 1个进程执行完成 信号量+1 变为1 这样剩余的7个... | ljrdemail/AID1810 | Thread/Day04/12_信号量Semaphore.py | 12_信号量Semaphore.py | py | 855 | python | zh | code | 0 | github-code | 7 | [
{
"api_name": "os.getpid",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.getpid",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Semaphore",
"line_n... |
41373008769 |
import pygame
import rgbcolors
import os
import json
import datetime as dt
SCORE = 0
NAME = 'Player1'
DIFF = 5
class Scene:
def __init__(self, screen):
self._screen = screen
self._background = pygame.Surface(self._screen.get_size())
self._background.fill(rgbcolors.purple)
self._... | mzendejas8/snake-game | scene.py | scene.py | py | 11,563 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pygame.Surface",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "rgbcolors.purple",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pygame.QUIT",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "pygame.KEYDOWN"... |
43145032871 | ########################################################################################################
# The RWKV Language Model - https://github.com/BlinkDL/RWKV-LM
########################################################################################################
import json, math, random, os, sys
import nump... | if001/RWKV-LM-LoRA-ja | RWKV-v4neo/src/dataset_ja.py | dataset_ja.py | py | 1,527 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "utils.TOKENIZER",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.long",
"line_number": 39,
"usage_type": "attribute"
}
] |
44131620058 | import copy
from typing import List
import torch
from torchsim.core.graph.unit import Unit
from torchsim.core.memory.tensor_creator import TensorCreator
from torchsim.core.graph.worker_node_base import WorkerNodeBase
from torchsim.core.graph.slot_container import Inputs, MemoryBlocks
from torchsim.core.nodes.disentan... | GoodAI/torchsim | torchsim/core/nodes/disentagled_world_renderer.py | disentagled_world_renderer.py | py | 2,642 | python | en | code | 9 | github-code | 7 | [
{
"api_name": "torchsim.core.graph.unit.Unit",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torchsim.core.nodes.disentangled_world_node.DisentangledWorldNodeParams",
"line_number": 16,
... |
22239326655 | from flask import Response, request
from database.models import Movie, User
from flask_restplus import Resource,fields
from flask_jwt_extended import jwt_required, get_jwt_identity
from mongoengine.errors import FieldDoesNotExist, NotUniqueError, \
DoesNotExist,ValidationError
import res... | Icaro-AS/filmes | resources/movie.py | movie.py | py | 2,397 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask_restplus.Resource",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "database.models.Movie.objects",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "database.models.Movie",
"line_number": 14,
"usage_type": "name"
},
{
"api_n... |
12904211582 | from django.shortcuts import render, get_object_or_404, redirect
from django.http import HttpResponse
from django.http import Http404
from .models import Articles
from random import randint
# Create your views here.
# def articles_home(request):
# obj_query_set = Articles.objects.all()
# string1 = '<h1> I ... | rhsajib/django-practice | projects/aiquist/aiquest/articles/views.py | views.py | py | 5,948 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "models.Articles.objects.all",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "models.Articles.objects",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "models.Articles",
"line_number": 19,
"usage_type": "name"
},
{
"api_name... |
37056653596 | import argparse
import glob
import json
import msgpack
import numpy as np
import torch
from transformers import OpenAIGPTTokenizer, OpenAIGPTLMHeadModel
from transformers import GPT2Tokenizer, GPT2LMHeadModel
from transformers import XLNetTokenizer, XLNetLMHeadModel
from transformers import TransfoXLTokenizer, Transfo... | daniter-cu/discoher | src/lrd_collect.py | lrd_collect.py | py | 6,451 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "transformers.OpenAIGPTTokenizer.from_pretrained",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "transformers.OpenAIGPTTokenizer",
"line_number": 25,
"usage_type"... |
36669134948 | import random
import curses
from curses import initscr,curs_set,newwin,endwin,KEY_RIGHT,KEY_LEFT,KEY_UP,KEY_DOWN,beep,start_color,noecho;
from random import randrange;
scr=initscr()
noecho()
start_color()
#N=30 # heigt of field
#M=60 # width of field
N=scr.getmaxyx()[0] # heigt of field
M=scr.getmaxyx()[1] # width of... | mayank93/Robot-Bomb-Defuser | bombDefuser.py | bombDefuser.py | py | 16,322 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "curses.initscr",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "curses.noecho",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "curses.start_color",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "curses.KEY_RIGHT",
"... |
1327331214 | # -*- coding: utf-8 -*-
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from my_expected_conditions import wait_for_new_element_with_class_loaded
from pages.abstract_page import AbstractPage
class TenthRe... | animagd/selenium_exercise | pages/tenth_request_page.py | tenth_request_page.py | py | 1,386 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pages.abstract_page.AbstractPage",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.support.wait.WebDriverWait",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "my_expected_conditions.wait_for_new_element_with_class_loaded",
... |
19995662161 | '''
0408 Multiple DTW -> Get their index order
'''
__author__ = 'Victoria'
# 2018-03-05
import numpy as np
import pandas as pd
import os
import re
from datetime import timedelta
from math import exp, sqrt
from itertools import combinations, permutations
import json
import matplotlib.pyplot as plt
from src.map_matching... | vikiQiu/Smart-City | src/map_matching/multipath_mm.py | multipath_mm.py | py | 38,351 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "src.map_matching.CTrack.CTrack",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "src.pre_processing.road_network.Graph",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "src.pre_processing.funs.interpolate",
"line_number": 54,
"usage_type... |
72401733662 | import datetime, os, pandas as pd, numpy as np, requests, time, urllib3
from bs4 import BeautifulSoup
class Metadata(object):
'''
'''
identifiers = None
metadata_filepath = None
def request_bulk_metadata(self, date_of_last_request):
'''
Requests bulk metadata from OAI2.
... | brienna/arxiv | metadata.py | metadata.py | py | 7,764 | python | en | code | 11 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "urllib3.exceptions",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
... |
1157882824 | import unittest
from database import create_connection
from CreditCards import CreditCard
from datetime import datetime
from payment_plan import PaymentPlan
class TestDatabase(unittest.TestCase):
def setUp(self):
self.connection = create_connection()
self.cursor = self.connection.curso... | Dlassoc/codigolimpio_trabajo_aula_DANIEL_LASSO | codigo limpio proyecto Daniel Lasso/R1tests.py | R1tests.py | py | 6,261 | python | es | code | 0 | github-code | 7 | [
{
"api_name": "unittest.TestCase",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "database.create_connection",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "CreditCards.CreditCard",
"line_number": 24,
"usage_type": "call"
},
{
"api_name"... |
71050627744 | import pandas as pd
from transformers import GPT2LMHeadModel, GPT2Tokenizer, TextDataset, DataCollatorForLanguageModeling
from transformers import TrainingArguments, Trainer
import re
artist_list = [
'JAY-Z',
'Eminem',
'Kendrick Lamar',
'Lil Wayne',
'Nicki Minaj',
'Snoop Dogg',
'Nas',
'... | ssk0011/rap_lyrics_generator | test_rap_code.py | test_rap_code.py | py | 2,779 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "re.sub",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "transformers.GPT2LMHeadModel.from_pretrained",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "transformers.GPT2LMHeadModel",
"line_number": 37,
"usage_type": "name"
},
{
"... |
71719418142 | import math
import os
import sys
from typing import Iterable
import torch
import util.misc as utils
from datasets.coco_eval import CocoEvaluator
from datasets.voc_eval import VocEvaluator
from datasets.panoptic_eval import PanopticEvaluator
from datasets.data_prefetcher import data_prefetcher
from datasets.selfdet imp... | amirbar/DETReg | engine.py | engine.py | py | 10,813 | python | en | code | 327 | github-code | 7 | [
{
"api_name": "torch.nn",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "typing.Iterable",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "torch.optim",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"li... |
31542199479 |
from toolbox import GUIDataFrame
import pathlib, logging
import pandas as pd, numpy as np, scipy
import toolbox
logger=logging.getLogger(__name__)
class ParsedHumanSTNMUADataBase(GUIDataFrame):
def __init__(self, parsed_human_stn_db, computation_m):
super().__init__("inputs.human.stn.signals.mua", {"inpu... | JulienBrn/GUIAnalysis | src/analysisGUI/Inputs/Human/STN/parsed_mua_db.py | parsed_mua_db.py | py | 2,416 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "toolbox.GUIDataFrame",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "toolbox.DataPath",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "toolbox.DataPat... |
920829175 | import tensorflow as tf
import dataflow as D
import time
import numpy as np
import datetime
from multiprocessing import cpu_count
from augmentation.augment.utils import compose_augmentations
def benchmark(dataflow, num_epochs=2, sleep=0.):
start_time = time.perf_counter()
for epoch_num in range(num_epochs):
... | HazyResearch/model-patching | augmentation/dataflows/utils.py | utils.py | py | 10,488 | python | en | code | 42 | github-code | 7 | [
{
"api_name": "time.perf_counter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tensorflow.print",
"line_n... |
14983449775 | # ホロライブの画像を集める
import os
import argparse
from icrawler.builtin import BingImageCrawler
def parse_keyword() -> str:
"""入力された引数を取得する
Returns:
str: vtuber名
"""
parser: argparse.ArgumentParser = argparse.ArgumentParser()
parser.add_argument("-name", required=True)
args: argparse.Namespace = parser.parse... | Iroha71/ai-scripts | image-crawler.py | image-crawler.py | py | 967 | python | ja | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "argparse.Namespace",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "o... |
22134039999 | import torch
import torch.nn as nn
from torch import optim
import torch.nn.functional as F
from torch_geometric.nn import Set2Set
from torch_geometric.utils import dropout_adj
from embedder import embedder
from layers import GCN, GAT, GIN
from tqdm import tqdm
class GraphCL_Trainer(embedder):
def __init__(... | Namkyeong/PolySRL_AI4Science | models/GraphCL.py | GraphCL.py | py | 4,495 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "embedder.embedder",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "embedder.embedder.__init__",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "embedder.embedder",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "torch.... |
29001871077 | import tkinter as tk
from tkinter import filedialog,scrolledtext
from tkinter import messagebox
from tkinter import *
import threading
import os
from tonghuashunSpider import Spider
from selenium import webdriver
import json
import time
class LoginApp(tk.Tk):
config_driver = 'driver.txt'
default_config_driver... | SuperKenVery/tieba_spider | tonghuashun/gupiaodongtai/app.py | app.py | py | 7,015 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "tkinter.Tk",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_... |
71803642464 |
import os
import numpy as np
import codecs
import json
from glob import glob
import cv2
import shutil
from sklearn.model_selection import train_test_split
# 1.存放的json标签路径
labelme_path = "/Volumes/My_Passport/LBT/DATASET/anti-vibration_hammer/timdatasets/json/"
# 原始labelme标注数据路径
saved_path = "VOC2012/"
# 保存路径
isUseTe... | lbt1219/labelme | json2xml.py | json2xml.py | py | 9,517 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.exists",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_nu... |
28741589277 | # Training logistic regresison with Scikit-Learn
from ohe import X_train, X_val
from validation_framework import y_train, y_val, df_val, df_train
import numpy as np
import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.feature_extraction import DictVectorizer
# set the model
model =... | xettrisomeman/mlbootcamp | mlzoomcamp3/logscikit.py | logscikit.py | py | 2,149 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "sklearn.linear_model.LogisticRegression",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "ohe.X_train",
"line_number": 18,
"usage_type": "argument"
},
{
"api_name": "validation_framework.y_train",
"line_number": 18,
"usage_type": "argument"
},
... |
24798471607 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Time slice drought stats
Created on Thu Jan 14 14:04:09 2021
@author: lizz
"""
import numpy as np
import matplotlib.pyplot as plt
import gSPEI as gSPEI
## Labels: (P)arametric or (NP)nonparametric;
## Standardization (1) lumped or (2) split by starting month
fpath_N... | ehultee/glacial-SPEI | archived/drought_stats-timeslice.py | drought_stats-timeslice.py | py | 6,857 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "numpy.arange",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_n... |
41367636834 | #credit to initial skeleton:webcam-capture-v1.01
# Edited By/ Author: Maryam Azmandian
import cv2
def preProcess():
key = cv2. waitKey(1)
webcam = cv2.VideoCapture(0)
while True:
try:
check, frame = webcam.read()
print(check) #prints true as long as the webcam is running
... | sweetbeet/jasmine | webcamPreprocess.py | webcamPreprocess.py | py | 3,704 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cv2.waitKey",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number"... |
34223725883 | import nltk,sys
import numpy as np,pandas as pd
import matplotlib.pyplot as plt
import nltk.data
import csv
from nltk.stem.porter import *
pd.options.mode.chained_assignment = None
data = pd.read_csv("mbti_1.csv")
shortdata=data.iloc[:,-1]
shortdata=shortdata.head()
shortdata1=data.iloc[0:5,0]
print(shortdata)
#re... | rakshathavasudev/Personality_Analysis_Twitter | Tweet_Preprocess/tweet_preprocess.py | tweet_preprocess.py | py | 2,070 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.options",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "nltk.co... |
9122179188 | # -*- coding: utf-8 -*-
import json
import os.path
from typing import Tuple
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.cache import cache
from django.http import HttpRequest, HttpResponseRedirect, JsonResponse
from django.shortcuts import redirect
from catmaid.co... | catmaid/CATMAID | django/applications/catmaid/control/roi.py | roi.py | py | 9,773 | python | en | code | 178 | github-code | 7 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.path.join",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name":... |
34901587056 |
import numpy as np
import matplotlib.pyplot as plt
from sklearn.mixture import GaussianMixture as GMM
from functools import partial
class Logs():
cur_log_file = None
log_time_tag = None
log_dir = './logs'
def set_log_file(tag, src_level= -2):
Logs.cur_log_file = Logs.get_log_fn(... | pauljmey/hw3_clustering_dr | main.py | main.py | py | 54,421 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "{'datetime': 'datetime', 'os': 'os'}.log_time_tag",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 25,
"usage_type": "attrib... |
32398472120 | import display
from colorama import Back
import numpy as np
# Y = 1
# R = -1
class Connect4:
plyTurn = -1
win = 0
plyStart = 0
board = np.zeros((7, 6), dtype="int8")
visual_board = None
def __init__(self, show_board=True):
self.board = np.zeros((7, 6), dtype="int8")
# self.board = np.matrix([
# [ ... | Bubulleux/Connect4IA | motor.py | motor.py | py | 2,449 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.zeros",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.random.rand",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_nu... |
28552490342 | import json
from unittest import skip
from playwright.sync_api import sync_playwright
import re
# Create a dictionary of course requirements for each program major
def create_majors(major_dict):
final_majors = {}
final_majors["programs"] = {}
# Iterate through program majors
for major in major_dict["e... | mahimnap/uni_site_scraper | src/scraper/major_scraper.py | major_scraper.py | py | 9,010 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "re.findall",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 62,
"usage_t... |
22827293403 | import random
import numpy as np
import pandas as pd
import tensorflow as tf
from tqdm import tqdm
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MultiLabelBinarizer
# Split dataset into train/test/validation
def split(x, test_size=0.2, val_size=0.0, seed=0):
... | raul-singh/Rise-of-Transformers-Project | Code/Notebooks/py_files/preprocessing.py | preprocessing.py | py | 9,331 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tensorflow.io.read_file",
"line_number": 30,
"usage_typ... |
17395876693 | import pandas as pd
from nltk.tokenize import word_tokenize
from sklearn.linear_model import LogisticRegression
from sklearn import metrics
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn import model_selection
if __name__ == '__main__':
df = pd.read_csv('imdb.csv')
df['kfold'] = -1
... | VishuBa/Text-Classification-regression | tfv_logres.py | tfv_logres.py | py | 1,211 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.StratifiedKFold",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection",
"line_number": 18,
"usage_type": "name"
},
{
"a... |
5694820536 | '''
' This file contains functions that will extract the HOG/HOF/MBH features from input frames
'
' The code is adapted from the Matlab code used in the papers:
' - J.R.R. Uijlings, I.C. Duta, E. Sangineto, and N. Sebe
' "Video Classification with Densely Extracted HOG/HOF/MBH Features: An Evaluation of the Accuracy/... | TaliahPersephone/MInf-Part2 | pipeline/hist_preprocess.py | hist_preprocess.py | py | 6,491 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.load",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.einsum",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "numpy.lib.stride_tricks.as_strid... |
41492388429 | from django.http import HttpResponseRedirect
from django.shortcuts import render, render_to_response,redirect, get_object_or_404
# Create your views here.
from django.template.context_processors import csrf
#from Gestion_Inst.forms import AlumnoForm,NivelEnsenanzaForm
from Gestion_Inst.models import *
from crispy_form... | fvalverdi/GestionInstitucional | Gestion_Inst/AlumnosViews.py | AlumnosViews.py | py | 2,424 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "Gestion_Inst.models.Alumno",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "c... |
29959731563 | from rich.panel import Panel
from gitlabtree.models import Info
from gitlabtree.gitlab_helper import GitLabHelper
from gitlabtree.runner import create_runner_info, get_tree_with_runner
from .fixture_helper import *
def test_create_runner_info(
moked_data_runners: Dict[str, Any], gitlab_helper: GitLabHelper
) ->... | INSRapperswil/gitlabtree | tests/test_runner.py | test_runner.py | py | 3,154 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "gitlabtree.gitlab_helper.GitLabHelper",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "gitlabtree.runner.create_runner_info",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "rich.panel.Panel",
"line_number": 22,
"usage_type": "argument"... |
8451161375 | """Asynchronous acquisition session (:mod:`pymanip.video.session`)
==================================================================
This module provides a high-level class, :class:`VideoSession`, to be used in acquisition scripts.
Users should subclass :class:`VideoSession`, and add two methods: ``prepare_camera(sel... | jsalort/pymanip | pymanip/video/session.py | session.py | py | 32,358 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "pymanip.asyncsession.AsyncSession",
"line_number": 117,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.today",
"line_number": 166,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 166,
"usage_type": "name"
},
{
"ap... |
38581092734 | from django.http import HttpResponseRedirect
from database.models.Client import Client
from database.models.Robot import Robot
from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls import reverse_lazy
from django.views.generic import *
class ClientDelete(LoginRequiredMixin, DeleteView):
... | dm-bogachev/Robobase | database/views/Client/ClientDeleteView.py | ClientDeleteView.py | py | 1,154 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.contrib.auth.mixins.LoginRequiredMixin",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "database.models.Client.Client",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "database.models.Robot.Robot.objects.filter",
"line_number": 16,
... |
39346228416 | from pathlib import Path
from typing import Iterable, Optional, Callable
import numpy as np
import matplotlib.pyplot as plt
import cv2
import pandas as pd
from matplotlib import rcParams
rcParams['font.family'] = 'Liberation Sans'
rcParams['font.size'] = 6
def combine_in_one_img(imgs: Iterable[np.ndarray],
... | mkuri/traffic-sign-classifier-udacity | visualize/img.py | img.py | py | 1,196 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.rcParams",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Iterable",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray... |
17180757390 | from typing import List
class Solution:
def sortArrayByParity(self, A: List[int]) -> List[int]:
even, odd = [], []
for e in A:
if e % 2 == 0:
even.append(e)
else:
odd.append(e)
even.extend(odd)
return even | miniyk2012/leetcode | leetcode_projects/leetcode_905/sort_array_by_parity.py | sort_array_by_parity.py | py | 307 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 3,
"usage_type": "name"
}
] |
39442675675 | from __future__ import division
from __future__ import print_function
import numpy as np
import lightgbm as lgb
from sklearn.metrics import roc_auc_score, mean_squared_error
from .base import Model
from ...utils import drop_nan_by_y_index
class LGBModel(Model):
"""LightGBM Model
Parameters
----------
... | chunweixu/qlib | qlib/contrib/model/gbdt.py | gbdt.py | py | 2,934 | python | en | code | null | github-code | 7 | [
{
"api_name": "base.Model",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "sklearn.metrics.mean_squared_error",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "sklearn.metrics.roc_auc_score",
"line_number": 26,
"usage_type": "name"
},
{
"api_n... |
42217216846 | from sqlalchemy import Column, Integer, String, MetaData
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
#engine = create_engine("mysql://<Username>:<Password>@<Host>:<Port>/<Database name>")
engine = create_engine("mysql://root:@loca... | ganeshk1928/sqlalchemy-demo-py | db.py | db.py | py | 1,511 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 11,
"usage_type": "call"... |
24025535169 | #!/usr/bin/env python3
"""
Create a PDF file (proof) of three predefined images of the head (left, front, right view)
alongside create a CSV file with all pose names by client and px to deliver to the client
"""
import os
import sys
import time
import shlex
import shutil
import logging
import colorama # https://pypi... | stephanosterburg/pixelgun | pxproofs/pxproofs.py | pxproofs.py | py | 16,282 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "queue.PriorityQueue",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "queue.PriorityQueue",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "colorama.init",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "platform.system... |
15413812055 | from flask import Flask, request, send_from_directory, redirect, render_template, flash, url_for, jsonify, \
make_response, abort
from pretrained_model_predict import *
import tensorflow as tf
print('load model...')
g = tf.Graph()
# need to specify graph explicitly, otherwise there will be error when predicting
w... | zhengjxu/chatbot | notebooks/server.py | server.py | py | 2,631 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tensorflow.Graph",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "flask.request.metho... |
23766617287 | import requests
import pandas as pd
import sqlite3
from data.database.sqlite_server import connectSqlite, DBpath
# Binance API URL
url = "https://api.binance.com/api/v3/klines"
# Trading pair and interval (e.g., BTCUSDT, 1h)
symbol = "BTCUSDT"
interval = "1m"
exchange = "binance"
# read the time of the last data
ta... | Oldhuntor/Backtest | data/Binance/get_data/forward.py | forward.py | py | 1,599 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "data.database.sqlite_server.connectSqlite",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "data.database.sqlite_server.DBpath",
"line_number": 17,
"usage_type": "argument"
},
{
"api_name": "requests.get",
"line_number": 44,
"usage_type": "call"
... |
71567325343 | # -*- coding: utf-8 -*-
import os
import sys
import xattr
from pymagic.constants import *
from pymagic import magic_load, magic_open, magic_close, magic_buffer
meta_library_lookup = {
'metaudio': ['audio/mpeg', 'audio/ogg',
'audio/x-wav', 'audio/flac'],
'metavideo': ['video/x-matroska', 'v... | harshavardhana/bungee-plugins | fileutils/meta.py | meta.py | py | 3,230 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pymagic.magic_open",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pymagic.magic_load",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pymagic.magic_buffer",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pymagic.ma... |
8440869432 | #calculate pseudo label path
#for_trainディレクトリの情報にもとづく
import numpy as np
from matplotlib import pyplot as plt
import matplotlib
from tqdm import tqdm
import cv2
import pandas as pd
from pathlib import Path
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
def pos_acc(gt, pos_l):
term0 = gt==0... | takehiro-yamane/BVS | review/pseudo_label_acc.py | pseudo_label_acc.py | py | 3,615 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pathlib.Path",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_numbe... |
43180293397 | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 5 22:35:32 2022
@author: nbadam
"""
import json
from utils.db_connection import *
from utils.base_schema import *
import pandas.io.sql as sqlio
from sqlalchemy import select
from flask import request
from flask import Flask
import pandas as pd
import numpy as np
from pr... | Personicle/personicle-exposome-service | weather_aqi_api_final.py | weather_aqi_api_final.py | py | 4,825 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "flask.requ... |
2377240999 | from transformers import BertTokenizer, TFBertForSequenceClassification
from transformers import InputExample, InputFeatures
from sklearn.model_selection import train_test_split
import tensorflow as tf
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))
if len(tf.config.list_physical_devices('GPU... | trippletroubleteam/olivia | scrap/model.py | model.py | py | 5,212 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tensorflow.config.list_physical_devices",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "tensorflow.config",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.config.list_physical_devices",
"line_number": 6,
"usage_type": "c... |
39505570563 | import darklight as dl
import torch
from mobilenet_v2 import MobileNetV2
from torchvision import models
teacher=models.resnet152(pretrained=True)
student= MobileNetV2(imsize=[224, 224], inchannels=3, nclasses=1000)
dl.exportonnx(teacher, 'rn152.onnx', bsize=1, hw=[224,224])
del teacher #free up CPU or GPU memory used... | dataplayer12/mobilenet-v2 | train.py | train.py | py | 805 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "torchvision.models.resnet152",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torchvision.models",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "mobilenet_v2.MobileNetV2",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": ... |
72844350302 | import math
import re
import six
from paddlenlp.transformers import AutoTokenizer
from paddlenlp.utils.tools import get_bool_ids_greater_than, get_span
from ais_bench.infer.interface import InferSession
class InferBackend(object):
def __init__(self, model_path, device_id=0):
print(">>> [InferBackend] Cr... | Ascend/ModelZoo-PyTorch | ACL_PyTorch/built-in/nlp/Uie_for_Pytorch/uie_npu_predictor.py | uie_npu_predictor.py | py | 17,613 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "ais_bench.infer.interface.InferSession",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "six.string_types",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "paddlenlp.transformers.AutoTokenizer.from_pretrained",
"line_number": 37,
"u... |
22812283147 | # Imports for CRUD functionality
from sqlalchemy import create_engine, asc, func, select, MetaData, exc
from sqlalchemy.orm import sessionmaker
from database_setup import Base, User, Category, Item
# Imports to implement nested JSON
import pandas
from functools import partial, wraps
import json
# Connect to the datab... | myasul/catalog | database_helper.py | database_helper.py | py | 3,115 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "database_setup.Base.metadata",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "database_setup.Base",
"line_number": 13,
"usage_type": "name"
},
{
"ap... |
8232650075 | # encoding: utf-8
"""
@author: Liurunzhi
@time: 2021/7/12 9:21
@Describe: 把视频转为图片
"""
import cv2
from cv2 import VideoWriter, VideoWriter_fourcc, imread, resize
def Video2Pic():
videoPath = "/home/lrz/Documents/Codes/Yolov5-deepsort/video/131744.mp4" # 读取视频路径
imgPath = "/home/lrz/Documents/Codes/Yolov5-deeps... | liurunsmileliu/yolov5_deepsort_fish | yolov5/data_utils/video2picture.py | video2picture.py | py | 1,153 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 31,
"usage_type": "call"
}
] |
36662019835 | import numpy as np
from skimage import io
import os
def dataset():
dataset = []
for myDir in os.listdir('CroppedYale'):
for myFile in os.listdir('CroppedYale/{}'.format(myDir)):
label = myDir
img = io.imread('CroppedYale/{0}/{1}'.format(myDir, myFile))
da... | steven0129/ML-assignment | assignment1/answer/func.py | func.py | py | 1,020 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.listdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "skimage.io.imread",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "skimage.io",
"line_number":... |
34873976989 | import os
import click
import pandas
import tabulate
from clapper.click import verbosity_option
from clapper.logging import setup
from tqdm import tqdm
logger = setup(__name__.split(".")[0], format="%(levelname)s: %(message)s")
@click.command(
epilog="""Examples:
\b
1. Compares system A and B, with their ow... | bioidiap/bob.ip.binseg | src/deepdraw/script/compare.py | compare.py | py | 8,030 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "clapper.logging.setup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 174,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 184,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
1590235675 | import torch
import torch.nn as nn
def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1):
"""3x3 convolution with padding"""
# 已看過
# 一般卷積或是膨脹卷積
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=dilation, groups=groups, bias=False, dilation=... | chris901003/DeepLearning | pytorch_segmentation/FCN/src/backbone.py | backbone.py | py | 10,420 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "torch.nn.Conv2d",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": ... |
26633312536 | import asyncio
import random
import datetime as dt
from src.cards import MonthlyStatsCard as _Card
highlights = [
'title_colour',
'top_hours_colour',
'top_hours_bg_colour',
'top_line_colour',
'top_date_colour',
'top_this_colour',
'top_last_colour',
'top_this_hours_colour',
'top_las... | StudyLions/StudyLion | tests/gui/cards/monthly_spec_sample.py | monthly_spec_sample.py | py | 1,427 | python | en | code | 73 | github-code | 7 | [
{
"api_name": "random.seed",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "src.cards.MonthlyStatsCard.generate_sample",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "src.cards.MonthlyStatsCard",
"line_number": 38,
"usage_type": "name"
},
{
... |
29267613490 | import math
import numpy as np
import matplotlib.pyplot as plt
n_list = [1,10,50,100]
### Obtain the Y values for each X value in each function and plot the result ###
## n! (factorial)
y1 = np.array([math.factorial(n) for n in n_list])
## 2^n
y2 = np.array([2**n for n in n_list])
## n²
y3 = np.array([n**2 for n in ... | gpalou4/APA | algorithmic_costs.py | algorithmic_costs.py | py | 692 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "numpy.array",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "math.factorial",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number... |
814391201 | from __future__ import division, print_function
# coding=utf-8
import sys
import os
import glob
import re
import numpy as np
from skimage.color import gray2rgb
from skimage.color import rgb2gray
from keras.models import load_model
import cv2
# Keras
from keras.applications.imagenet_utils import preprocess_input, decod... | omerhameed98/projinterface | app.py | app.py | py | 2,572 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "keras.models.load_model",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "skimage.io.imread",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
... |
37546669381 | from rover import rover
import datetime
import numpy as np
import rospy
from sensor_msgs.msg import Imu
def thread_imu():
print('IMU: thread starting ..')
rospy.Subscriber('uav_imu', Imu, rover.ros_imu_callback)
rate = rospy.Rate(100) # 100 hz
freq = 100.0
t = datetime.datetime.now()
t_pre... | fdcl-gwu/uav_simulator | scripts/thread_imu.py | thread_imu.py | py | 711 | python | en | code | 80 | github-code | 7 | [
{
"api_name": "rospy.Subscriber",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sensor_msgs.msg.Imu",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "rover.rover.ros_imu_callback",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_na... |
35966020147 | import torch
import torch.nn as nn
class AMFNet(nn.Module):
def __init__(self, input_size, hidden):
super(AMFNet, self).__init__()
self.fc1 = nn.Linear(input_size, hidden) # 5*5 from image dimension
self.output_layer = nn.Linear(hidden, 1)
def forward(self, x):
fc1_z... | MatriXcel/tempo_work | NN_layer.py | NN_layer.py | py | 497 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numbe... |
14548818497 | from typing import Type, Optional, Dict, Any
from django import template
from django.forms import Form
from django.urls import reverse_lazy
register = template.Library()
@register.inclusion_tag('portfolio/components/action-btn.html')
def action_btn(btn_txt: str, id_prefix: str, style: str,
section: Optio... | zetoichi/cumbia | portfolio/templatetags/extra_tags.py | extra_tags.py | py | 800 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.template.Library",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Optional... |
19521791820 | # -*- coding:utf-8 -*-
import json
from Utility import Utils
from .models import *
class ProductType:
unknown = -1
stock = 0
fund = 1
index = 2
class ProductHelper:
@staticmethod
def __getAllStocks(dataprovider):
result = dataprovider.getAllStockProdInfo()
stocks = json.loa... | caledcui/prototype | zig/prototype/product.py | product.py | py | 1,796 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.loads",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "Utility.Utils.log",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "Utility.Utils",
"line_num... |
74101835742 | """
比对主力连续合约数据
"""
import pandas as pd
from tqdm import tqdm
import matplotlib.pyplot as plt
origin_data = pd.read_pickle("/data/废弃数据/continuous_main_contract_series.pkl")
data1 = pd.read_pickle("/data/continuous_contract_series/continuous_main_contract_series 1.pkl")
data2 = pd.read_pickle("/data/continuous_contract_... | algo21-219040029/Assignment3 | example/主力连续合约对比.py | 主力连续合约对比.py | py | 1,389 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pandas.read_pickle",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_pickle",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_pickle",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_pi... |
36863710808 | import os
import pickle
import tempfile
from concurrent.futures import ThreadPoolExecutor
from collections import Counter
import time
from datetime import datetime
import cv2
import tensorflow as tf
from tensorflow import keras
from keras.models import model_from_json
import numpy as np
from flask import (
Flask,
... | nntruong1907/Flask_YG | app.py | app.py | py | 29,589 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "movenet.Movenet",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path.exist... |
16647704354 | #Matthew Leung
#March 2022
#Python 3
from __future__ import print_function
# import standard packages
import sys
import os
import ctypes
import time
from datetime import date
import shutil
from PIL import Image
import numpy as np
# Matrix Vision
from mvIMPACT import acquire
#from mvIMPACT.Common import exampleHelper... | mattleung10/G-CLEF_Fiber_Lab | Matrix_Vision_Interface/Using_mvIMPACT/Exploratory/mv_acquire_test.py | mv_acquire_test.py | py | 13,386 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "mvIMPACT.acquire.dilGenICam",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "mvIMPACT.acquire",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "mvIMPACT.acquire.assbUser",
"line_number": 31,
"usage_type": "attribute"
},
{
"... |
71587690465 | #!/usr/bin/env python3
import sys
sys.path.append('../..')
import numpy as np
from neml.cp import polycrystal, crystallography, slipharden, sliprules, inelasticity, kinematics, singlecrystal, polefigures, postprocessors
from neml.math import rotations, tensors, nemlmath, matrix
from neml import elasticity
import ma... | Argonne-National-Laboratory/neml | examples/cp/ti_rolling.py | ti_rolling.py | py | 3,916 | python | en | code | 9 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_numbe... |
36511272234 | from typing import List
from .Cell import Cell
class Row(dict):
"""
{
"cells": [
{
object(Cell)
}
],
"dividerAfter": boolean
}
"""
def __init__(self, divider_after: bool = False, cells: Cell = None):
super().__init__()
if cells is None:
... | mayankberi1/GoogleActions | Row.py | Row.py | py | 741 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "Cell.Cell",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "Cell.Cell",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "Cell.Cell",
"line_number": 27,
"usage_type": "argument"
},
{
"api_name": "typing.List",
"line_number": 25... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.