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
71015513315
# Title: 우수 마을 # Link: https://www.acmicpc.net/problem/1949 import sys from collections import defaultdict sys.setrecursionlimit(10 ** 6) read_single_int = lambda: int(sys.stdin.readline().strip()) read_list_int = lambda: list(map(int, sys.stdin.readline().strip().split(' '))) def get_max(vil: int,...
yskang/AlgorithmPractice
baekjoon/python/best_vilage_1949.py
best_vilage_1949.py
py
1,357
python
en
code
1
github-code
1
[ { "api_name": "sys.setrecursionlimit", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.stdin.readline", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.stdin.read...
12282411056
import ply.lex as lex from ply.lex import TOKEN class Lexer: tokens = ( "WORD", "APOSTROPH", "NEWLINE", "OTHERS", ) large_alpha = "[ΑἈἌᾌἊᾊἎᾎᾈἉἍᾍἋᾋᾋἏᾉΆᾺᾼ]" large_epsilon = "[ΕἘἜἚἙἝἛΈῈ]" large_eta = "[ΗἨἬᾜἪᾚἮᾞᾘἩἭᾝἫᾛᾛἯᾙΉῊῌ]" large_iota = "[ΙἸἼἺἾἹἽἻἿΊῚΪ]" la...
ohmin839/pyplgr
pyplgr/plgrcoll/lexer.py
lexer.py
py
2,770
python
en
code
0
github-code
1
[ { "api_name": "ply.lex.TOKEN", "line_number": 56, "usage_type": "call" }, { "api_name": "ply.lex.lex", "line_number": 75, "usage_type": "call" }, { "api_name": "ply.lex", "line_number": 75, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 89, ...
74863567394
import time import gql from gql.transport.aiohttp import AIOHTTPTransport from gql.transport.exceptions import TransportError class MidosHouse: def __init__(self): self.client = gql.Client(transport=AIOHTTPTransport(url='https://midos.house/api/v1/graphql')) self.cache = None self.cache_e...
deains/ootr-randobot
randobot/midos_house.py
midos_house.py
py
1,113
python
en
code
2
github-code
1
[ { "api_name": "gql.Client", "line_number": 10, "usage_type": "call" }, { "api_name": "gql.transport.aiohttp.AIOHTTPTransport", "line_number": 10, "usage_type": "call" }, { "api_name": "time.monotonic", "line_number": 12, "usage_type": "call" }, { "api_name": "time...
27576774668
import numpy as np import cv2 as cv img = cv.imread("Resources/test.png") gray = cv.cvtColor(img,cv.COLOR_BGR2GRAY) cv.imshow("Gray", gray) lap = cv.Laplacian(gray,cv.CV_64F) lap = np.uint8(np.absolute(lap)) cv.imshow("Laplacian", lap) cv.waitKey(0)
SafirIqbal/Demo-repo
Laplacian.py
Laplacian.py
py
261
python
en
code
0
github-code
1
[ { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 5, "usage_type": "attribute" }, { "api_name": "cv2.imshow", "line_n...
14841507583
#!/usr/bin/env python import argparse from termcolor import colored from app import App from constants import ERROR_COLOR, KEY_COLOR, INFO_COLOR from utils import did_you_mean def run(): parser = argparse.ArgumentParser(description='Command line key-value store.', add_help=Fal...
vinu76jsr/kaboom
kaboom/kaboom.py
kaboom.py
py
1,158
python
en
code
0
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "app.App", "line_number": 19, "usage_type": "call" }, { "api_name": "termcolor.colored", "line_number": 22, "usage_type": "call" }, { "api_name": "constants.ERROR_COL...
12834853666
import json from sqlalchemy import create_engine, Column, Integer, String from sqlalchemy.orm import sessionmaker from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class User(Base): __tablename__ = 'users' id = Column(Integer, primary_key=True) age = Column(Integer) inc...
nicholascgilpin/lifeman
database.py
database.py
py
2,710
python
en
code
0
github-code
1
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 6, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 10, "usage_type": "argument" }, { ...
2071335048
import json import logging import os import re import sys import time import requests def get_logger(name): log_file = os.getenv('DISKU_LOG_FILE') if log_file: log_handler = logging.FileHandler(log_file) else: log_handler = logging.StreamHandler(sys.stdout) log_handler.setFormatter(lo...
Inndy/disku
disku.py
disku.py
py
8,386
python
en
code
0
github-code
1
[ { "api_name": "os.getenv", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.FileHandler", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.stdout", ...
72116071075
""" Utilities for testing """ from collections import namedtuple import numpy as np from .callbacks import ConvergenceCallback from .cpd import GaussianCPD from .irt import BayesNetLearner from .node import Node EPSILON = 1e-3 NUM_TRIALS = 3 NUM_ITEMS = 50 NUM_INSTR_ITEMS = 0 NUM_LATENT = 1 NUM_CHOICES = 2 NUM_RESP...
Knewton/edm2016
rnn_prof/irt/testing_utils.py
testing_utils.py
py
6,559
python
en
code
58
github-code
1
[ { "api_name": "collections.namedtuple", "line_number": 41, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 50, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 50, "usage_type": "attribute" }, { "api_name": "numpy.copy", "line...
42896773895
import torch import torch.nn as nn import torch.nn.functional as F from transformers import * from transformers.modeling_roberta import RobertaLMHead from transformers.modeling_bert import BertOnlyMLMHead class BertMLM(BertPreTrainedModel): """BERT model with the masked language modeling head. """ def __i...
alexa/ramen
code/src/models.py
models.py
py
5,251
python
en
code
17
github-code
1
[ { "api_name": "transformers.modeling_bert.BertOnlyMLMHead", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.masked_select", "line_number": 31, "usage_type": "call" }, { "api_name": "torch.nn.functional.cross_entropy", "line_number": 33, "usage_type": "call...
19063572783
from __future__ import annotations import dataclasses import enum import grpc from tensorflow_serving.apis.model_pb2 import ModelSpec from tensorflow_serving.apis.model_service_pb2_grpc import ModelServiceStub from tensorflow_serving.apis.prediction_service_pb2_grpc import PredictionServiceStub from tensorflow_serving...
nanaya-tachibana/sknlp-server
sknlp_serving/tfserving.py
tfserving.py
py
6,178
python
en
code
0
github-code
1
[ { "api_name": "enum.Enum", "line_number": 27, "usage_type": "attribute" }, { "api_name": "tensorflow.core.framework.types_pb2.DataType", "line_number": 54, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 51, "usage_type": "attribute" }, {...
12179042424
from itertools import dropwhile from io_utils import read_file, write_file def clear_missed_rides(rides, max_time, ctime): time_left = max_time - ctime if rides and rides[0].score > time_left: rides = list(dropwhile(lambda x: x.score > time_left, rides)) return rides def run_example(input_file,...
bonheml/hashcode_2018
main.py
main.py
py
792
python
en
code
0
github-code
1
[ { "api_name": "itertools.dropwhile", "line_number": 9, "usage_type": "call" }, { "api_name": "io_utils.read_file", "line_number": 15, "usage_type": "call" }, { "api_name": "io_utils.write_file", "line_number": 25, "usage_type": "call" } ]
29121079371
from selenium import webdriver import time from selenium.common.exceptions import NoSuchElementException import random class amdAutomation(): def __init__(self): self.driver = None def setWebsiteLocation(self, link): self.driver = webdriver.Chrome('/Users/chiraag/chromedriver') self.d...
crekhari/Graphics-Card-Auto-Checkout-Bot
src/amd.py
amd.py
py
1,348
python
en
code
0
github-code
1
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 12, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 12, "usage_type": "name" }, { "api_name": "selenium.common.exceptions.NoSuchElementException", "line_number": 27, "usage_type": "name" ...
13885704764
from time import perf_counter_ns # Calcul temps d'exécution import matplotlib.pyplot as plt # Graphes def InsertSort(l): """ entree : -------- l : liste d’entier ou réel liste à trier Sortie : -------- l : liste triée Attention la liste initiale est modifiée. ""...
Ilade-s/Sorting-Algorithms
TriInsertions.py
TriInsertions.py
py
3,080
python
en
code
0
github-code
1
[ { "api_name": "matplotlib.pyplot.title", "line_number": 80, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 80, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 82, "usage_type": "call" }, { "api_name": "matp...
6819650595
from flask import render_template, Blueprint from app.model import Article, User, Category, Tag blueprint = Blueprint('front', __name__, template_folder='templates') @blueprint.route("/") def index(): result = Article.query.getall() categorys = Category.query.all() #tags = Tag.query.all() temp = Arti...
romasport/coolflask
app/view/front.py
front.py
py
1,022
python
en
code
0
github-code
1
[ { "api_name": "flask.Blueprint", "line_number": 4, "usage_type": "call" }, { "api_name": "app.model.Article.query.getall", "line_number": 8, "usage_type": "call" }, { "api_name": "app.model.Article.query", "line_number": 8, "usage_type": "attribute" }, { "api_name...
72276045475
import pygame class Sprite(pygame.sprite.Sprite): def __init__(self, groups=[]): super().__init__(groups) # The state for the sprite self.state = "released" self.mouse_state = "released" # This makes sure that the rect actually exists # self.rect = sel...
LeoTheMighty/ApocalypseLater
ui/Sprite.py
Sprite.py
py
1,761
python
en
code
0
github-code
1
[ { "api_name": "pygame.sprite", "line_number": 4, "usage_type": "attribute" } ]
74345211234
# # @lc app=leetcode.cn id=122 lang=python3 # # [122] 买卖股票的最佳时机 II # from typing import List # @lc code=start class Solution: def maxProfit(self, prices: List[int]) -> int: #---------------------------------------------------------------# # 贪心算法 # 计算相隔两天的利润 # 利润为正就sum++ ...
Zigars/Leetcode
贪心算法/122.买卖股票的最佳时机-ii.py
122.买卖股票的最佳时机-ii.py
py
701
python
en
code
0
github-code
1
[ { "api_name": "typing.List", "line_number": 9, "usage_type": "name" } ]
12752768218
""" These modules are responsible for scheduling model transfers while adhering to bandwidth limitations of both the sending and receiving party. """ import logging import random from asyncio import Future, get_event_loop, InvalidStateError from typing import List, Dict from ipv8.taskmanager import TaskManager class...
devos50/decentralized-learning
simulations/bandwidth_scheduler.py
bandwidth_scheduler.py
py
14,192
python
en
code
2
github-code
1
[ { "api_name": "ipv8.taskmanager.TaskManager", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.List", ...
29490050611
import collections import numpy as np # type: ignore import random from typing import List, Tuple, Union class SkipGramBatcher: """Encapsulate functionality for getting the next batch for SkipGram from a single list of ints (e.g. from a single text with no sentences). Use SkipGramListBatcher for Node2Vec....
LeoPompidou/embiggen
embiggen/w2v/skip_gram_batcher.py
skip_gram_batcher.py
py
4,263
python
en
code
null
github-code
1
[ { "api_name": "typing.List", "line_number": 29, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 29, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_number": 68, "usage_type": "call" }, { "api_name": "numpy.int32", "line_number...
12844050855
import numpy as np import cv2 def get_matrix_2D(center, rot, trans, scale): ca = np.cos(rot) sa = np.sin(rot) sc = scale cx = center[0] cy = center[1] tx = trans[0] ty = trans[1] t = np.array([[ca * sc, -sa * sc, sc * (ca * (-tx - cx) + sa * ( cy + ty)) + cx], [sa * s...
mqne/GraphLSTM
region_ensemble/transformations.py
transformations.py
py
1,583
python
en
code
8
github-code
1
[ { "api_name": "numpy.cos", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.hstack", "line_number": 20, ...
30079937946
#! /usr/bin/env python3 import xml.etree.ElementTree as ET import requests import sys from datetime import datetime import subprocess def get_m3u8(targetarea='tokyo', station='fm'): hls = station + "hls" ...
mnod/docker-radiru
rec_radio.py
rec_radio.py
py
1,880
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 18, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.fromstring", "line_number": 20, "usage_type": "call" }, { "api_name": "xml.etree.Elem...
19654910100
import keras import os, shutil from keras import layers from keras import models from keras import optimizers from keras.preprocessing.image import ImageDataGenerator import matplotlib.pyplot as plt model = models.Sequential() model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=(...
BoomFan/dogs_vs_cats
Chapter5/chapter5_2_2.py
chapter5_2_2.py
py
3,262
python
en
code
0
github-code
1
[ { "api_name": "keras.models.Sequential", "line_number": 9, "usage_type": "call" }, { "api_name": "keras.models", "line_number": 9, "usage_type": "name" }, { "api_name": "keras.layers.Conv2D", "line_number": 10, "usage_type": "call" }, { "api_name": "keras.layers",...
40071012285
"""empty message Revision ID: 075ef7b7f465 Revises: c8df1e64ac3f Create Date: 2020-01-14 00:46:47.381666 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '075ef7b7f465' down_revision = 'c8df1e64ac3f' branch_labels = None depends_on = None def upgrade(): # ...
paduck210/flask_practice
resources/migrations/versions/075ef7b7f465_.py
075ef7b7f465_.py
py
780
python
en
code
1
github-code
1
[ { "api_name": "alembic.op.batch_alter_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy....
11737218073
"""apks table Revision ID: e10608056996 Revises: dd4e694b3acf Create Date: 2018-08-20 15:22:37.862657 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'e10608056996' down_revision = 'dd4e694b3acf' branch_labels = None depends_on = None def upgrade(): # ###...
johndoe-dev/Ecodroid
migrations/versions/e10608056996_apks_table.py
e10608056996_apks_table.py
py
1,158
python
en
code
0
github-code
1
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
39879428
import datetime class Logic: localTime = datetime.datetime.now() carLeft = carRight = carFront = carBack = False def __init__(self, GPSData): self.GPS = GPSData def shouldWindowsBeTinted(self): if 60 < self.GPS.elevationAngle < 120: print("GPS Elevation angle shows no t...
swachm/AutoCarWindowVisor
Model/Logic.py
Logic.py
py
1,007
python
en
code
0
github-code
1
[ { "api_name": "datetime.datetime.now", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 6, "usage_type": "attribute" } ]
28816552446
def showbook(url, kind): html = requests.get(url).text soup = BeautifulSoup(html, 'html.parser') try: pages = int(soup.select('.cnt_page span')[0].text) # 该分类共有多少页 print("共有", pages, "页") for page in range(1, pages + 1): pageurl = url + '&page=' + str(page).strip() ...
c7934597/Python_Internet_NewBook_Boards
books_xlsx.py
books_xlsx.py
py
2,801
python
zh
code
0
github-code
1
[ { "api_name": "openpyxl.Workbook", "line_number": 52, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 59, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 60, "usage_type": "call" } ]
10668569761
from django.forms import ModelForm from core.erp.models import * from django.forms import * class ListForm(ModelForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) for form in self.visible_fields(): form.field.widget.attrs['class']='form-control' fo...
AxelAlvarenga/Proyecto2022
Eldeportista/app/core/login/forms.py
forms.py
py
439
python
en
code
0
github-code
1
[ { "api_name": "django.forms.ModelForm", "line_number": 7, "usage_type": "name" } ]
23568303273
from os import error from time import sleep import serial import psutil import serial.tools.list_ports import GPUtil import json from hotkey import activate_gpu, activate_mem ports = serial.tools.list_ports.comports() handShakePort = None prevMode = 0 mode = 0 memoryActivate = False maxMem = 0 memKey = '' gpuKey = '' g...
brutalzinn/arduino-python-computer-monitor
main.py
main.py
py
3,817
python
en
code
0
github-code
1
[ { "api_name": "serial.tools.list_ports.comports", "line_number": 9, "usage_type": "call" }, { "api_name": "serial.tools", "line_number": 9, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 24, "usage_type": "call" }, { "api_name": "serial.Ser...
39479793327
import json import matplotlib.pyplot as plt print("Loading cross validation history...") with open("imdb_histories", "r") as f: histories = json.load(f) # Visualizing the data control = histories[0] ctrl_val = control["val_loss"] epochs = range(1, len(ctrl_val) + 1) print("Plotting comparisions...") for idx,...
byelipk/deep-imdb
imdb_model_compare_eval.py
imdb_model_compare_eval.py
py
642
python
en
code
0
github-code
1
[ { "api_name": "json.load", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.title", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 19, "usage_type": "name" }, { "api_name": "matplotlib.pyplot....
72005765155
import requests import requests as rq from util import jieba # 使用scikit-learn進行向量轉換 # 忽略在文章中佔了90%的文字(即去除高頻率字彙) # 文字至少出現在2篇文章中才進行向量轉換 from bs4 import BeautifulSoup from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer, TfidfVectorizer # import pandas ...
Chunshan-Theta/GlobePocket
util/ins_explore.py
ins_explore.py
py
6,623
python
en
code
0
github-code
1
[ { "api_name": "pandas.DataFrame", "line_number": 21, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.TfidfTransformer", "line_number": 23, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.CountVectorizer", "line_number": 24, "u...
1585776599
from typing import Optional, List from validator_collection import validators, checkers from highcharts_core.metaclasses import HighchartsMeta from highcharts_core.decorators import class_sensitive, validate_types from highcharts_core.options.sonification.track_configurations import (InstrumentTrackConfiguration, ...
highcharts-for-python/highcharts-core
highcharts_core/options/plot_options/sonification.py
sonification.py
py
7,074
python
en
code
40
github-code
1
[ { "api_name": "highcharts_core.metaclasses.HighchartsMeta", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 32, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 40, "usage_type": "name" }, { "api_na...
39156355623
#+--------------------------------------------------------------------- #+ Python Script that creates CMAQ_ADJ v4.5 forcing files #+ Check the 'CHANGE' comments to define your directories for the run #+ Author: Camilo Moreno #+ Email = cama9709@gmail.com #+--------------------------------------------------------------...
kamitoteles/Forcingfile_generator_CMAQ_adj_v4.5
cmaqadj_forcefile.py
cmaqadj_forcefile.py
py
8,146
python
en
code
0
github-code
1
[ { "api_name": "numpy.ma.getdata", "line_number": 53, "usage_type": "call" }, { "api_name": "numpy.ma", "line_number": 53, "usage_type": "attribute" }, { "api_name": "numpy.ma.getdata", "line_number": 54, "usage_type": "call" }, { "api_name": "numpy.ma", "line_...
35533894023
import json import logging try: from http import client as httplib except ImportError: # Python 2.6/2.7 import httplib import urllib from pretenders.common.exceptions import ( ConfigurationError, ResourceNotFound, UnexpectedResponseStatus, ) from pretenders.common.pretender import PretenderMo...
pretenders/pretenders
pretenders/client/__init__.py
__init__.py
py
5,630
python
en
code
108
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "httplib.CannotSendRequest", "line_number": 43, "usage_type": "attribute" }, { "api_name": "httplib.BadStatusLine", "line_number": 43, "usage_type": "attribute" }, { "api_n...
3841312108
#!/usr/bin/env python # -*- coding: utf-8 -*- # import dependency library import numpy as np import pandas as pd from static import config from scipy import ndimage from collections import Counter import csv import os # import user defined library import utils.general_func as general_f def get_cell_name_affin...
chiellini/CellFeatureEnhancementModel
utils/cell_func.py
cell_func.py
py
3,769
python
en
code
0
github-code
1
[ { "api_name": "static.config.data_path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "static.config", "line_number": 23, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 29, "usage_type": "call" }, { "api_name": "scipy.ndim...
22752641641
from django.urls.conf import path from . import views app_name = 'events' urlpatterns = [ path('create-event/', views.CreateEventView.as_view(), name="create_event"), path('edit-event/<uuid:event_id>/', views.EditEventView.as_view(), name='edit_event'), path('get-events/', views.RetrieveEventView.as_view(...
rashiddaha/django_meet
events/urls.py
urls.py
py
449
python
en
code
1
github-code
1
[ { "api_name": "django.urls.conf.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.conf.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.conf.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django...
5890621434
import torch from torch.autograd import Variable as Var import torch.nn as nn def ifcond(cond, x_1, x_2): # ensure boolean cond = cond.byte().float() # check is it Tensor or Variable if not hasattr(cond, "backward"): cond = Var(cond, requires_grad=False) return (cond * x_1) + ((1-cond) * x...
ds4an/CoDas4CG
CodeOfApproaches/tree2tree/model/utils.py
utils.py
py
3,470
python
en
code
13
github-code
1
[ { "api_name": "torch.autograd.Variable", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.cat", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.LongTensor", ...
12466619564
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('urly_app', '0004_auto_20161026_1723'), ] operations = [ migrations.AddField( model_name='link', name...
spe-bfountain/short
urly_app/migrations/0005_link_requires_login.py
0005_link_requires_login.py
py
401
python
en
code
0
github-code
1
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AddField", "line_number": 14, "usage_type": "call" }, { ...
35367988265
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import json import yaml import datetime import argparse from collections import defaultdict from dateutil.parser import parse from dateutil.rrule import rrule, DAILY from dateutil.relativedelta import relativedelta from utils import get_season, get_team_from_g...
leaffan/del_stats
backend/get_del_games.py
get_del_games.py
py
20,247
python
en
code
14
github-code
1
[ { "api_name": "yaml.safe_load", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_...
18187068649
"""Control navigation of FOREST data""" import copy import datetime as dt import numpy as np import pandas as pd import bokeh.models import bokeh.layouts from collections import namedtuple from forest import data from forest.observe import Observable from forest.util import to_datetime as _to_datetime from forest.expor...
MetOffice/forest
forest/db/control.py
control.py
py
21,707
python
en
code
38
github-code
1
[ { "api_name": "forest.export.export", "line_number": 56, "usage_type": "name" }, { "api_name": "forest.export.export", "line_number": 61, "usage_type": "name" }, { "api_name": "forest.export.export", "line_number": 66, "usage_type": "name" }, { "api_name": "forest...
26395961422
from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC #escolhe o chrome #endereco para o chrome driver PATH = "/home/amanda/Docum...
AmandaApolinario/SpiritFanficFavoritador
coisadelu.py
coisadelu.py
py
1,474
python
en
code
2
github-code
1
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 10, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.keys.Keys.RETURN", "line_number": 24, "usage_type": "attribute" ...
19369503791
from django.http import HttpResponse from django.utils.html import strip_tags from models import Listener import activity_checker import corrector import formatter cor = corrector.Corrector() fmt = formatter.Formatter() def check(request, listener_id, line_id, line): good_one, len_lines, level = Listener.get_go...
deccico/capego
listener/views.py
views.py
py
1,134
python
en
code
0
github-code
1
[ { "api_name": "corrector.Corrector", "line_number": 10, "usage_type": "call" }, { "api_name": "formatter.Formatter", "line_number": 11, "usage_type": "call" }, { "api_name": "models.Listener.get_good_line", "line_number": 14, "usage_type": "call" }, { "api_name": ...
10068296172
import pandas as pd import numpy as np import hydra import os import json import yaml import pickle import time from flask import Flask, request, jsonify import mysql.connector import prediction #26.6.2021 #1. Change the db into production db #2. Deploy into AWS EC2 #3. Deploy the model into AWS EKS app = Flask(__na...
hoe94/Water_Quality
src/app.py
app.py
py
1,846
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 19, "usage_type": "call" }, { "api_name": "mysql.connector.connector.connect", "line_number": 21, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 21, "usage_type": "attribute" }, { "api_...
42615469832
"""Constants and enumerations""" from enum import Enum, Flag class RinnaiSystemMode(Enum): """Define system modes.""" HEATING = 1 EVAP = 2 COOLING = 3 RC = 4 NONE = 5 class RinnaiOperatingMode(Enum): """Define unit operating modes.""" NONE = 0 MANUAL = 1 AUTO = 2 class RinnaiC...
funtastix/pyrinnaitouch
pyrinnaitouch/const.py
const.py
py
2,104
python
en
code
4
github-code
1
[ { "api_name": "enum.Enum", "line_number": 4, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 12, "usage_type": "name" }, { "api_name": "enum.Flag", "line_number": 18, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 25, "...
13043659438
import logging from ...node import InputTrigger from ...stream import DataStream from ...exceptions import SensorGraphSemanticError from .scope import Scope class GatedClockScope(Scope): """A scope that will gate all requested clocks with a latch. Args: sensor_graph (SensorGraph): The sensor graph we...
iotile/coretools
iotilesensorgraph/iotile/sg/parser/scopes/gated_clock_scope.py
gated_clock_scope.py
py
3,501
python
en
code
14
github-code
1
[ { "api_name": "scope.Scope", "line_number": 8, "usage_type": "name" }, { "api_name": "stream.DataStream.ConstantType", "line_number": 26, "usage_type": "attribute" }, { "api_name": "stream.DataStream", "line_number": 26, "usage_type": "name" }, { "api_name": "logg...
17110154056
import requests import records import json db = records.Database("mysql:///....?charset=utf8") # db.query(""" # create table video_group ( # id int primary key auto_increment, # group_id varchar(50), # title varchar(100), # data text, # comment_count int default 0, # like_count int default 0, #...
zhangheli/ScrapyLabs
crawl_toutiao.py
crawl_toutiao.py
py
1,859
python
en
code
25
github-code
1
[ { "api_name": "records.Database", "line_number": 5, "usage_type": "call" }, { "api_name": "requests.request", "line_number": 35, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 44, "usage_type": "call" } ]
30276485484
from pyroll.cli.program import main from pyroll.cli.config import RES_DIR import click.testing import os def test_create_project(tmp_path): runner = click.testing.CliRunner() os.chdir(tmp_path) result = runner.invoke(main, ["create-project"]) assert result.exit_code == 0 print(result.output) ...
pyroll-project/pyroll-cli
tests/test_create_project.py
test_create_project.py
py
495
python
en
code
1
github-code
1
[ { "api_name": "click.testing.testing.CliRunner", "line_number": 8, "usage_type": "call" }, { "api_name": "click.testing.testing", "line_number": 8, "usage_type": "attribute" }, { "api_name": "click.testing", "line_number": 8, "usage_type": "name" }, { "api_name": ...
43495745433
from datetime import datetime from pytest import fixture from .model import User from .schema import UserSchema from .interface import UserInterface @fixture def schema() -> UserSchema: return UserSchema() def test_UserSchema_create(schema: UserSchema): assert schema def test_UserSchema_works(schema: Us...
lucasg-mm/arborator-grew-nilc
backend/app/user/schema_test.py
schema_test.py
py
1,027
python
en
code
3
github-code
1
[ { "api_name": "schema.UserSchema", "line_number": 12, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 10, "usage_type": "name" }, { "api_name": "schema.UserSchema", "line_number": 11, "usage_type": "name" }, { "api_name": "schema.UserSchema"...
26641924170
from openpyxl import load_workbook workbook = load_workbook(filename=r'F:\kinscloud.github.io\Python\Excel\testxls.xlsx') #print(workbook.sheetnames) sheet = workbook.active for row in sheet.rows: #for row in sheet.iter_rows(min_row=2,max_row=3,min_col=1,max_col=3): for cell in row: print(cell.valu...
kinscloud/kinscloud.github.io
Python/Excel/openpyxlDemo.py
openpyxlDemo.py
py
458
python
en
code
0
github-code
1
[ { "api_name": "openpyxl.load_workbook", "line_number": 3, "usage_type": "call" } ]
411798820
import logging from typing import Optional from ..effect import EffectFactory from .effect_checker import EffectChecker, AnnotationEffect, AnnotationRequest class UTREffectChecker(EffectChecker): """UTR effect checker class.""" def __init__(self) -> None: self.logger = logging.getLogger(__name__) ...
iossifovlab/gpf
dae/dae/effect_annotation/effect_checkers/utr.py
utr.py
py
3,917
python
en
code
1
github-code
1
[ { "api_name": "effect_checker.EffectChecker", "line_number": 8, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "effect_checker.AnnotationRequest", "line_number": 15, "usage_type": "name" }, { "ap...
73602744993
from typing import Any import gym from gym import spaces import numpy as np import pybullet as p from robot_utils import RegisterScenes from robot_utils import Robot, rayTest, checkCollision from robot_utils.log import * from robot_utils.utils import control_miniBox import pybullet_data class MsnDiscrete(gym.Env): ...
LSTM-Kirigaya/MsnEnvironment
env/MsnDiscrete.py
MsnDiscrete.py
py
8,863
python
en
code
0
github-code
1
[ { "api_name": "gym.Env", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number": 20, "usage_type": "attribute" }, { "api_name": "gym.spaces.Discrete", "line_number": 69, "usage_type": "call" }, { "api_name": "gym.spaces", "line...
39944748888
import email import email.policy import email.utils import email.message import email.mime.multipart import email.mime.text import email.parser import os import time import traceback import boto3 from botocore.exceptions import ClientError # us-east-1 REGION = os.getenv("REGION") # your-bucket-name S3_BUCKET = os.g...
kura/private-relay
lambda.py
lambda.py
py
7,749
python
en
code
0
github-code
1
[ { "api_name": "os.getenv", "line_number": 17, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 20, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 23, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 26, ...
15471163955
import torch def css(outputs, labels, n_classes, m, m2): batch_size = outputs.size(0) defer = [n_classes] * batch_size outputs = -m2 * torch.log2(outputs[range(batch_size),labels])\ -m * torch.log2(outputs[range(batch_size), defer]) return torch.sum(outputs) / batch_size def my_CrossEntr...
Xiaozhi-sudo/learning-to-defer
CIFAR/losses.py
losses.py
py
1,128
python
en
code
0
github-code
1
[ { "api_name": "torch.log2", "line_number": 5, "usage_type": "call" }, { "api_name": "torch.log2", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.sum", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.log2", "line_number": 13, ...
1936442404
import re from django import template from django.template.defaultfilters import stringfilter from django.utils.html import escape from django.conf import settings from django_fortunes.models import Fortune register = template.Library() @register.filter @stringfilter def fortunize(value): """ Transforms a f...
n1k0/djortunes
django_fortunes/templatetags/fortune_extras.py
fortune_extras.py
py
1,168
python
en
code
7
github-code
1
[ { "api_name": "django.template.Library", "line_number": 10, "usage_type": "call" }, { "api_name": "django.template", "line_number": 10, "usage_type": "name" }, { "api_name": "re.findall", "line_number": 20, "usage_type": "call" }, { "api_name": "django.utils.html....
18931784296
from django.urls import path from .views import * urlpatterns = [ path('api/', PostList.as_view()), path('api/<int:pk>/', PostDetail.as_view()), path("", sorry, name="sorry"), # path('location/', LocationList.as_view()), # path('location/<int:pk>/', LocationDetail.as_view()), ]
mehtanishad/Rest_Api_Assessment
rest_api/restApi_App/urls.py
urls.py
py
304
python
en
code
0
github-code
1
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" } ]
22019597734
from typing import List class Solution: def numRescueBoats(self, people: List[int], limit: int) -> int: people.sort() heavy_person = len(people) - 1 light_person = 0 boats = 0 while heavy_person >= light_person: if heavy_person == light_person: ...
zahedul/leetcode
boats_to_save_people.py
boats_to_save_people.py
py
643
python
en
code
0
github-code
1
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
11424506
#기초 import numpy as np import cv2 print(cv2.__version__) img = cv2.imread("./image/food.jpg") gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) cv2.imshow("food", img) cv2.imshow("food - gray", gray) cv2.waitKey(0) cv2.destroyWindow() #보간법으로 픽셀 변경 resized = cv2.resize(img, None, fx = 0.2, fy = 0.2, interpolation=cv2.IN...
GitOfVitol/openCVProj
openCV기초.py
openCV기초.py
py
397
python
en
code
0
github-code
1
[ { "api_name": "cv2.__version__", "line_number": 5, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "l...
29544867356
import pytest from eth2.beacon.db.chain import BeaconChainDB from eth2.beacon.state_machines.forks.serenity.blocks import ( SerenityBeaconBlock, ) from eth2.beacon.tools.builder.initializer import ( create_mock_genesis, ) from eth2.beacon.tools.builder.proposer import ( create_mock_block, ) from eth2.beaco...
hwwhww/trinity
tests/eth2/beacon/state_machines/test_demo.py
test_demo.py
py
3,132
python
en
code
null
github-code
1
[ { "api_name": "eth2.beacon.db.chain.BeaconChainDB", "line_number": 38, "usage_type": "call" }, { "api_name": "eth2.beacon.tools.builder.initializer.create_mock_genesis", "line_number": 40, "usage_type": "call" }, { "api_name": "eth2.beacon.state_machines.forks.serenity.blocks.Ser...
21224899005
import pika import psutil import time # Conecta ao RabbitMQ connection = pika.BlockingConnection(pika.ConnectionParameters('localhost')) # Conecta ao servidor RabbitMQ local channel = connection.channel() # Cria um canal de comunicação # Declara o tópico de temperatura channel.queue_declare(queue='temperat...
mandaver/Atividades_Sistemas_Dist
Atividade_2/produtor.py
produtor.py
py
915
python
pt
code
0
github-code
1
[ { "api_name": "pika.BlockingConnection", "line_number": 6, "usage_type": "call" }, { "api_name": "pika.ConnectionParameters", "line_number": 6, "usage_type": "call" }, { "api_name": "psutil.sensors_temperatures", "line_number": 14, "usage_type": "call" }, { "api_n...
900614867
import random import os import shutil from PIL import Image, ImageDraw import torch from torchvision import datasets, transforms from detectron2.utils.logger import setup_logger from detectron2.config import get_cfg from detectron2.engine import DefaultPredictor import asyncio def crop_portraits(portraits_list, film_f...
mariana200196/cartoon-face-detector
API/helper_functions.py
helper_functions.py
py
3,002
python
en
code
0
github-code
1
[ { "api_name": "PIL.ImageDraw.Draw", "line_number": 30, "usage_type": "call" }, { "api_name": "PIL.ImageDraw", "line_number": 30, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 42, "usage_type": "call" }, { "api_name": "os.path.exists", ...
23490191054
import sys from loguru import logger as log from bs4 import BeautifulSoup from pyquery import PyQuery as pq from selenium.common.exceptions import ElementClickInterceptedException from my_selenium import MySelenium from locate104 import LocateOneZeroFour # remove default level log.remove() # level DEBUG|INFO log.add...
brian-hsu/crawl104
crawl104.py
crawl104.py
py
10,812
python
en
code
0
github-code
1
[ { "api_name": "loguru.logger.remove", "line_number": 12, "usage_type": "call" }, { "api_name": "loguru.logger", "line_number": 12, "usage_type": "name" }, { "api_name": "loguru.logger.add", "line_number": 14, "usage_type": "call" }, { "api_name": "loguru.logger", ...
15760438393
#!/usr/bin/python from flask import Flask, render_template from constant import constants import random import urllib3 import json __author__ = "Daniel Fernando Santos Bustos" __license__ = "MIT" __version__ = "1.0" __maintainer__ = "Daniel Santos" __email__ = "dfsantosbu@unal.edu.co" __status__ = "Development" app=...
xdanielsb/blog-flask
app.py
app.py
py
985
python
en
code
1
github-code
1
[ { "api_name": "flask.Flask", "line_number": 16, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 23, "usage_type": "call" }, { "api_name": "constant.constants", "line_number": 30, "usage_type": "name" }, { "api_name": "urllib3.PoolManager", ...
72361760035
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @File :price.py @Description :价格表查询 @DateTime :2023-01-12 14:07 @Author :Jay Zhang """ from sqlalchemy.orm import Session from Permission.models import Permission from Tracking.models import Tracking from User.models import User, Emplo...
zxj17815/progress_tracking
User/curd.py
curd.py
py
1,082
python
en
code
0
github-code
1
[ { "api_name": "sqlalchemy.orm.Session", "line_number": 18, "usage_type": "name" }, { "api_name": "User.models.User", "line_number": 18, "usage_type": "name" }, { "api_name": "User.models.User", "line_number": 19, "usage_type": "name" }, { "api_name": "sqlalchemy.o...
17571257794
# Import Files import requests import json with open("details.txt") as f: lines = f.readlines() api_token = lines[0].rstrip() account_id = lines[1].rstrip() def get_account_info(steam_ids): """ Returns the results of a steam api get request containing a summary of one or more steam users. :pa...
Exist3/SteamLibraryCompare
steam_api_scrape.py
steam_api_scrape.py
py
3,993
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 24, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 39, "usage_type": "call" }, { "api_name": "json.loads", "line_number": ...
13282499257
from __future__ import division import numpy as np import ROOT as r import math import os,sys from scipy.integrate import quad, dblquad from darkphoton import * # proton mass mProton = 0.938272081 # GeV/c - PDG2016 protonEnergy = 400. # GeV/c protonMomentum = math.sqrt(protonEnergy*protonEnergy - mProton*mProton) #V...
ShipSoft/FairShip
python/proton_bremsstrahlung.py
proton_bremsstrahlung.py
py
7,527
python
en
code
21
github-code
1
[ { "api_name": "math.sqrt", "line_number": 13, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 36, "usage_type": "call" }, { "api_name": "math.pow", "line_number": 42, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 48, "...
26855426781
# This program is in the public domain # Author: Paul Kienzle """ SNS data loaders The following instruments are defined:: Liquids, Magnetic These are :class:`resolution.Pulsed` classes tuned with default instrument parameters and loaders for reduced SNS data. See :mod:`resolution` for details. """ import re im...
reflectometry/refl1d
refl1d/snsdata.py
snsdata.py
py
9,380
python
en
code
16
github-code
1
[ { "api_name": "numpy.array", "line_number": 28, "usage_type": "call" }, { "api_name": "instrument.Pulsed", "line_number": 55, "usage_type": "call" }, { "api_name": "probe.title", "line_number": 66, "usage_type": "attribute" }, { "api_name": "probe.date", "line...
6164148530
import numpy as np from string import punctuation from random import shuffle from gensim.test.utils import get_tmpfile import gensim import pandas as pd from gensim.models.word2vec import Word2Vec from gensim.models import KeyedVectors import time from nltk.tokenize import TweetTokenizer def load1_6million(path, toke...
masdeval/NLP
FinalProject/Word2Vec_Twitter.py
Word2Vec_Twitter.py
py
3,101
python
en
code
0
github-code
1
[ { "api_name": "gensim.utils", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.inf", "line_number": 13, "usage_type": "attribute" }, { "api_name": "gensim.models.KeyedVectors.load", "line_number": 48, "usage_type": "call" }, { "api_name": "gens...
74533048992
import numpy as np from skimage import measure from sklearn.metrics import auc def run(score_imgs, labeled_imgs, fpr_thresh=0.3, max_steps=2000, class_name=None): labeled_imgs = np.array(labeled_imgs) labeled_imgs[labeled_imgs <= 0.45] = 0 labeled_imgs[labeled_imgs > 0.45] = 1 labeled_imgs = la...
wogur110/PNI_Anomaly_Detection
refinement/get_aupro.py
get_aupro.py
py
3,461
python
en
code
10
github-code
1
[ { "api_name": "numpy.array", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.bool", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "line_nu...
43336500122
import sys import os from PyQt5 import QtWidgets, uic, QtCore import pyqtgraph as pg import numpy as np from ..communication import SCPI_mannager, upload import json class graph_view(pg.GraphicsLayoutWidget): def __init__(self, top_window): super().__init__(show=True) self.top_window :...
ruofan-he/redpitaya_PNR
frontend/top/top.py
top.py
py
19,736
python
en
code
1
github-code
1
[ { "api_name": "pyqtgraph.GraphicsLayoutWidget", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.histogram", "line_number": 18, "usage_type": "call" }, { "api_name": "pyqtgraph.PlotDataItem", "line_number": 19, "usage_type": "attribute" }, { "a...
21877280591
import os import sys sys.path.append("../..") import time import math from z3 import * import argparse from multiprocessing import Process from multiprocessing.spawn import freeze_support from common.utils import show_output, read_instance, write_output, COLORS def write_report(instance_name, sol, report_file): ...
mwritescode/VLSI
SMT/src/iterative_solve_smt.py
iterative_solve_smt.py
py
6,936
python
en
code
1
github-code
1
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.path.isfile", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number...
15486771413
import re import requests from bs4 import BeautifulSoup def baidu_search(word: str) -> str: """ 百度百科检索问题 :param word: 需要查询的问题 :return: 百度百科查询结果 """ headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/53...
shangruobing/infoweaver-backend
NFQA/QAS/utils/baidu_search.py
baidu_search.py
py
829
python
en
code
2
github-code
1
[ { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 19, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 23, "usage_type": "call" } ]
32166503776
#!/usr/bin/env python3 import asyncio import sys from getpass import getpass from pathlib import Path from typing import Dict import httpx import hug IGNORED_AUTHOR_LOGINS = {"deepsource-autofix[bot]"} REPO = "pycqa/isort" GITHUB_API_CONTRIBUTORS = f"https://api.github.com/repos/{REPO}/contributors" GITHUB_USER_CONT...
PyCQA/isort
scripts/check_acknowledgments.py
check_acknowledgments.py
py
2,528
python
en
code
6,145
github-code
1
[ { "api_name": "pathlib.Path", "line_number": 20, "usage_type": "call" }, { "api_name": "typing.Dict", "line_number": 24, "usage_type": "name" }, { "api_name": "getpass.getpass", "line_number": 37, "usage_type": "call" }, { "api_name": "httpx.AsyncClient", "lin...
36079132985
import argparse import os from collector.github_repo_collector import GithubRepositoryCollector from const.constants import GITHUB_ACCESS_TOKEN def parse_args() -> argparse.Namespace: """ Parse arguments. :return: a namespace with the arguments """ parser = argparse.ArgumentParser(description='Ge...
JulianBenitez99/ECI-MS-Thesis
GoCSVRepo/main.py
main.py
py
732
python
en
code
0
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "argparse.Namespace", "line_number": 8, "usage_type": "attribute" }, { "api_name": "const.constants.GITHUB_ACCESS_TOKEN", "line_number": 19, "usage_type": "name" }, { ...
29972846358
#import the spaCy library import spacy # Load the spaCy model for NER(this is the sm version so faster but less accurate) nlp = spacy.load("en_core_web_sm") # Define a function to anonymize personal information def anonymize_text(text): # Use spaCy NER to process the input text doc = nlp(text) # Create ...
Sai9555/anonymize_data
src/TxtSpaCyV1.0.py
TxtSpaCyV1.0.py
py
1,954
python
en
code
0
github-code
1
[ { "api_name": "spacy.load", "line_number": 5, "usage_type": "call" } ]
27528671913
#!/usr/bin/python3 import argparse import cv2 import numpy as np def onTrackbar(threshold): print("Selected threshold " + str(threshold) + " for limit") def main(): # parse the argument parser = argparse.ArgumentParser() parser.add_argument('-i', '--image', type=str, required=True, help='Full path ...
JorgeFernandes-Git/PSR_AULAS_2021
openCV/Ex3_MOUSE_TRACKBAR/main4.py
main4.py
py
3,084
python
en
code
0
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.IMREAD_COLOR", "line_number": 19, "usage_type": "attribute" }, { "api_name": "cv2.imshow",...
37106040488
from astropy.io import fits import pandas as pd import numpy as np import time import traceback import os flux1350=[] flux3000=[] df=pd.read_csv('/media/richard/Backup Plus/candidate_dr16_0.8_final.csv',low_memory=False) groupid=df['GroupID_1'] specname=df['specname_new'] z=df['Z'] area_1350=df['LINEAREA_1350'] area_30...
RichardPeng0624/SDSSspectrum-painting
linearea.py
linearea.py
py
2,118
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "astropy.io.fits.open", ...
72601518114
import requests import json import time from string import ascii_letters,digits import random from base64 import b64encode from hashlib import sha256 from os import urandom def request_verify_code(phone_number): random.seed(urandom(8)) h=sha256() code_verifier=''.join([ random.choice(ascii_letters+di...
chenliTW/goshare-reserve
src/utils.py
utils.py
py
3,273
python
en
code
0
github-code
1
[ { "api_name": "random.seed", "line_number": 12, "usage_type": "call" }, { "api_name": "os.urandom", "line_number": 12, "usage_type": "call" }, { "api_name": "hashlib.sha256", "line_number": 14, "usage_type": "call" }, { "api_name": "random.choice", "line_numbe...
18995343621
# Factor Analysis import matplotlib.pyplot as plt def Factor_EM(Input_data,K_sub=3): trans=Input_data (N,D)=trans.shape #Initialize u=np.mean(trans,axis=0) Input_data=FTI sigma_full=np.cov(FTI.transpose()) [U_matrix,D_matrix,V_matrix]=np.linalg.svd(sigma_full) eta_start=...
saikrishnawds/Generative-Face-Image-Classification
model4_Factor_analysis.py
model4_Factor_analysis.py
py
5,914
python
en
code
0
github-code
1
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 111, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 111, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.show", "line_number": 112, "usage_type": "call" }, { "api_name": "ma...
71165257954
import cv2 import librosa import numpy as np import random from sklearn.preprocessing import LabelEncoder, StandardScaler, MinMaxScaler, scale def scale_feature(feature, featureSize): widthTarget, heightTarget = featureSize height, width = feature.shape # scale according to factor newSize = (int...
ksraj/CoughVid
helper/preprocessor.py
preprocessor.py
py
3,017
python
en
code
1
github-code
1
[ { "api_name": "cv2.resize", "line_number": 18, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.pad", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.trans...
71276798435
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import base64 import requests from contextlib import closing from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests im...
ColtAllen/codex_vitae_app
codex_vitae/etl/api_requests.py
api_requests.py
py
4,294
python
en
code
0
github-code
1
[ { "api_name": "os.path.exists", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path", "line_number": 35, "usage_type": "attribute" }, { "api_name": "google.oauth2.credentials.Credentials.from_authorized_user_file", "line_number": 36, "usage_type": "call" }...
73085692514
import numpy as np import pygame class GridEnvironment: def __init__(self): self.grid = np.zeros((7,7)) self.starting_position = [0,0] self.goal_position = [5,4] self.reset() self.walls = [[3, 2], [2, 3], [1, 4]] #actions are up, down, left, right mapped to 0, 1, 2...
Jakub202/IDATT2502-ML
excercise8/gridworld/GridEnvironment.py
GridEnvironment.py
py
5,224
python
en
code
0
github-code
1
[ { "api_name": "numpy.zeros", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.init", "line_number": 88, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 94, "usage_type": "call" }, { "api_name": "pygame.display", "...
33565357577
import networkx as nx import numpy as np from scipy import random import pandas as pd import copy import random from collections import OrderedDict, Counter from multiprocessing import Pool import itertools import matplotlib.pyplot as plt #%matplotlib inline def generate_my_simplicial_complex_d2(N,p1,p...
kittan13/school_lab
simplagion-master/Generalized degree distribution of the Random Simplicial Complex model.py
Generalized degree distribution of the Random Simplicial Complex model.py
py
5,339
python
en
code
0
github-code
1
[ { "api_name": "networkx.fast_gnp_random_graph", "line_number": 20, "usage_type": "call" }, { "api_name": "networkx.is_connected", "line_number": 22, "usage_type": "call" }, { "api_name": "networkx.connected_components", "line_number": 23, "usage_type": "call" }, { ...
20918803999
# -*- coding: utf-8 -*- import os import sys import time import pickle import requests import pandas as pd from tqdm import tqdm from urllib import response from bs4 import BeautifulSoup class Scraper: def __init__(self): self.base_url = "https://scholar.google.com/" dir_persistent = os.path.joi...
andreeaiana/graph_confrec
src/data/H5IndexScraper.py
H5IndexScraper.py
py
7,691
python
en
code
8
github-code
1
[ { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
28776224145
import sys from collections import deque input = sys.stdin.readline def bfs(i, j): visited[i][j] = 1 union = [(i, j)] _sum = graph[i][j] q.append((i, j)) while q: x, y = q.popleft() for dx, dy in [(0, 1), (0, -1), (1, 0), (-1, 0)]: nx = x + dx ny = y + dy ...
jiyoon127/algorithm_study
Implementation/인구_이동.py
인구_이동.py
py
1,264
python
en
code
0
github-code
1
[ { "api_name": "sys.stdin", "line_number": 3, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 33, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 34, "usage_type": "call" } ]
73793723235
# Create a Scraper that extracts information about job descriptions # 1. Open up website # 2. Parse the HTML and gather content objects from the indeed page # - list of Job Titles # - list of Job Descriptions from selenium import webdriver from selenium.webdriver.chrome.service import Service from selenium.webd...
nitink23/Sachacks2023nava
job_scraper/indeed_scraper.py
indeed_scraper.py
py
2,542
python
en
code
0
github-code
1
[ { "api_name": "json.load", "line_number": 15, "usage_type": "call" }, { "api_name": "selenium.webdriver.chrome.service.Service", "line_number": 19, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 20, "usage_type": "call" }, { "api...
28849219985
import pickle import streamlit as st import pandas as pd import numpy as np import seaborn as sns from scipy import stats from datetime import datetime from sklearn import preprocessing from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_absolute_error, mean_squared_error, r2_score, confu...
sing829/yolov5_streamlit_updated
separate_py/show_ml2.py
show_ml2.py
py
10,796
python
en
code
0
github-code
1
[ { "api_name": "pandas.DataFrame", "line_number": 24, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 29, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 30, "usage_type": "call"...
3982305761
#!/usr/bin/env python # import google.appengine.api.users from google.appengine.ext import blobstore from google.appengine.ext import db from google.appengine.api import images from google.appengine.ext.webapp import blobstore_handlers import logging import jinja2 import webapp2 import json import os import re ipadReg...
bruntonspall/visual-schedule
main.py
main.py
py
7,684
python
en
code
0
github-code
1
[ { "api_name": "re.compile", "line_number": 15, "usage_type": "call" }, { "api_name": "jinja2.Environment", "line_number": 17, "usage_type": "call" }, { "api_name": "jinja2.FileSystemLoader", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.join", ...
21217490923
import json import tornado.httpserver import tornado.ioloop import tornado.web import tornado.websocket import tornado.options import os.path from tornado.options import define, options define("port", default=8000, help="run on the given port", type=int) class Message: #消息 sender="" text="" roomID="" time="" d...
Drenight/2019ComprehensiveProject
exp2/cookies.py
cookies.py
py
4,273
python
en
code
4
github-code
1
[ { "api_name": "tornado.options.define", "line_number": 10, "usage_type": "call" }, { "api_name": "tornado.httpserver.web", "line_number": 27, "usage_type": "attribute" }, { "api_name": "tornado.httpserver", "line_number": 27, "usage_type": "name" }, { "api_name": ...
22589006256
import pygame, sys from pygame.locals import * import random pygame.init windowSurface = pygame.display.set_mode((800, 600), 0, 32) pygame.display.set_caption('game') brown=(190,128,0) black=(0,0,0) green=(0,128,0) blue=(0,0,255) white=(255,255,255) red=(255,0,0) xtree1=[200,250,100,225,350] ytree=[200,50,350] x1=...
micah-kitzler/first-pygame-game
game.py
game.py
py
9,217
python
en
code
1
github-code
1
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pygame.display.set_mode", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pygame.disp...
28768775449
from rest_framework import generics, viewsets from .models import approvals from .serializer import approvalsSerializers from sklearn.externals import joblib import pandas as pd from .form import ApprovalsForm from django.shortcuts import render from keras import backend as K from django.contrib import messages # Cre...
xolanisiqhelo/djangoAPI
api/views.py
views.py
py
3,125
python
en
code
0
github-code
1
[ { "api_name": "rest_framework.generics.ListCreateAPIView", "line_number": 14, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 14, "usage_type": "name" }, { "api_name": "models.approvals.objects.all", "line_number": 15, "usage_type": "c...
7937095341
from django.urls import path from app.views import SignUpView, ProductListView, ProductCreateView, ProductApprove, ProductUpdateView, ApproveView, \ RedirectView urlpatterns = [ path('', RedirectView.as_view()), path('signup', SignUpView.as_view(), name='signup'), path('products', ProductListView.as_vi...
ToshipSo/PinkBlue
app/urls.py
urls.py
py
669
python
en
code
0
github-code
1
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "app.views.RedirectView.as_view", "line_number": 6, "usage_type": "call" }, { "api_name": "app.views.RedirectView", "line_number": 6, "usage_type": "name" }, { "api_name": "d...
1967729697
from copyreg import constructor import csv import sys from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.by import By if (len(sys.argv) < 1): raise Exception('Argument Missing: run with "blockc...
0x14os/well-known-parser
parser.py
parser.py
py
2,246
python
en
code
null
github-code
1
[ { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number"...
28994089757
# a great deal of code modified and copied from: # https://github.com/OpenBounds/Processing import sys import os import logging import subprocess import tempfile import glob import click from pyproj import Proj, transform import fiona from fiona.crs import from_epsg, to_string from fiona.transform imp...
cat-cfs/gcbm_preprocessing
preprocess_tools/gcbm_aws/util.py
util.py
py
7,193
python
en
code
0
github-code
1
[ { "api_name": "sys.stdout.isatty", "line_number": 23, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 23, "usage_type": "attribute" }, { "api_name": "click.echo", "line_number": 24, "usage_type": "call" }, { "api_name": "logging.info", "line...
25295807822
from selenium import webdriver from selenium.webdriver.chrome.service import Service from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.common.exceptions import NoSuchElementException from webdriver_manager.chrome import ChromeDriverManager import time impor...
manishhemnani06/LINKEDIN_JOB_ANALYSIS_
SCRAPPING_CODE/SCRAPPING_MAIN_FILE.py
SCRAPPING_MAIN_FILE.py
py
8,400
python
en
code
1
github-code
1
[ { "api_name": "selenium.webdriver.chrome.service.Service", "line_number": 17, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 18, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 18, "usage_type": "name" }, {...
13365106466
import numpy as np import tensorflow as tf from PIL import Image def get_data(img_file, labels_file, image_size): """ Given a file path and two target classes, returns an array of normalized inputs (images) and an array of labels. Extract only the data that matches the corresponding classes (there are 101 class...
meera-kurup/skimage
code/preprocess.py
preprocess.py
py
2,139
python
en
code
0
github-code
1
[ { "api_name": "numpy.load", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 20, "usage_type": "call" }, { "api_name": "PIL.Image.fromarray", "line_number": 22, "usage_type": "call" }, { "api_name": "PIL.Image", "line_numbe...
75090764834
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', # Examples: url(r'^$', 'webapp.views.index', name='index'), url(r'^province/(\w+)/$',...
RHoK-Bilbao/desahucios
website/website/urls.py
urls.py
py
1,492
python
en
code
7
github-code
1
[ { "api_name": "django.conf.urls.patterns", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "dja...
28159584514
import json import requests from datetime import date, datetime from mysql.connector import (connection) from elasticsearch import Elasticsearch from elasticsearch.helpers import bulk from pprint import pprint import os.path import pandas as pd import time ''' Module to make queries easier via python elasticsearch a...
belaz/elasticpoc
python/search-by-querypost.py
search-by-querypost.py
py
6,362
python
en
code
0
github-code
1
[ { "api_name": "pprint.pprint", "line_number": 118, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number": 120, "usage_type": "call" }, { "api_name": "os.path.path.isfile", "line_number": 128, "usage_type": "call" }, { "api_name": "os.path.path", ...
19741466326
# -*- coding: utf-8 -*- """ Spyder Editor This is a cointegration script file. """ import numpy as np import pandas as pd import tushare as ts import matplotlib.pyplot as plt import statsmodels.api as sm def find_cointegration_pairs(dataframe): # to obtain the length of dataframe n = dataframe.shape[1] ...
simple321vip/violin-trade
strategy/cointegration_2.py
cointegration_2.py
py
1,464
python
en
code
1
github-code
1
[ { "api_name": "numpy.ones", "line_number": 19, "usage_type": "call" }, { "api_name": "statsmodels.api.tsa.stattools.coint", "line_number": 28, "usage_type": "call" }, { "api_name": "statsmodels.api.tsa", "line_number": 28, "usage_type": "attribute" }, { "api_name"...
34977561674
import numpy as np import cv2 img = cv2.imread('/Users/huojiaxi/Desktop/googlelogo_color_272x92dp.png') vert = [70, 110, 40] # RGB de la couleur végétale, il est nécessaire de la régler lors que la première figure sera générée diff_rouge = 60 diff_vert = 40 diff_bleu = 30 boundaries = [([vert[2]-diff_bleu, vert[1...
HUOJIAXI/PROJETDRONE1920
TraitementDImage/image.py
image.py
py
853
python
fr
code
2
github-code
1
[ { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number...
9362838462
#coding:utf-8 """ Description: separate speech from mixed signal of music and speech Date: 2018.6.3 Reference: const.py, DoExperiment.py and util.py by wuyiming in UNet-VocalSeparation-Chainer <https://github.com/Xiao-Ming/UNet-VocalSeparation-Chainer> """ import argparse import ...
shun60s/Blind-Speech-Separation
separate.py
separate.py
py
4,185
python
ja
code
3
github-code
1
[ { "api_name": "os.path.isdir", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_number": 34, "usage_type": "attribute" }, { "api_name": "librosa.util.find_files", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path.splitext",...
9708255908
from app import app from flask import request, render_template, jsonify, session import re from app.modules.text_translator_ch2en import translator_ch2en from app.modules.text_translator_en2ch import translator_en2ch from app.modules.summa_TextRank import TextRank_Summarizer_en from app.modules.snownlp_TextRank import...
ChingHung21/Bilingual-Lesson-Assistant
app/views.py
views.py
py
9,410
python
en
code
0
github-code
1
[ { "api_name": "flask.render_template", "line_number": 18, "usage_type": "call" }, { "api_name": "app.app.route", "line_number": 16, "usage_type": "call" }, { "api_name": "app.app", "line_number": 16, "usage_type": "name" }, { "api_name": "flask.render_template", ...
687494140
import streamlit as st import pandas as pd import numpy as np #import seaborn as sns #import matplotlib.pyplot as plt import plotly.express as px from PIL import Image # Page layout st.set_page_config(page_title='Churn Analysis FinTech', page_icon=':bar_chart:', layout='wide') df = pd.read_csv('fintech_das...
Asifmehdiyev/dashboard_app
dashboard.py
dashboard.py
py
11,067
python
en
code
0
github-code
1
[ { "api_name": "streamlit.set_page_config", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "streamlit.markdown", "line_number": 33, "usage_type": "call" }, { "api_name": "streamli...