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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10377141821 | # -*- coding: utf-8 -*-
"""
Created on Sun Oct 22 23:14:44 2017
@author: Administrator
"""
from LSTM import MYLSTM
from nltk import word_tokenize
from nltk.corpus import stopwords
from sklearn.ensemble import RandomForestClassifier
from sklearn import preprocessing
from sklearn.svm import SVC
import lightgbm as lg... | 2043078895/graduate_english_word_predict | predict_lstm.py | predict_lstm.py | py | 15,837 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "nltk.word_tokenize",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "nltk.sent_tokenize",
... |
19458953043 | import pymongo
import json
from pymongo import MongoClient
from bson.objectid import ObjectId
import pprint
from cjio.cityjson import CityJSON
import sys
import os
libdir = os.path.dirname(__file__)
root_folder= str(os.path.split(libdir)[0])
sys.path.append(root_folder)
from algorithms.replace_transform import from_... | kjstaring/scripts | MongoDB/extract_MongoDB.py | extract_MongoDB.py | py | 2,469 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.split",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
27330283085 | '''
Some utilities about network
'''
import random
import os
import math
import copy
from collections import Counter
import numpy as np
import networkx as nx
from multiprocessing import cpu_count
from concurrent.futures import ProcessPoolExecutor
from queue import PriorityQueue as pQueue
_graph = None
def generate_... | realcatking/GANRL | NetworkUtilities.py | NetworkUtilities.py | py | 10,693 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "copy.deepcopy",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "multiprocessing.cpu_count",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"... |
29187026002 | """
Ref: https://github.com/sxyu/pixel-nerf/blob/master/render/nerf.py
NeRF differentiable renderer.
References:
https://github.com/bmild/nerf
https://github.com/kwea123/nerf_pl
Nerf: https://www.matthewtancik.com/nerf
Given: image, camera, MLP model
Nerf rendering:
1. camera => rays (origins, directions, near, far)
... | yfeng95/DELTA | lib/utils/renderer.py | renderer.py | py | 21,684 | python | en | code | 175 | github-code | 6 | [
{
"api_name": "torch.ones_like",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "torch.autograd.grad",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "torch.autograd",
... |
42018057111 | import json
from model_mommy import mommy
from collab_app.models import (
User
)
from tests.mixins import BaseApiSetUp
class UserPermissionTestCase(BaseApiSetUp):
def setUp(self):
super(UserPermissionTestCase, self).setUp()
# create extra user
self.u2 = mommy.make(User)
def te... | CollabSauce/collab-backend | tests/permissions/test_user.py | test_user.py | py | 3,154 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tests.mixins.BaseApiSetUp",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "model_mommy.mommy.make",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "collab_app.models.User",
"line_number": 17,
"usage_type": "argument"
},
{
"api_n... |
39386376196 | from django.test import TestCase
from rest_framework.test import APIClient
# Create your tests here.
class EndpointTests(TestCase):
def test_predict_view(self):
client = APIClient()
input_data = {
"Destination_Port": 80.0,
"Flow_Duration": 3.0,
"Total_Fwd_Packets": 2.0,
"Total_Backw... | Markorito/DETECTING-DDOS-ATTACKS-USING-MACHINE-LEARNING | backend/server/apps/endpoints/tests.py | tests.py | py | 2,752 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "django.test.TestCase",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "rest_framework.test.APIClient",
"line_number": 8,
"usage_type": "call"
}
] |
5142966830 | import logging
import sys
import os
from typing import List
from core.logging import InterceptHandler
from loguru import logger
from starlette.config import Config
from starlette.datastructures import CommaSeparatedStrings, Secret
config = Config(".env")
API_PREFIX = "/api"
VERSION = "0.1.0"
DEBUG: bool = config("... | nunenuh/reader_service | app/core/config.py | config.py | py | 1,646 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "starlette.config.Config",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "starlette.datastructures.Secret",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "logging.DEBUG",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_na... |
28266879220 | #Display message
print ("Importing Libraries...")
#Import libraries
import sys
import string
import nltk
nltk.download('stopwords')
from nltk.corpus import stopwords
import pandas as pd
#Import libraries for performing NLP
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.te... | amaaniqbal/sms-spam-detection | main.py | main.py | py | 3,087 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "nltk.download",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "string.punctuation",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "nltk.corpus.stop... |
25982135791 | #!/usr/bin/env python3
from bs4 import BeautifulSoup
import csv
from datetime import date
import os
import re
import sys
from typing import Any, Dict
import psycopg2
import requests
# Config
RADIUS = 350
XCONTEST_USER = os.environ.get('XCONTEST_USER', 'dbrgn')
XCONTEST_PASS = os.environ.get('XCONTEST_PASS')
assert... | Hasi123/hnf-peaks | 2-query-xcontest.py | 2-query-xcontest.py | py | 3,636 | python | en | code | null | github-code | 6 | [
{
"api_name": "os.environ.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_... |
4109646371 | from discord.ext import commands
import discord, pymysql, config, requests
from io import BytesIO
from .utils import checks
from PIL import Image, ImageFont, ImageDraw
connection = pymysql.connect(user='root',
password=config.dbpass,
host='localhost',
... | cambobot-kh/NekoBotRewrite | modules/imgwelcome.py | imgwelcome.py | py | 7,807 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pymysql.connect",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "config.dbpass",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "discord.Embed",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.c... |
23800685741 | import subprocess
import optparse
from termcolor import colored
def change_mac(interface,new_mac):
print(colored("[$] Changing MAC for interface "+ interface + " to "+ new_mac,'yellow'))
before_change=subprocess.check_output(['ifconfig',interface])
subprocess.call(["ifconfig",interface ,"down"])
subpro... | prajwalcbk/tools | macchanger/mac.py | mac.py | py | 1,233 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "termcolor.colored",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "subprocess.check_output",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "subprocess.call",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "subprocess.cal... |
24992388021 | from osv import osv, fields, orm
from tools.translate import _
from datetime import datetime
_MIN_DATETIME='1970-01-01 00:00:00'
_MAX_DATETIME='2099-12-31 23:59:59'
_ADMIN_USER=1
class contact_type_annotation(osv.osv):
_name = 'contact.type_annotation'
contact_type_annotation()
class contact_annotation_ty... | factorlibre/openerp-extra-6.1 | contact_annotation/contact_annotation.py | contact_annotation.py | py | 13,960 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "osv.osv.osv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "osv.osv",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "osv.osv.osv",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "osv.osv",
"line_number": ... |
40117980992 | import io
import time
from PIL import Image
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait, Select
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import... | forkerLinux/zhilian_spider | process/zhilian.py | zhilian.py | py | 4,334 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "PIL.Imag... |
70634677949 | import os
import requests
#現在のバージョン取得
vercheck = "http://mnbqjp-version.witchs-weapon.com:9091/getversion"
html = requests.get(vercheck)
version = html.text
print(version)
#assetlistを取得しに行く
url = "http://cdnjp-android-release.witchs-weapon.com/m.assets_list_" + version + ".txt"
#ダウンロード処理
response = re... | cynagenautes/AssetDownloader | source/Versionchecker.py | Versionchecker.py | py | 547 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
}
] |
71461766908 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2021/10/8 19:49
# @Author : SuenDanny
# @Site :
# @File : model.py
# @Software: PyCharm
import torch
import torchvision
# 准备训练数据集
from torch import nn
from torch.nn import Flatten
from torch.utils.data import DataLoader
# 搭建神经网络
class Tudui(nn... | StLordWilliam/LearnPytorchFromBilibili | model.py | model.py | py | 1,241 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
73993766909 | import contextlib
import tarfile
from io import BytesIO
import requests
from .utils import *
def test_repo_list():
with serve():
response = requests.get(UNAUTH_TEST_SERVER).text
assert TEST_REPO_BASE_URL in response
assert TEST_REPO_DONT_RENDER_BASE_URL in response
assert TEST_RE... | jonashaag/klaus | tests/test_views.py | test_views.py | py | 2,908 | python | en | code | 659 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_numbe... |
38753252415 | #!/usr/bin/env python3
'''
To use this script load appropriate python and ncl modules, edit top of MAPL_Tripolar.cdl file,
then run it as:
./mkMAPLTripolar.py MAPL_Tripolar.cdl
'''
import os, sys
import numpy as np
import netCDF4 as nc
mapl_file='MAPL_Tripolar.nc'
cdl_file=sys.argv[1]
os.system(f'ncgen -o {mapl_f... | GEOS-ESM/GEOS_OceanGridComp | MOM6_GEOSPlug/mom6_app/mkMAPLTripolar/mkMAPLTripolar.py | mkMAPLTripolar.py | py | 2,654 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.system",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "netCDF4.Dataset",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "netCDF4.Dataset",
"line_n... |
72757306749 | from syscore.objects import arg_not_supplied, existingData
from sysdata.mongodb.mongo_connection import mongoDb
from sysdata.mongodb.mongo_generic import mongoDataWithSingleKey, MONGO_ID_KEY
from syscore.dateutils import long_to_datetime, datetime_to_long
from syslogdiag.log_to_screen import logtoscreen
from syslogdia... | ahalsall/pysystrade | sysdata/mongodb/mongo_log.py | mongo_log.py | py | 6,110 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "syslogdiag.database_log.logToDb",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "sysdata.mongodb.mongo_connection.mongoDb",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "syscore.objects.arg_not_supplied",
"line_number": 33,
"usage_typ... |
37340655473 | from colorama import Fore
import english_words
import time
# Does the jobs with the inputs
class Input:
@staticmethod
def quit_ani():
print()
# In a for loop uses time library for waiting process while printing
time.sleep(0.5)
print(Fore.RED + " ADIO", end="")... | mburaozkan/LeWord-The-Word-Game | input.py | input.py | py | 4,117 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "time.sleep",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "colorama.Fore.RED",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "colorama.Fore",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"lin... |
33529011557 | import pdb
import numpy as np
import torch
import torch.nn.functional as F
def filter_predictions(logits):
batch_size = logits.shape[0]
prob = F.softmax(logits, dim=-1)
max_prob, pseudo_label = torch.max(prob, dim=-1)
batch_entry_idx = torch.where(max_prob > 0.8)[0]
return pseudo_label, batch_en... | huiminzeng/ASONAM22_COVID_Contrastive_Adversarial_Domain_Mixup | core.py | core.py | py | 5,329 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.functional.softmax",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.max",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.where",... |
35089703759 | from django import forms
from reservation.models import Reservation
from liste.models import Cadeau
from django.urls import reverse
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, Submit, Field, Button, Row, Column
from crispy_forms.bootstrap import PrependedAppendedText, Pr... | benoitMarie09/liste-naissance-bootstrap | src/reservation/forms.py | forms.py | py | 2,796 | python | fr | code | 0 | github-code | 6 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "reservation.models.Reservation",
"line_number": 13,
"usage_type": "name"
},
{
"api_name"... |
18804586397 | import json
import logging
from threading import Lock
import numpy as np
from pymilvus.client.types import DataType
from pymilvus.exceptions import MilvusException
from pymilvus.orm.schema import CollectionSchema
from .buffer import (
Buffer,
)
from .constants import (
TYPE_SIZE,
TYPE_VALIDATOR,
Bulk... | milvus-io/pymilvus | pymilvus/bulk_writer/bulk_writer.py | bulk_writer.py | py | 5,046 | python | en | code | 744 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "pymilvus.orm.schema.CollectionSchema",
"line_number": 27,
"usage_type": "name"
},
{
"api_nam... |
34106046191 | from builtins import range
import cv2 as cv
img = cv.imread('img.jpg')
img = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
m = [[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]]
#pega o numero de linhas e colunas
qtdLinhas = len(img)
qtdColunas = len(img[0])
print(qtdLinhas,qtdColunas)
#percorre toda a imagem
for l in range(qtdLinhas):
... | gabrielga-dev/visao-computacional-2022 | s8/atividades/atividade_2/atividade_2.py | atividade_2.py | py | 869 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "builtins.range",
"li... |
36437420771 | from django.db import models
# Create your models here.
class Question(models.Model):
question_id = models.CharField(max_length = 10)
question_text = models.CharField(max_length = 200)
question_detail = models.CharField(max_length = 200)
has_info_box = models.BooleanField(default = True)
QUESTION_... | wpmccarthy/django-test | engagementSurvey/modelsOriginal.py | modelsOriginal.py | py | 2,361 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.models.Model",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "... |
27520783573 | import datetime
def matrix_linear_interp(dates, values, nvalues=3):
""" Function that uses linear interpolation of matrices """
# dates_out and values_out will be the values that entered
# with the interpolated values between they
dates_out = []
values_out = []
for i in range(1, len(dates))... | RevertonLuis/Ensemble | lib/temp_linear_interp.py | temp_linear_interp.py | py | 2,627 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "datetime.timedelta",
"line_number": 29,
"usage_type": "call"
}
] |
28413427841 | import codecs
import json
objects = []
def read_json():
try:
data_json = codecs.open('insta_geo_new.json', 'r', 'utf-8')
except Exception as e:
print(u'Error has occurred')
print('Error: ', e)
else:
with data_json:
d = json.load(data_json)
for item ... | 01ghost13/geo_places | visualization.py | visualization.py | py | 682 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "codecs.open",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 15,
"usage_type": "call"
}
] |
43627276934 | from typing import List
class Solution:
# Careful about difference == 0 scenario
def longestSubsequence(self, arr: List[int], difference: int) -> int:
hashmap = {}
counter = {}
res = 1
for i, num in enumerate(arr):
hashmap[num] = 1
counter[num] = counter... | MichaelTQ/LeetcodePythonProject | solutions/leetcode_1201_1250/LeetCode1218_LongestArithmeticSubsequenceOfGivenDifference.py | LeetCode1218_LongestArithmeticSubsequenceOfGivenDifference.py | py | 1,028 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
}
] |
30446196285 | import logging
# CRITICAL
# ERROR
# WARNING
# INFO
# DEBUG
logging.basicConfig(level=logging.DEBUG,
filename='log.log',
format='%(levelname)s : %(asctime)s : %(message)s')
nota = 10
if nota < 5:
logging.critical('Reprovado')
elif nota >= 5:
logging.in... | pdropaullo/aulas_html_css | 4ª Fase/Python/teste.py | teste.py | py | 334 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.critical",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.info",
... |
30192327419 | # -*- coding: utf-8 -*-
"""
Created on Sun Oct 7 05:06:40 2018
@author: WinJX
"""
import lr_method
from sklearn.datasets import load_iris
import numpy as np
from sklearn import model_selection
'''
导入数据,其中X(共有三类及四个属性,选取前两类及前两个属性)为数据集,y为所对应标记(0 or 1)
'''
data_need = load_iris() #获取原始数据 ... | TJPU-ML/Homework-for-the-fall-semester-of-2018 | iris classification/温吉祥/lr_test.py | lr_test.py | py | 1,876 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.shape",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.c_",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "numpy.ones",
... |
1609565756 | from AvpAudioTools import AvpAudioTools
import argparse
import warnings
import sys
import os
from datetime import datetime
wav_folder = 'G:\\AVP\\Extract\\prm001'
data_folder = 'G:\\AVP\\Extract\\prm001p.mbp.mbd'
output_folder = 'G:\\AVP\\songdata'
weights_file = 'G:\\repos\\AvP_Song_Annotations\\AvP_Song_Annotations\... | KinaUna/AvP_Song_Annotations | FlyAnnotations/AvpSongPulseAnnotations.py | AvpSongPulseAnnotations.py | py | 4,068 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sys.stdout.flush",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 81,
"usage_type": "attribute"
},
{
"api_name": "AvpAudioTool... |
17639832467 | import streamlit as st
from dotenv import load_dotenv
from PyPDF2 import PdfReader
from langchain.text_splitter import CharacterTextSplitter
from langchain.embeddings import OpenAIEmbeddings, HuggingFaceInstructEmbeddings
from langchain.vectorstores import FAISS
def get_pdf_texts(pdf_docs):
text = ""
for pdf ... | ahmadsajid1989/chat-pdf | app.py | app.py | py | 1,736 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PyPDF2.PdfReader",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "langchain.text_splitter.CharacterTextSplitter",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "langchain.embeddings.HuggingFaceInstructEmbeddings",
"line_number": 26,
"u... |
11736006148 | import pytest
from flask_login import login_user
from rhinventory.app import create_app
from rhinventory.extensions import db
from rhinventory.db import User, Organization
from rhinventory.models.asset import Asset, AssetCategory
class TestAppConfig:
TESTING = True
DATABASE_URL = "sqlite:///:memory:"
GIT... | retroherna/rhinventory | tests/test_rhinventory.py | test_rhinventory.py | py | 2,459 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "rhinventory.app.create_app",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "rhinventory.extensions.db.create_all",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "rhinventory.extensions.db",
"line_number": 24,
"usage_type": "name"
},
... |
26246807696 | import logging
import os
from typing import Any, Dict, List
import torch
from probing_project.utils import dist_matrix_to_edges
from .word_pair_reporter import WordPairReporter
logger = logging.getLogger(__name__)
class VisualWordPairReporter(WordPairReporter):
"""Reporting class for single-word (depth) tasks ... | VSJMilewski/multimodal-probes | probing_project/reporters/visual_word_pair_reporter.py | visual_word_pair_reporter.py | py | 3,056 | python | en | code | 10 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "word_pair_reporter.WordPairReporter",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "tor... |
19644786314 | from insides import *
from bs4 import BeautifulSoup
from re import findall
from sys import stdout
import os
def AnimeDownloader(url, subbed=False, dubbed=False, start=False, end=False, single=False, quality=False):
def _new(url):
"""
Generates A new And Clean Url
"""
if "/" in url[::-1][0]:
url = "... | Anon-Exploiter/S3miNa | core.py | core.py | py | 8,008 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 147,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 148,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_numb... |
14703232169 | # Implementation of W-Net: A Deep Model for Fully Unsupervised Image Segmentation
# in Pytorch.
# Author: Griffin Bishop
# Adapted and changed by: Guru Deep Singh
from __future__ import print_function
from __future__ import division
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim ... | faheinrich/wnet-modified | train.py | train.py | py | 7,820 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.__version__",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "config... |
34105884678 | """
Auteur:
- Quillivic Robin, Data SCientist chez StarClay, rquilivic@starclay.fr
Description:
Fichier regroupant l'ensemble des fonctions utiles pour la visualisation des résultats de l'inférence des modèles:
- affichage du nom des différentes classes
- construction de tableau de résultats... | etalab-ia/ami-ia-dgs | application/backend/src/prediction/prediction_context.py | prediction_context.py | py | 9,541 | python | fr | code | 0 | github-code | 6 | [
{
"api_name": "backend_utils.config_parser.parse_full_config",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "backend_utils.config_parser.get_local_file",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 28,
"usage_type... |
24790183344 | import requests
import json
def get_messages(ch_id, auth_token):
headers = {
'authorization': auth_token
}
r = requests.get(f'https://discord.com/api/v9/channels/{ch_id}/messages?all', headers=headers)
parsed = json.loads(r.text)
for message in parsed :
print(message['content'], "... | Gene-94/Python | Lab/mini_projects/pull_discord_messages.py | pull_discord_messages.py | py | 540 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 10,
"usage_type": "call"
}
] |
3580563610 | # -*- coding: utf-8 -*-
import collections
import itertools
import datetime
import re
with open('day4/input', 'r') as f:
lines = f.read().split('\n')[:-1]
dates_guards = []
for line in lines:
datestr, otherstr = line[1:].split(']')
date = datetime.datetime.strptime(datestr, "%Y-%m-%d %H:... | matthewghgriffiths/advent_2018 | day4.py | day4.py | py | 1,547 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "re.findall",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime... |
12991959122 | from keras.models import Sequential, Model
from keras.layers import Dense, Input
from keras.utils import plot_model
from sklearn.model_selection import train_test_split
import pandas as pd
import re
import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
#%% import data ... | efl-the-data-science-institute/ds-courses | 2-DataScience/4-NeuralNetworks/4-dataAnalysis-II-skeleton.py | 4-dataAnalysis-II-skeleton.py | py | 2,997 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "matplotlib.use",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.notna",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_num... |
10198967091 | import retro
import gym
class Frameskip(gym.Wrapper):
def __init__(self, env, skip=4):
super().__init__(env)
self.skip = skip
def reset(self):
return self.env.reset()
def step(self, act):
total_reward = 0.0
done = None
for i in range(self.skip):
... | stevenwalton/Retro-Learner | src/FrameSkip.py | FrameSkip.py | py | 490 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "gym.Wrapper",
"line_number": 4,
"usage_type": "attribute"
}
] |
44530904476 | import cv2
import numpy as np
import random
# Initialize variables
change = 1 # Amount to change jitter by
jitter = 0 # Jitter for curve points
jit_ceil = 10
rng = 117 # Set random seed
np.random.seed(rng)
random.seed(rng)
# Get video dimensions
frames_dir = "stills/"
arena = cv2.imread(frames_dir+'blank_arena.jp... | nghess/dlc-live-test | odor-trail-breadcrumbs-jitter-demo.py | odor-trail-breadcrumbs-jitter-demo.py | py | 5,332 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.random.seed",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "random.seed",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"lin... |
29911843881 | from aocd.models import Puzzle
from pprint import pprint
from collections import Counter
GRID_WIDTH = 10
GRID_HEIGHT = 10
FLASH_ENERGY_LEVEL = 10
def get_input(puzzle=None, mode="test"):
if mode=="test":
raw_data = """
5483143223
2745854711
5264556173
6141336146
6357385478
4167524645
2176841721
688288113... | ariesunique/advent-of-code | day11.py | day11.py | py | 3,912 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.Counter",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"line_number": 116,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
... |
6814731847 |
import requests
from bs4 import BeautifulSoup
url='https://www.nbp.pl/kursy/kursya.html'
r = requests.get(url)
html = r.text
soup = BeautifulSoup(html,features="html.parser")
table = soup.find("table", attrs={"class": "pad5"})
rows = table.find_all('tr')
data = []
for row in rows[1:]:
currency = row.find_all('td... | dawidradziwoniuk/python_zadania | tabela_kursow.py | tabela_kursow.py | py | 588 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 8,
"usage_type": "call"
}
] |
26042504766 | from __future__ import annotations
import os
import sys
from typing import Iterable, Mapping, cast
import pytest
from pants.core.goals.run import (
Run,
RunDebugAdapterRequest,
RunFieldSet,
RunInSandboxBehavior,
RunRequest,
RunSubsystem,
run,
)
from pants.core.subsystems.debug_adapter imp... | pantsbuild/pants | src/python/pants/core/goals/run_test.py | run_test.py | py | 6,410 | python | en | code | 2,896 | github-code | 6 | [
{
"api_name": "pants.testutil.rule_runner.RuleRunner",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "pants.testutil.rule_runner.RuleRunner",
"line_number": 47,
"usage_type": "name"... |
17225787742 | import sqlite3
def init_db():
conn = sqlite3.connect("crm.sqlite")
cursor = conn.cursor()
with open("schema.sql") as f:
sql = f.read()
cursor.executescript(sql)
conn.commit()
conn.close()
def find_all_answers():
conn = sqlite3.connect("crm.sqlite")
cursor = co... | Arisaarisa/voice_test | db.py | db.py | py | 859 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 33,
"usage_type": "call"
}
] |
27214650745 | from collections.abc import Mapping
from typing import Iterator, TypeVar
__all__ = [
'StackedMapping',
]
_KeyType = TypeVar('_KeyType')
_ValueType = TypeVar('_ValueType')
class StackedMapping(Mapping):
"""
Overview:
Stacked mapping data structure.
Multiple mapping-liked object (such as ... | HansBug/hbutils | hbutils/collection/stacked.py | stacked.py | py | 2,865 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "typing.TypeVar",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "typing.TypeVar",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "collections.abc.Mapping",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "collections.abc.M... |
1831797370 | import requests
import json
import os
import time
import functools
class CryptoCompare:
def _init_(self):
pass
@staticmethod
@functools.lru_cache(maxsize=24)
def fetch_price_history_dict(use_cache=False, days_to_fetch=1500):
storage_location = "./_cache/price_history.json"
# ... | jhodges10/dash_tax_tool | dlib/crypto_compare.py | crypto_compare.py | py | 3,777 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.path.isfile",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "requests.request",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_n... |
74604826748 | import sys
from collections import deque
n = int(sys.stdin.readline().rstrip())
res = ""
dq = deque()
li = []
for i in range(n):
li.append(int(sys.stdin.readline().rstrip()))
idx = 0
pushValue = 1
while pushValue <= n:
prevIdx = idx
if pushValue != li[idx]:
res += "+\n"
dq.append(pushValue... | LimTurtle/BasicAlgorithm | Baekjoon/1874_stack.py | 1874_stack.py | py | 932 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.stdin.readline",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.stdin.readline",... |
41074332479 | import streamlit as st
import pandas as pd
import numpy as np
import plotly.express as px
st.set_page_config(layout="wide")
st.title('Inventory Discrepancy')
file_expected = st.file_uploader("Please upload your expected inventory data", type='csv')
file_counted = st.file_uploader("Please upload your current inventor... | Cristopxer/Mojix_StreamLit_W2 | main_app.py | main_app.py | py | 6,387 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "streamlit.file_uploader",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "strea... |
18211780334 | import argparse
import io
import unittest
import os
from bin.process_serotyper_results import write_outfile, make_gene_list, get_arguments
class TestProcessResults(unittest.TestCase):
TEST_SEROTYPE_FULLGENES = 'tests/test_data/input/SERO_26237_7#5__fullgenes__GBS_seroT_Gene-DB_Final__results.txt'
TEST_SERO... | sanger-bentley-group/GBS-Typer-sanger-nf | tests/process_serotyper_results_test.py | process_serotyper_results_test.py | py | 2,590 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "bin.process_serotyper_results.make_gene_list",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "bin.process_serotyper_results.make_gene_list",
"line_number": 21,
"us... |
11779855840 | import json
import os
from typing import Optional, Union, Literal
import numpy as np
from utils.models import ModelCache, SentenceTransformerBackend, AutoModelBackend
from utils.cluster import ClusterJobBaseArguments
from utils.io import exit_if_exists
from utils.tweets import line2txt_hashtags, line2txt_clean
from cop... | TimRepke/twitter-climate | code/pipeline/04_04_01_embed_remaining_tweets.py | 04_04_01_embed_remaining_tweets.py | py | 5,493 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "typing.Union",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.PathLike",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "utils.cluster.ClusterJobBaseArguments",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "t... |
29388652262 | import pandas as pd
from sklearn.experimental import enable_iterative_imputer
from sklearn.impute import IterativeImputer
def feature_processing(FEATURES_PATH, OUTPUT_PROCESSED_FEATURES_PATH):
data = pd.read_csv(FEATURES_PATH)
#remove unimportant columns
data = data.drop(["max_phase1", "max_phase2", "max_... | Meyuhasson/VoIP-Research | Code/Python Files/feature_processing.py | feature_processing.py | py | 1,748 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sklearn.impute.IterativeImputer",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 23,
"usage_type": "call"
}
] |
19241065842 | import sys
input = sys.stdin.readline
from collections import deque
N = int(input())
deq = deque()
for _ in range(N):
cmd = list(input().split())
if cmd[0] == 'push_front':
deq.appendleft(cmd[1])
elif cmd[0] == 'push_back':
deq.append(cmd[1])
elif cmd[0] == 'pop_front':
if len(deq):
... | sdh98429/dj2_alg_study | 백준/Silver/10866. 덱/덱.py | 덱.py | py | 894 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.stdin",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 6,
"usage_type": "call"
}
] |
28806030536 | from typing import Dict
from typing import Hashable
from typing import Iterator
from typing import Optional
from typing import Union
from jira.exceptions import JIRAError
from jira.resources import Sprint
from ..exceptions import UserError
from ..plugin import BaseFunction
class Function(BaseFunction):
"""Retur... | coddingtonbear/jira-select | jira_select/functions/get_sprint_by_name.py | get_sprint_by_name.py | py | 3,371 | python | en | code | 22 | github-code | 6 | [
{
"api_name": "plugin.BaseFunction",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Hashable",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "jira.resources.Sprint... |
6739936399 | from googletrans import Translator
import csv
import time
file=open( "gender_refine-csv.csv", "r",encoding='utf-8')
reader = csv.reader(file)
translator = Translator()
with open('translated.csv','w',encoding='utf-8') as file:
for line in reader:
line[0]=line[0].replace("'","")
line[0]=line[0].repl... | arslanhashmi/datascience | translation/dataSets/convertDataSet.py | convertDataSet.py | py | 777 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "csv.reader",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "googletrans.Translator",
"line_number": 7,
"usage_type": "call"
}
] |
13540840176 | import numpy as np
from scipy.sparse import csr_matrix
def transform_indices(data, users, items):
data_index = {}
for entity, field in zip(['users', 'items'], [users, items]):
idx, idx_map = to_numeric_id(data, field)
data_index[entity] = idx_map
data.loc[:, field] = idx
return data... | skolai/Recommender-Systems-Intro-Sber-2022 | dataprep.py | dataprep.py | py | 1,243 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "numpy.ones",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "scipy.sparse.csr_matrix",
"line_number": 34,
"usage_type": "call"
}
] |
18932743380 | from typing import List
from random import randint
from functools import reduce
# spojenie nahodnych znakov medzi
genJednoSlovo = lambda nznakov: reduce(lambda a,i: a + i,
[ chr(randint(ord('a'), ord('z'))) for i in range(0, nznakov) ]
)
genNahodneSlova = lambda n: [ genJednoSlovo(randint(3, 10)) for i in range(0... | Plasmoxy/MaturitaInformatika2019 | python/strukturovane_typy/mapdlzkystringov.py | mapdlzkystringov.py | py | 554 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "functools.reduce",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 9,
"usage_type": "call"
}
] |
15550350824 | #!/usr/bin/env python3
import datetime
import json
import xlsxwriter
from io import BytesIO
from flask import (
Blueprint,
send_file
)
from bson import json_util
from collections import Counter
mod_export = Blueprint('export', __name__)
from database import mongo # noqa
pdfs = mongo.db.pdfs
answers = mongo... | emsch/femida | frontend/app/export.py | export.py | py | 5,004 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Blueprint",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "database.mongo.db",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "database.mongo",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "database.mongo.... |
6629675986 | import tensorflow as tf
from tensorflow.compat.v1 import ConfigProto
from tensorflow.compat.v1 import InteractiveSession
#Configure GPU
config = ConfigProto()
config.gpu_options.allow_growth = True
session = InteractiveSession(config=config)
for gpu in tf.config.experimental.list_physical_devices('GPU'):
tf.confi... | jfgf11/ml_genn_examples_ssh | Sequential API/alexnet.py | alexnet.py | py | 5,958 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow.compat.v1.ConfigProto",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat.v1.InteractiveSession",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tensorflow.config.experimental.list_physical_devices",
"line_number": ... |
8763529178 | from django.urls import path
from .views import HomePageView, PostDetailView, NewPostView, UpdatePostView,DeletePostView
urlpatterns = [
path('', HomePageView.as_view(), name='home-page'),
path('post/<int:pk>/delete/', DeletePostView.as_view(),name='post-delete'),
path('post/<int:pk>/update/', UpdatePostVi... | BrianOyollo/django-blog | blog/urls.py | urls.py | py | 493 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "views.HomePageView.as_view",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "views.HomePageView",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.ur... |
25630878276 | import logging
import boto3
import os
logger = logging.getLogger()
logger.setLevel(logging.INFO)
privateHostedZoneName = os.environ['PrivateHostedZoneName']
esDomain = os.environ['EsDomain']
def handler(event, context):
logger.info("Event: {}\n".format(event))
asg_name = event['detail']['AutoScalingGroupNam... | PLAB-IO/aws-elasticsearch-cluster | stacks/es/update_recordset_function/main.py | main.py | py | 2,156 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"li... |
35540553139 | import collections
words: str = input().upper()
count: dict = collections.defaultdict(int)
for i in words:
count[i] += 1
max_val = [k for k,v in count.items() if max(count.values()) == v]
print( '?' if len(max_val) > 1 else max_val[0]) | BlueScreenMaker/Yeummy_Algorithm | BOJ/BOJ 1157 단어공부.py | BOJ 1157 단어공부.py | py | 243 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 4,
"usage_type": "call"
}
] |
40787834031 | #!/usr/bin/env python
import os
#import glob
import time
import datetime
from time import sleep, strftime
import re
import json
import RPi.GPIO as GPIO
#from gpiozero import MotionSensor, LED
import logging
import logging.handlers
from ThermalPrediction.PredictDeltaTemp import thermalCalculations
from Config import *... | mrncmoose/smart_controller | pi-code/__pycache__/maineController.py | maineController.py | py | 6,292 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "os.system",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_numbe... |
14711186434 | import numpy as np
import h5py
import torch
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.dataloader import default_collate
def _dataset_to_tensor(dset, mask=None):
arr = np.asarray(dset, dtype=np.int64)
if mask is not None:
arr = arr[mask]
tensor = torch.LongTensor(arr)
return te... | sepiatone/cv-question_answering | src/data.py | data.py | py | 3,665 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.asarray",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.int64",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.LongTensor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.Datase... |
19692342889 | import jax
import numpy as np
from jax import lax
from jax import numpy as jnp
__all__ = ['apply_orthogonal']
def apply_orthogonal(thetas, inputs, output_size):
""" Applies a sequence of orthogonal transformations to a sequence of inputs.
<thetas> is a sequence of scalars, with length (2 * n - d - 1) * d... | qdevpsi3/quantum-orthogonal-nn | src/orthax/common.py | common.py | py | 2,474 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "numpy.concatenate",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"... |
35058949102 | # IMPORTING REQUIRED MODULES
import cv2
import matplotlib.pyplot as plt
import numpy as np
import imutils
import easyocr
# CODE
img = cv2.imread(r"images/img_1.png")
grey = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
plt.imshow(cv2.cvtColor(grey, cv2.COLOR_BGR2RGB)) # To draw the image. Matplotlib wants the i... | VishalSaravanan-tech/ANPR | main.py | main.py | py | 2,135 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.ims... |
33155090845 | import os
import json
from typing import List, Dict, Tuple, Optional, Union
from collections import defaultdict
import pickle as pkl
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.nn.functional as F
import pytorch_lightning as pl
from sklearn.cluster import KMeans
import numpy as np
from tra... | raspberryice/type-discovery-abs | baselines/RoCORE_model.py | RoCORE_model.py | py | 13,164 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "common.log.get_logger",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "common.log",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "pytorch_lightning.LightningModule",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name"... |
21718518073 |
import numpy as np
from rule_methods.model_explainer.Explainer_Forest import Explainer_Forest
from tqdm import tqdm
class Explainer:
def __init__(self, tree_nums, sample_size):
self.tree_nums = tree_nums
self.sample_size = sample_size
def fit(self, explain_data, explain_label, normal_protos,... | bill315lee/IIDM-FQCT | rule_methods/model_explainer/Explainer.py | Explainer.py | py | 4,384 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tqdm.tqdm",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "rule_methods.model_explainer.Explainer_Forest.Explainer_Forest",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 26,
"usage_type": "call"
},
{
... |
8042299829 | from multiprocessing import Pool
import os, time, random
def run(name):
print("Child process %s start--%s" % (name, os.getpid()))
start=time.time()
time.sleep(random.choice([1,2,3]))
end=time.time()
print("Child process %s end--%s,executed time %.2f" % (name, os.getpid(),end-start))
if __name__... | zuohd/python-excise | threading/multiple_subprocess.py | multiple_subprocess.py | py | 706 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.getpid",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 8,
... |
74745613626 | import os
from abc import ABC, abstractmethod
from argparse import ArgumentParser, RawDescriptionHelpFormatter
from lib.conf.configuration import RunnerConfiguration, KeepLevel, GlobalConfiguration
class BaseParser(ABC):
def __init__(self, parser_description):
"""Base configuration for parser implementi... | rhinstaller/kickstart-tests | scripts/launcher/lib/conf/runner_parser.py | runner_parser.py | py | 4,468 | python | en | code | 48 | github-code | 6 | [
{
"api_name": "abc.ABC",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "argparse.RawDescriptionHelpFormatter",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "a... |
86503614540 | from django.shortcuts import render, redirect
from django.views.decorators.csrf import csrf_protect
from django.contrib.auth import authenticate, login
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from .models import Pet, Noticia
from django.contrib.auth import logout
# ... | lorenzomrm/DW | telainicial/views.py | views.py | py | 4,725 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.shortcuts.render",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.logout",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 16,
"usage_type": "call"
},
{
"api_... |
31978213153 | import tweepy
import json
from time import sleep
from re import search
from itertools import cycle
from random import shuffle
from settings import *
from datetime import datetime, timedelta
class TwitterBot(object):
"""docstring for TwitterBot"""
def __init__(self):
# authorization from values inputted... | sahilpedazo/twitterautoliker | main.py | main.py | py | 1,619 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tweepy.OAuthHandler",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tweepy.API",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tweepy.Cursor",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_n... |
13280020466 | import os
import numpy as np
import tensorflow as tf
import tensorflow_datasets as tfds
from tensorflow_datasets.core import lazy_imports_lib
_DOWNLOAD_PATH = "https://storage.googleapis.com/download.tensorflow.org/data/mini_speech_commands.zip" # noqa: E501
_EXAMPLES_SUBDIR = "mini_speech_commands"
_HOMEPAGE = "htt... | jjgp/magic-packet | magic_packet/datasets/mini_speech_commands.py | mini_speech_commands.py | py | 2,286 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow_datasets.core",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "tensorflow_datasets.core.Version",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tensorflow_datasets.core",
"line_number": 19,
"usage_type": "attribute"
... |
18232929120 | import torch
import torch.nn as nn
import sys
sys.path.append('.')
import pickle
from rdchiral.template_extractor import extract_from_reaction
from rdchiral.main import rdchiralRunText
from rdkit import Chem
from rdkit.Chem import AllChem
import numpy as np
import pandas as pd
from pathlib import Path
from tqdm import ... | UTF-z/ML_retrosynthesis | utils/utils.py | utils.py | py | 8,093 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "rdkit.Chem.MolFromSmiles",
... |
30696721363 |
import os
import cv2 as cv
def viedo_to_image(video_path, path, catalog, start_name=0,interval=50):
capture = cv.VideoCapture(video_path)
if (capture.isOpened() == False):
print("Error opening the video file")
else:
# Get frame rate information
# You can replace 5 with CAP_PROP_FPS a... | guojin-yan/PaddleGame | tools/video_to_image.py | video_to_image.py | py | 1,560 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_n... |
43987718036 | # test CurlypivSetup
"""
Notes about program
"""
# 1.0 import modules
import numpy as np
from skimage import io
import glob
from os.path import join
import matplotlib.pyplot as plt
from curlypiv.utils.calibrateCamera import measureIlluminationDistributionXY, calculate_depth_of_correlation, calculate_darkfield, plot_fi... | sean-mackenzie/curlypiv | curlypiv/CurlypivTestSetup.py | CurlypivTestSetup.py | py | 24,001 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.linspace",
"line_number": 119,
"usage_type": "call"
},
{
"api_name": "skimage.io.imread",
"line_number": 187,
"usage_type": "call"
},
{
"api_name": "skimage.io",
"line_number": 187,
"usage_type": "name"
},
{
"api_name": "numpy.shape",
"lin... |
41211734990 | # coding=utf-8
import ast
import json
from numpy import unicode
# a = ast.literal_eval('{"genres":[{"id":35,"name":"Comedy"},{"id":18,"name":"Drama"}]}')
# print (a['genres'])
def unicode_convert(input):
if isinstance(input, dict):
return {unicode_convert(key): unicode_convert(value) for key, value in inpu... | ming19956/PFE | information-retrival-search-engine/informationRetrival/indexing/tmp.py | tmp.py | py | 949 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "numpy.unicode",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "json.load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number"... |
40128321235 | from __future__ import print_function
import logging
import numpy as np
import pytest
import matplotlib.pyplot as plt
from ..field import dipole_e_ff
from ..field import dipole_general
from ..field import dipole_radiant_intensity
from ..helper import gen_r
from .base import Base
LG = logging.getLogger('dip')
def m... | thisch/pydipole | dipole/tests/test_dipole.py | test_dipole.py | py | 12,993 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "helper.gen_r",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line... |
73993751549 | import jinja2
try:
import jinja2.ext.autoescape
jinja2_autoescape_builtin = False
except ImportError:
jinja2_autoescape_builtin = True
import dulwich.web
import flask
import httpauth
from dulwich.errors import NotGitRepository
from klaus import utils, views
from klaus.repo import FancyRepo, InvalidRepo
... | jonashaag/klaus | klaus/__init__.py | __init__.py | py | 9,719 | python | en | code | 659 | github-code | 6 | [
{
"api_name": "klaus.utils.guess_git_revision",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "klaus.utils",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "flask.Flask",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "jinja2.St... |
70169073787 | """
下面的是离散型特征和连续性特征同时存在的情况下的解释
代码参考 Numerical and Categorical features in the same dataset 部分
https://marcotcr.github.io/lime/tutorials/Tutorial%20-%20continuous%20and%20categorical%20features.html
建立的模型是预测一个人的年收入是否在50K以上。
"""
from __future__ import print_function
import sklearn
import sklearn.datasets
import sklearn.... | XiaAm/PPP | LIME_related/numerical_categorical.py | numerical_categorical.py | py | 2,703 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.random.seed",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sklearn.preproce... |
26625828579 | from django.shortcuts import render,redirect
from django.http import HttpResponse
from .models import Consultation
from .forms import CreatConsultation
# Create your views here.
def home(request):
Consult = Consultation.objects.all()
return render(request, 'home.html', {'Consult' : Consult})
def AjoutConsultat... | Mohameden-Emah/DevTest | DevTest/Dev/views.py | views.py | py | 1,335 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.Consultation.objects.all",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "models.Consultation.objects",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "models.Consultation",
"line_number": 7,
"usage_type": "name"
},
{
... |
37438253989 | # -*- coding: utf-8 -*-
import sqlalchemy
import pdb
from referralmanager.cli.models.referrals import AlasccaBloodReferral, AlasccaTissueReferral
from reportgen.reporting.util import get_addresses
def query_database(sample_ID, referral_type, session):
'''Queries the given database wih the given referral type and... | ClinSeq/reportgen | reportgen/reporting/metadata.py | metadata.py | py | 3,083 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sqlalchemy.or_",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "referralmanager.cli.models.referrals.AlasccaBloodReferral",
"line_number": 40,
"usage_type": "argument"
},
{
"api_name": "referralmanager.cli.models.referrals.AlasccaTissueReferral",
"li... |
32129748921 | """Your migration message here
Revision ID: fcff5d406c1b
Revises:
Create Date: 2023-06-09 22:12:25.438467
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'fcff5d406c1b'
down_revision = None
branch_labels = None
depends_on = None
def upgrade() -> None:
# ... | faithwangare/Recipe-App-python | recipe_app/migrations/versions/fcff5d406c1b_your_migration_message_here.py | fcff5d406c1b_your_migration_message_here.py | py | 814 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "alembic.op.add_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer... |
39290472318 | import sys
import code
import pygame
import math
import pygame.surfarray as surfarray
import numpy as np
pygame.init()
pygame.display.set_mode((256,256))
gbcolors = list()
gbcolors.append((15, 56, 16))
gbcolors.append((49, 97, 48))
gbcolors.append((136, 173, 17))
gbcolors.append((151, 187, 17))
def renderGBScreen(m... | misspokeycat/gamepy | gbvideo/render.py | render.py | py | 3,002 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
... |
38749838814 | import sys
sys.path.append("..")
from cutword import cut_word_via_statics
from config import IMAGE_SIZE
from cutword import binaryzation
from PIL import Image
import os
# @paramas:
# 1 -> store input image in input folder
# 2 -> results are stored in output folder
def cutInputImage(input_img_path, output_path... | ustc-fontcode/Backend | cut.py | cut.py | py | 1,799 | python | en | code | 2 | github-code | 6 | [
{
"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.exists",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
22411499798 | from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
import sys
#set to whatever text you want
text = open("shrek_script... | austyngo/Whatsapp_spam | whatsapp_msg.py | whatsapp_msg.py | py | 1,175 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.support.ui.WebDriverWait",
"line_number": 14,
"usage_type": "call"
},
... |
20476884124 | """ newsfeed """
from datetime import datetime, timedelta
import dbm
import os
import json
import platform
import time
import feedparser
from sendmail import SendMail
feedparser.USER_AGENT = 'newsfeed/5.0'
class Newsfeed():
""" Newsfeed backbone. """
def __init__(self):
""" Constructor. """
... | bschau/Portfolio | VpsApps/python/src/newsfeed.py | newsfeed.py | py | 5,537 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "feedparser.USER_AGENT",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sendmail.SendMail",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "platform.system",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.path.... |
21657191519 | import tensorflow as tf
from data import readData
from data import bulid_record
from models import tsganv2
from config import cnf
import sys
import os
import matplotlib.pyplot as plt
current_dir = sys.path[0]
config_ = cnf.Elec_0
GLOBAL_STEP = 0
TRAIN_RECORDS = config_.TRAIN_RECORDS
TEST_RECORDS = config_.TEST_RECORD... | keithyin/mycodes | TSCGAN/train_ganv2.py | train_ganv2.py | py | 6,101 | python | en | code | 23 | github-code | 6 | [
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "config.cnf.Elec_0",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "config.cnf",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "tensorflow.set_random... |
70386098749 | import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email import encoders
host = "smtp.gmail.com"
port = "587"
login = ""
senha = ""
server = smtplib.SMTP(host, port)
server.ehlo()
server.starttls()
server.login(login, senh... | maikonmuniz/send_email_attachment_in_python | src/config_send_email.py | config_send_email.py | py | 1,024 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "smtplib.SMTP",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "email.mime.multipart.MIMEMultipart",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "email.mime.text.MIMEText",
"line_number": 25,
"usage_type": "call"
},
{
"api_name... |
19021408398 | import json
from collections import namedtuple
import yaml
NEW_LINE = '\n'
FILE_HANDLER = {
'JSON': {
'extns': ('.json'),
'converter': json.load,
},
'YAML': {
'extns': ('.yaml', '.yml'),
'converter': yaml.safe_load,
},
}
AST_STATUSES = namedtuple(
'status', ['adde... | bukvoezhka/python-project-lvl2 | gendiff/constants.py | constants.py | py | 2,190 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "yaml.safe_load",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "collections.namedtuple",
"line_number": 19,
"usage_type": "call"
}
] |
34519604060 | import openpyxl
path="C:\\Users\sneha_kanekar\PycharmProjects\SeleniumwithPython\write_data.xlsx"
workbook=openpyxl.load_workbook(path)
sheet=workbook.active
for r in range(1,5):
for c in range(1,4):
sheet.cell(row=r,column=c).value="welcome"
workbook.save(path) | snehagg24/SeleniumWithPython | data_driven/writedataintoExcel.py | writedataintoExcel.py | py | 291 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 5,
"usage_type": "call"
}
] |
72528966269 | from django.conf.urls import url, patterns
from .views import authenticate_user, CreateUserAPIView, UserRetrieveUpdateAPIView
urlpatterns = [
url(r'^create/$', CreateUserAPIView.as_view()),
url(r'^update/$', UserRetrieveUpdateAPIView.as_view()),
url(r'^obtain_token/$', authenticate_user),
]
| essykings/Jwt-authentication-django | users/urls.py | urls.py | py | 307 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "views.CreateUserAPIView.as_view",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "views.CreateUserAPIView",
"line_number": 5,
"usage_type": "name"
},
{
"api_nam... |
4962760932 | import os
import json
import time
from PIL import Image
import pytesseract
import cv2
import numpy as np
# refresh_time = 5 # seconds
# UserData = '/UserData'
# for user_dir in os.listdir():
# print(user_dir)
# def scan_dir():
# all_dir = os.listdir()
# for user_dir in all_dir:
# print(user_dir)
de... | pavanb0/MetaFortess | UserData/main.py | main.py | py | 2,247 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
... |
28487849336 | from sqlalchemy import create_engine, and_, or_
from sqlalchemy.orm import sessionmaker
from sqlalchemy.orm.attributes import InstrumentedAttribute
from ..daos.daos import users
from pprint import pprint
from .userProgressPlans import Base
class dbConnection(object):
def __init__(self, dbObj):
engine = ... | mraison/work_profiling_app | work_profiling_app/modules/database/dbConnection.py | dbConnection.py | py | 3,265 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "userProgressPlans.Base.metadata",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "userProgressPlans.Base",
"line_number": 16,
"usage_type": "name"
},
{
... |
17931240172 | import os
import numpy as np
from scipy.linalg import hadamard
import nibabel as nib
import scipy.io as sio
from datetime import datetime
from IPython.display import clear_output
import plotly.graph_objects as go
import matplotlib.pyplot as pp
import pandas as pd
from scipy.optimize import curve_fit
def set_protocol(n... | logannii/optpcasl_GEeASL | GEeASL_functions.py | GEeASL_functions.py | py | 70,204 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scipy.linalg.hadamard",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.repeat",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_... |
23938069419 | from flask import jsonify
from Model.clients import ClientsDAO
class BaseClients:
def build_map_dict(self, row):
result = {}
result['cid'] = row[0]
result['firstname'] = row[1]
result['lastname'] = row[2]
result['phone'] = row[3]
result['company'] = row[4]
r... | GabrielPerez37/CleanNClear-BE | Controller/clients.py | clients.py | py | 2,212 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "Model.clients.ClientsDAO",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "Model.clients.ClientsDAO",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "flask... |
25092044452 | from django.utils.functional import cached_property
from directory_cms_client.client import cms_api_client
from directory_components.helpers import SocialLinkBuilder
from core.helpers import handle_cms_response
from .helpers import unslugify
class BreadcrumbsMixin:
def get_context_data(self, *args, **kwargs):
... | uktrade/directory-ui-export-readiness | article/mixins.py | mixins.py | py | 1,747 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "helpers.unslugify",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "directory_cms_client.client.cms_api_client.lookup_by_tag",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "directory_cms_client.client.cms_api_client",
"line_number": 36,
... |
14770592504 | # -*- coding: utf-8 -*-
"""
Created on Thu Mar 5 02:40:45 2020
@author: Hussein
"""
import os
from tqdm import tqdm
from pydub import AudioSegment
root_path = '******' # Write your source path instead of *****
src_path=os.listdir(root_path)
fileNumber=1 # Just a counter for different names
for file in... | Mahagamal97/GP | scripts/MP3_wav_Converter.py | MP3_wav_Converter.py | py | 527 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pydub.AudioSegment.from_mp3",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pydub.AudioSegment",... |
41630269294 | import logging
import os
import geopandas as gpd
from pathlib import Path
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s - %(levelname)s - [%(filename)s:%(lineno)d] - %(message)s",
)
def run_create_geojson() -> None:
logging.info("Load shapefile....")
sa2 = gpd.read_file(
os.pa... | tringuyenarup/monty-data-visualization | src/create_geojson.py | create_geojson.py | py | 1,420 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "geopandas.read_file"... |
11753144073 | import board
import json
import neopixel
import os
import zmq
from lightcontroller import LED_UPDATE_TOPIC
# GPIO 18
LED_PIN = board.D18
LED_PUB_ADDRESS = 'localhost'
LED_PUB_PORT = 8757
class LedController:
def __init__(self, num_lights, brightness):
self.num_lights = num_lights
self.brightness =... | skyler91/mtgled | pylights/ledcontroller.py | ledcontroller.py | py | 1,424 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "board.D18",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "neopixel.NeoPixel",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "zmq.Context",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"lin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.