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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
42183818903 | """
Module for entities implemented using the
switch platform (https://www.home-assistant.io/integrations/switch/).
"""
from __future__ import annotations
import logging
from typing import Any
from hahomematic.const import TYPE_ACTION, HmPlatform
import hahomematic.device as hm_device
from hahomematic.entity import G... | Lemocin/hahomematic | hahomematic/platforms/switch.py | switch.py | py | 1,379 | python | en | code | null | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "hahomematic.entity.GenericEntity",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "hahomematic.device.HmDevice",
"line_number": 25,
"usage_type": "attribute"
},
{
... |
73934624355 |
"""General-purpose test script for image-to-image translation.
Once you have trained your model with train.py, you can use this script to test the model.
It will load a saved model from --checkpoints_dir and save the results to --results_dir.
It first creates model and dataset given the option. It will hard-cod... | deltahue/DL-Project-2020 | contrastive-unpaired-translation-master/test.py | test.py | py | 6,810 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "options.test_options.TestOptions",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "data.create_dataset",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "models.create_model",
"line_number": 66,
"usage_type": "call"
},
{
"api_name... |
74136555873 | import numpy as np
import copy
import cv2
import operator
from scipy.ndimage import zoom
from skimage import measure
import pydensecrf.densecrf as dcrf
from pydensecrf.utils import unary_from_labels, create_pairwise_bilateral, create_pairwise_gaussian
def CRF(img,anno,gt_prob):
gt, labels = np.unique(ann... | DQDH/Semantic_Image_Segmentation | make_localization_cues/generate_cues/tools/sod.py | sod.py | py | 3,447 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.unique",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pydensecrf.densecrf.DenseCRF2D",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pydensecrf.d... |
37820308114 | import os
import sys
import time
import shutil
import random
import socket
import winreg
from multiprocessing.spawn import freeze_support
import psutil
import logging
import hashlib
from contextlib import closing
from http_server import start_web
from configparser import ConfigParser
from concurrent.futures import Pro... | nyacat/gms_auto | gms_patcher/main.py | main.py | py | 7,199 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "contextlib.closing",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STRE... |
18934781052 | import argparse
from typing import Any, Dict, List, Optional, Tuple, Union
from nerf_turret_utils.number_utils import map_range
def assert_in_int_range(value: int, min_val: int, max_val: int) -> int:
"""
Check whether an input integer value is within a certain range.
Parameters:
value: The input ... | anjrew/Autonomous-Nerf-Turret | components/ai_controller/ai_controller_utils.py | ai_controller_utils.py | py | 5,722 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "argparse.ArgumentTypeError",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "typing.Any",
... |
36105481363 | import gzip
from tempfile import mkdtemp
import os
import numpy as np
from astropy.io import fits
def _make_file_for_testing(file_name='', **kwd):
img = np.uint16(np.arange(100))
hdu = fits.PrimaryHDU(img)
for k, v in kwd.items():
hdu.header[k] = v
hdu.writeto(file_name)
def directory_f... | astropy/ccdproc | ccdproc/utils/sample_directory.py | sample_directory.py | py | 2,932 | python | en | code | 86 | github-code | 1 | [
{
"api_name": "numpy.uint16",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits.PrimaryHDU",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits"... |
15674221296 | import sys
import googlemaps
from datetime import datetime,date
from datetime import timedelta
try:
from config import config
except:
print("No existe el archivo config, stop")
sys.exit()
from helpers import helpers
H=helpers()
def groute(start,end,timet,mode="walking"):
gmaps = googlemaps.Client(key... | carlitoselmago/streetPred | googledirections.py | googledirections.py | py | 2,186 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.exit",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "helpers.helpers",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "googlemaps.Client",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "config.config.gmapsAPI",
... |
27394255300 | import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import PolynomialFeatures
from sklearn.metrics import mean_squared_error
# 输入数据
X = np.array([[2022], [2021], [2020]]) # 年份
Y = np.array([442, 440, 458]) # 录取分数
best_degree = 1 # 最佳多项式次数
best_mse = float('inf') # 初始化最佳... | lyscf/gaokao-analytics | predict/predict_demo.py | predict_demo.py | py | 1,771 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.PolynomialFeatures",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklear... |
22852644906 | from django.shortcuts import render, HttpResponse, redirect
from django.db.models import Max, Min, Count
from attendance.models import extemployeeatt, holiday, classlist, classes, classsolt, timesolt, checkinout
from hr.models import employee
from . import msslqdb
import datetime
import time
import threading
from xm... | linuxsjun/assect | attendance/views.py | views.py | py | 16,883 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_n... |
40420201014 | from pathlib import Path
import re
from math import ceil
import copy
data_folder = Path(__file__).parent.resolve()
file = data_folder / "input.txt"
find_ingredients = re.compile(r"(\d+ \w+)+")
class Ingredient:
def __init__(self, name, quantity):
self.name = name
self.quantity = int(quantity)
cl... | eirikhoe/advent-of-code | 2019/14/sol.py | sol.py | py | 4,470 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 50... |
43027922069 | from django.urls import path
from . import views
urlpatterns = [
path('',views.index,name='index'),
path('transactions',views.transactions,name='transactions'),
path('updatePage',views.updatePage,name='updatePage'),
path('update',views.update,name='update'),
path('delete', views.delete, name="delet... | mathurtanmay02/Expensez | dashboard/urls.py | urls.py | py | 436 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"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",
... |
45493379784 | # -*- coding: utf-8 -*-
"""
DockWidget
-----------------
begin: 2016-08-26
last: 2019-11
"""
from pathlib import Path
import sys
from datetime import datetime
from qgis.PyQt import QtGui, QtWidgets, uic
from qgis.PyQt.QtCore import pyqtSignal
#from qgis.PyQt.QtWidgets import QFileDialog
# QWidget, QList... | Weathermann/radolan2map | classes/gui.py | gui.py | py | 10,897 | python | en | code | 7 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "qgis.PyQt.uic.loadUiType",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "qgis.PyQt.uic",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "qgis.PyQt.QtGui.Q... |
7639807209 |
import pandas as pd
import os
import numpy as np
import re
import time
import sys
from fuzzywuzzy import fuzz
import logging
from static import *
# To calculate: TF-IDF & Cosine Similarity
from sklearn.feature_extraction.text import TfidfVectorizer
from scipy.sparse import csr_matrix
import sparse_dot_topn.sparse_do... | oportusgonzalo/product-deduplication | bivariate_comparison.py | bivariate_comparison.py | py | 14,706 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.download",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "nltk.corpus",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "pandas.read_... |
30906550732 | import numpy as np
import time
import pandas
from keras_retinanet.models import load_model
from keras_retinanet.utils.image import preprocess_image, resize_image
from osgeo import gdal
from helpers import sliding_window
from helpers import pixel2coord
from helpers import non_max_suppression_fast
(winW, winH, stepSi... | muhanur/detect-from-google | process.py | process.py | py | 2,635 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "keras_retinanet.models.load_model",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "osgeo.gdal.Open",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "osgeo.gdal",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "helpers.... |
37873244448 | import os
from flask import Flask
from flask import render_template
app = Flask(__name__)
locations = []
@app.route('/')
def home():
origin = '37.866197,+-122.252968'
destination = '37.876031,+-122.258791'
waypoints = 'International+House+Berkeley|Greek+Theater+Berkeley|GSPP+Berkeley'
return render_tem... | ashirahattia/prov02website | __init__.py | __init__.py | py | 659 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.environ",
"lin... |
25362261753 | import pyclipper
import math
of = pyclipper.PyclipperOffset()
def anyValidPath(paths):
''' checks the list of paths to find any non empty path '''
for pth in paths:
if len(pth) > 0:
return True
return False
def closePath(path):
''' closes the path if open by adding the point, des... | kreso-t/FreeCAD_Mod_Adaptive_Path | Adaptive/GeomUtils.py | GeomUtils.py | py | 8,377 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "pyclipper.PyclipperOffset",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pyclipper.PyclipperOffset",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pyclipper.JT_ROUND",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_na... |
33420603124 | from django.conf import settings
from django.conf.urls.defaults import patterns, include, url
from cloudmailin.views import MailHandler
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
from mailpost.views import create_post, FakeEmailView
from django.contrib.auth... | sharnett/BookerE | bookere/urls.py | urls.py | py | 1,949 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django_cron.autodiscover",
"line_number": 10,
"usage_type": "call"
},
{
"api... |
19294746004 | #!/usr/bin/env python
# coding: utf-8
# In[76]:
import pyspark
from pyspark import SparkContext
from pyspark.sql import SQLContext
from pyspark.conf import SparkConf
from pyspark.sql.session import SparkSession
# Need to make declaration in SparkContext() when submit pyspark job
sc = SparkContext()
spark = SQLConte... | rauldatascience/semi-structured-dwh | series_spark_job.py | series_spark_job.py | py | 1,490 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pyspark.SparkContext",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SQLContext",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.date.today",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "datet... |
34842760480 | # Evaluate Division: https://leetcode.com/problems/evaluate-division/
# You are given an array of variable pairs equations and an array of real numbers values, where equations[i] = [Ai, Bi] and values[i] represent the equation Ai / Bi = values[i]. Each Ai or Bi is a string that represents a single variable.
# You are ... | KevinKnott/Coding-Review | Month 03/Week 04/Day 02/d.py | d.py | py | 2,683 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "types.List",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 18,
"usage_type": "call"
}
] |
43849622923 | from django import forms
from apps.inicio.models import Actor
class ActorForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(ActorForm, self).__init__(*args, **kwargs)
for i, (fname, field) in enumerate(self.fields.iteritems()):
field.widget.attrs["class"] = field.widget... | JhonnySA/Videoteca | proyectos/videoteca/apps/inicio/formstotal/actor.py | actor.py | py | 443 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "apps.inicio.models.Actor",
"line_number": 13,
"usage_type": "name"
}
] |
27287255173 | import os
import pandas as pd
import pytest
from pandas.testing import assert_frame_equal, assert_series_equal
import cleanvision
# To ensure backwards compatibility
from cleanvision.imagelab import Imagelab
class TestImagelabSaveLoad:
def test_save(self, generate_local_dataset, tmp_path):
imagelab = I... | cleanlab/cleanvision | tests/test_save_load.py | test_save_load.py | py | 3,168 | python | en | code | 725 | github-code | 1 | [
{
"api_name": "cleanvision.imagelab.Imagelab",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.exi... |
32601342276 | #!/usr/bin/python3
from typing import List
import json
class Solution:
def wordsTyping(self, sentence: List[str], rows: int, cols: int) -> int:
nums = [len(d) for d in sentence]
n = len(sentence)
ans, row, col, j = 0, 0, 0, 0
while row < rows:
col = 0
while... | negibokken/sandbox | leetcode/418_sentence_screen_fitting/main.py | main.py | py | 1,007 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 34,
"usage_type": "call"
}
] |
4805265619 | import torch.nn as nn
import torch
from src.losses.loss_functions import (
DJSLoss,
ClassifLoss,
DiscriminatorLoss,
GeneratorLoss,
)
from src.utils.custom_typing import (
DiscriminatorOutputs,
ClassifierOutputs,
EDIMOutputs,
GenLosses,
DiscrLosses,
ClassifLosses,
)
class EDIMLo... | MehdiZouitine/Learning-Disentangled-Representations-via-Mutual-Information-Estimation | src/losses/EDIM_loss.py | EDIM_loss.py | py | 6,090 | python | en | code | 56 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "src.losses.loss_functions.DJSLoss",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "src.l... |
20980695431 | #!/usr/bin/env python
#coding:utf-8
"""
task.py
~~~~~~~~~~~~~
:license: BSD, see LICENSE for more details.
"""
from flask import Blueprint,render_template,g,request
from application.models import *
from application.decorators import admin_required
import json,logging,urllib
from google.appengine.api import memcach... | itopidea/leepress | application/views/task.py | task.py | py | 2,198 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "flask.Blueprint",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "application.decorators.admin_required",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "google.appengine.api.search.Document",
"line_number": 28,
"usage_type": "call"
},... |
3288527771 | from tkinter import Tk, RIGHT, BOTTOM, BOTH, TOP, StringVar, font, Text, DISABLED, Scrollbar, Y
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
import frameCreator
def CreateWindow(window):
#Main window and setting props
wind... | gianlacasella/ScientificGraphingCalculator | windowCreator.py | windowCreator.py | py | 4,583 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "tkinter.Tk",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tkinter.font.Font",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tkinter.font",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "tkinter.font.Font",
"lin... |
20162168775 | import pygame
import random
from object import Object
class Enemy(Object):
def __init__(self, pos):
super().__init__("cursor.png", pos)
self.image = pygame.transform.scale(self.image, (70, 90))
self.accel = pygame.math.Vector2(0, 0)
self.accelspeed = 0.1
def update(self):
... | mojd1234/ouch | enemy.py | enemy.py | py | 1,216 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "object.Object",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "pygame.transform.scale",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.transform",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.math.V... |
34521671321 | #!/usr/bin/python3
import os, tempfile, subprocess
try:
data = input(">").strip()
if len(data) > 12: raise Exception("too large")
with tempfile.TemporaryDirectory() as dirname:
name = os.path.join(dirname, "user")
with open(name, "w") as f: f.write(data)
os.chmod(name, 0o500)
... | p4-team/ctf | 2018-12-08-hxp/misc_elves/tiny_elves_fake.py | tiny_elves_fake.py | py | 418 | python | en | code | 1,716 | github-code | 1 | [
{
"api_name": "tempfile.TemporaryDirectory",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.chmod",
"li... |
29055176966 | import discord
import asyncio
from discord.ext import commands
from datetime import datetime
import math
from config import *
bot = commands.Bot(command_prefix=PREFIX, intents= discord.Intents.all())
bot.remove_command('help')
@bot.event
async def on_ready():
await bot.change_presence(status=discord.S... | respuNN/Discord-Presence-Tracker | log-bot.py | log-bot.py | py | 2,758 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "discord.Intents.all",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "discor... |
32261344928 | import requests
from bs4 import BeautifulSoup
def get_article_body(url):
# Send a GET request to the URL
response = requests.get(url)
# Check if the request was successful (status code 200)
if response.status_code == 200:
# Parse the HTML content of the page
soup = BeautifulSoup(respon... | AlexOutis/NewsBot | soup.py | soup.py | py | 1,242 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 11,
"usage_type": "call"
}
] |
75065185953 | __all__ = [
"process_epoch",
]
import logging
import sys
from typing import NoReturn, Optional
import torch
import tqdm
from torch import LongTensor, Tensor
from . import _settings as settings
from . import results
from . import utils
from .. import _config as config
from .. import influence_utils
from ..influen... | ZaydH/target_identification | fig01_cifar_vs_mnist/poison/tracin_utils/main.py | main.py | py | 8,735 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "torch.Tensor",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "torch.LongTensor",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "influence_utils.check_d... |
34520883151 | #!/usr/bin/env python3
import sys
import random
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.backends import default_backend
def ReadPrivateKey(filename):
return serialization.load_pem_private_key(
open(filename, 'rb').read(), password=None, backend=default_backend())
d... | p4-team/ctf | 2018-06-23-google-ctf/crypto_secrecy/challenge.py | challenge.py | py | 1,222 | python | en | code | 1,716 | github-code | 1 | [
{
"api_name": "cryptography.hazmat.primitives.serialization.load_pem_private_key",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cryptography.hazmat.primitives.serialization",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "cryptography.hazmat.backends.defau... |
8658763067 | """:cvar
pip3 uninstall telebot
pip3 uninstall PyTelegramBotAPI
pip3 install pyTelegramBotAPI
pip3 install --upgrade pyTelegramBotAPI
"""
try:
import cv2
import PIL.Image as Image
import io
import base64
#from byte_array import byte_data
import telebot
import config
import random
fr... | Hammoudmsh/Information-security-Bot | main.py | main.py | py | 21,191 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "telebot.TeleBot",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "config.TOKEN",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "telebot.types.ReplyKeyboardMarkup",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "t... |
26807453323 | #!/usr/bin/env python3
import os
import shutil
import yt_dlp
import requests
from utils import logger
from downloaders import DL_DIRECTORY
log = logger.get_log(__name__)
class Downloader():
def __init__(self):
self._createTempDir()
def cleanUp(self):
for filename in os.listdir(DL_DIRECTORY)... | jsaddiction/TrailerTech | downloaders/downloader.py | downloader.py | py | 4,543 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "utils.logger.get_log",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "utils.logger",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.listdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "downloaders.DL_DIRECTORY... |
7425957587 | import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv('assets/CFPB Housing Data.csv')
CENSUS = df['Census Tract']
LOAN = df['Loan Amount']
plt.scatter(CENSUS, LOAN)
plt.xlabel("Census Tract")
plt.ylabel("Loan Amount")
plt.show()
#print(df.head)
| shacktemp/data_1_checks | kc_2.py | kc_2.py | py | 266 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "matplotlib.p... |
24598567986 | import hashlib
from collections import OrderedDict
class Perceiver:
def __init__(self, perceptor):
self.last_state = None
self.perceptor = perceptor
self.current_state = None
self.keys = None
self.sorted_keys(perceptor.get_state())
self.perceive(perceptor.get_state(... | DorAm1010/ReinforcementLearning_Q-Table | perceiver.py | perceiver.py | py | 857 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.OrderedDict",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "hashlib.sha1",
"line_number": 22,
"usage_type": "call"
}
] |
71934734434 | # coding: utf-8
from zfits import FactFits
from astropy.io import fits
import matplotlib.pyplot as plt
f = FactFits(
"zfits/test_data/20160817_016.fits.fz", "zfits/test_data/20160817_030.drs.fits.gz"
)
facttools = fits.open("zfits/test_data/20160817_016_calibrated.fits")
e = f.get_data_calibrated(0)
ft_e = factto... | fact-project/zfits | plot_comparison.py | plot_comparison.py | py | 645 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "zfits.FactFits",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits.open",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.su... |
26253222037 | import os
from pathlib import Path
from mne_bids import BIDSPath
from seek_localize import read_dig_bids
from seek_localize.bids import write_dig_bids
# BIDS entities
subject = 'la02'
session = 'presurgery'
acquisition = 'seeg'
datatype = 'ieeg'
space = 'fs'
# paths to test files
cwd = os.getcwd()
bids_root = Path(... | adam2392/seek_localize | tests/test_bids.py | test_bids.py | py | 2,516 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "os.getcwd",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "mne_bids.BIDSPath",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "seek_localize.read_dig_bids"... |
12967072447 | import torch
from termcolor import colored
import torch.nn as nn
import torch.nn.functional as F
import torchvision
import os
def visual_representation(ckpt_path=None, use_3d=False):
"""
2D encoder of pretrained 3D Visual representation
"""
if ckpt_path is None:
ckpt_path = "checkpoints/videoae... | YanjieZe/rl3d | load_3d.py | load_3d.py | py | 2,036 | python | en | code | 63 | github-code | 1 | [
{
"api_name": "os.path.exists",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.DataParallel",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
37312132142 | from flask import render_template,redirect
from flask_appbuilder.models.sqla.interface import SQLAInterface
from flask import Blueprint, current_app, jsonify, make_response, request
# 将model添加成视图,并控制在前端的显示
from myapp.models.model_serving import Service,KfService
from myapp.models.model_team import Project,Project_User
... | wujiapei/alldata | dataAI/mlops/myapp/views/view_kfserving.py | view_kfserving.py | py | 16,210 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "myapp.app.config",
"line_number": 79,
"usage_type": "attribute"
},
{
"api_name": "myapp.app",
"line_number": 79,
"usage_type": "name"
},
{
"api_name": "base.MyappModelView",
"line_number": 82,
"usage_type": "name"
},
{
"api_name": "flask_appbuilder.... |
71446573473 | # 257. Binary Tree Paths
# Easy
#
# 2497
#
# 129
#
# Add to List
#
# Share
# Given the root of a binary tree, return all root-to-leaf paths in any order.
#
# A leaf is a node with no children.
#
#
#
# Example 1:
#
#
# Input: root = [1,2,3,null,5]
# Output: ["1->2->5","1->3"]
# Example 2:
#
# Input: root = [1]
# Output:... | laiqjafri/LeetCode | problems/00257_binary_tree_paths.py | 00257_binary_tree_paths.py | py | 1,200 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 40,
"usage_type": "name"
}
] |
29926890398 | import numpy as np
import astropy.units as u
from eventio import EventIOFile
from eventio.simtel import MCShower
from astropy.coordinates import SkyCoord, AltAz
from astropy.time import Time
__all__ = [
"find_nearest_bin",
"create_angular_area_scaling",
"poisson_likelihood_gaussian",
"tensor_poisson_li... | ParsonsRD/template_builder | template_builder/utilities.py | utilities.py | py | 5,442 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "numpy.abs",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "numpy.newaxis",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "numpy.sin",
"line_number":... |
22737252153 | from os import link
from bs4 import BeautifulSoup
from command import Command
import requests
import discord
# Every module has to have a command list
commandList = []
commandList.append(Command("!score", "score", "Used to see the score of live games or the betting odds of an upcoming game.\nNote: if trying to use t... | ndamalas/Wild-Card-Bot | modules/sports.py | sports.py | py | 8,361 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "command.Command",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "requests.get",
"li... |
73033920353 | # -*- coding: utf-8 -*-
'''
Simple returner for Couchbase. Optional configuration
settings are listed below, along with sane defaults.
couchbase.host: 'salt'
couchbase.port: 8091
couchbase.bucket: 'salt'
couchbase.skip_verify_views: False
To use the couchbase returner, append '--return couchbase' to the salt co... | shineforever/ops | salt/salt/returners/couchbase_return.py | couchbase_return.py | py | 7,730 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "salt.utils.utils.import_json",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "salt.utils.utils",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "... |
42440455663 | import telebot
import sql_functions
import urllib.request
import json
import alice_vars
from alice_vars import bot
import bot_functions
def cat(message):
chat_id = message.chat.id
if sql_functions.check_user(alice_vars.db_name, 'Admins', chat_id):
keyboard = alice_vars.keyboard_admin
else:
... | adtya/the-alice-bot | easter_eggs.py | easter_eggs.py | py | 1,655 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "sql_functions.check_user",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "alice_vars.db_name",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "alice_vars.keyboard_admin",
"line_number": 13,
"usage_type": "attribute"
},
{
"a... |
41827178704 | import torch
from torch import nn, einsum
import numpy as np
from einops import rearrange, repeat
from einops.layers.torch import Rearrange
def pair(t):
return t if isinstance(t, tuple) else (t, t)
class AddPositionEmbs(nn.Module):
"""向输入中添加可学习的位置嵌入模块 """
def __init__(self,inputs_positions=None):
... | Lp-wu/ViT-by-pytorch | ViT.py | ViT.py | py | 12,536 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.nn.Parameter",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line... |
24021067933 | from cgitb import reset
from http import HTTPStatus
from flask import Flask, jsonify, request
from flask_restful import Api, Resource, abort
from flask_cors import CORS
from util.math import math
app = Flask(__name__)
CORS(app)
api = Api(app)
# Create resource
class Operation(Resource):
'''
Perform operation... | seanfinnessy/SimpleCalculator | server/app.py | app.py | py | 859 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask_restful.Resource",... |
2599586486 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
veriler = pd.read_csv('Ads_CTR_Optimisation.csv')
import random
N = 10000
d = 10
toplam = 0
secilenler = []
for n in range(0,N):
ad = random.randrange(d)
secilenler.append(ad)
odul = veriler.values[n,ad] # verilerdeki n. satır = 1 is... | AyseErdanisman/MakineOgrenmesiKurs | 7- Takviyeli Öğrenme (Reinforced Learning)/1- UCB (Üst Güven Sınırı)/Rasgele Örnekleme Yaklaşımı/random.py | random.py | py | 398 | python | tr | code | 6 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "random.randrange",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.hist",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyp... |
74868111712 | import shodan
import json
import sys
from time import sleep
from parser import process_parser
def portCheck(info):
ports = info['ports']
if 515 in ports:
content = str(info['ip_str']) + ":port 515 printer find"
writeToFile('log/port.log',content)
print(content)
if 9100 in ports:
... | IotScanner2021/IotScanner2021 | backup/shod.py | shod.py | py | 2,592 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "json.dumps",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "shodan.Shodan",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "shodan.APIError",
"line_numbe... |
7958211750 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index),
url(r'^register', views.register),
url(r'^login', views.login),
url(r'^show', views.show),
url(r'^add', views.add),
url(r'^createtrip', views.createtrip),
url(r'^logout', views.logout),
... | jbacos7/C- | secondDojo answers1/Python/Django/pexam2/pexam2 2/apps/pexam2/urls.py | urls.py | py | 519 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.conf.urls.url",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.co... |
29111524576 |
from datetime import datetime
from app.main.constants import (PLOT_SAVE_DIRECTORY, TIME_STAMP_FORMAT,
PlotStyle)
from app.main.models.wall import Wall
from matplotlib import pyplot as plt
'''
Description: This method contains helper functions for plotting and reporting.
'''
class Rep... | nchalimba/building-plan-processor | app/main/reporting/reporting_helper.py | reporting_helper.py | py | 2,197 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "app.main.constants.TIME_STAMP_FORMAT",
"line_number": 22,
"usage_type": "argument"
},
{
"... |
17213380192 | import argparse
from math import pi, sin, asin
import time
from time import sleep
import pvaccess as pva
class UnionTest:
def __init__(self, **kwargs):
"""
"""
self.dataStruct = {'ArrayId': pva.UINT,
'Time': [pva.DOUBLE],
'value': pva.... | epics-extensions/c2dataviewer | example/union.py | union.py | py | 2,375 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "pvaccess.UINT",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pvaccess.DOUBLE",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pvaccess.PvUnion",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pvaccess.FLO... |
41035495644 | import typing
from sqlalchemy import Integer
from sqlalchemy import Text
from sqlalchemy.orm import DeclarativeBase
from sqlalchemy.orm import declared_attr
from sqlalchemy.orm import Mapped
from sqlalchemy.orm import mapped_column
class Base(DeclarativeBase):
pass
class HasRelatedDataMixin:
@declared_attr... | sqlalchemy/sqlalchemy | test/typing/plain_files/orm/declared_attr_two.py | declared_attr_two.py | py | 1,104 | python | en | code | 8,024 | github-code | 1 | [
{
"api_name": "sqlalchemy.orm.DeclarativeBase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.orm.mapped_column",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Text",
"line_number": 18,
"usage_type": "call"
},
{
"api_n... |
72389012194 | # coding: utf-8
"""Download and file clips."""
import logging
import hashlib
import os
import datetime
import ffmpy
import requests
from tinydb import Query
from config import db, SUPPORTED_TYPES, DATA_DIR
logger = logging.getLogger('oxo')
def download_clip(url, bot, update, content_type, fname=None):
"""Down... | cafca/displaybot | displaybot/conversion.py | conversion.py | py | 2,395 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "hashlib.sha1",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "config.SUPPORTED_TYPES",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "os.path.join",
... |
39726595273 | """Delete disabled column
Revision ID: de3bdf5a9ff8
Revises: 2b7fcebfede1
Create Date: 2021-06-20 09:35:40.600021
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'de3bdf5a9ff8'
down_revision = '2b7fcebfede1'
branch_labels = ... | shin-hama/JunkNoteAPI | app/db/migrations/versions/de3bdf5a9ff8_delete_disabled_column.py | de3bdf5a9ff8_delete_disabled_column.py | py | 1,169 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "alembic.op.drop_index",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "alembic.op.drop_index",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "alembic.op",
... |
25088785509 | from flask import Flask, request, jsonify
import sys
from elasticsearch_dsl import Search, A, Q
from elasticsearch import Elasticsearch
app = Flask(__name__)
from flask import render_template
import logging
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(... | chaopli/movielib-incomplete | movielib.py | movielib.py | py | 2,280 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler"... |
22885261332 | from __future__ import print_function
import datetime
from tzlocal import get_localzone
import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
# If modifying these scopes, delete the file token.p... | vwlau/eink-cal | g_cal.py | g_cal.py | py | 3,214 | python | en | code | 38 | github-code | 1 | [
{
"api_name": "os.path.path.exists",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "pickle.load",
"line... |
3164290218 | #!/usr/bin/env python3
from time import sleep
from datetime import datetime
from tasks import primeira_task, segunda_task
q1 = 'filarq30_1'
q2 = 'filarq30_2'
s = 'INFORMACAO '
if __name__ == '__main__':
while True:
try:
print(f'*** {datetime.now()}')
_1 = primeira_task.apply_asy... | htbrandao/tutorial-rabbit-and-celery | demo/app.py | app.py | py | 505 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "tasks.primeira_task.apply_async",
"line_number": 17,
"usage_type": "call"
},
{
"api_name"... |
35847150078 | import ast
import asyncio
import threading
import time
from datetime import datetime, timedelta
from collector.main_collector import MainCollector
from data_base import DataBase
from keys import VIME_TEST_TOKEN
from keys import VIME_TOKEN, VIME_TEST_TOKEN
from utils import cls
from vime_api.vime import Vime
TEST_MODE... | FalmerF/VimeArchive | run.py | run.py | py | 4,035 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "keys.VIME_TOKEN",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "keys.VIME_TEST_TOKEN",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "vime_api.vime.Vime",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "keys.VIME_TOK... |
20604431851 | """djangodemo03 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cla... | demo112/1809 | PythonWeb/Django/1809/djangoproject/djangodemo03/index/urls.py | urls.py | py | 1,823 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.conf.urls.url",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "index.views.add_author",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "index.views",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "django.c... |
7807856985 | from django.shortcuts import render
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from .models import UserInfo
from .models import battledata
from .forms import UserForm,dataForm
# ユーザ情報を辞書に格納して、users.htmlに返す
def showUsers(request):
usefinfo = UserInfo.objects.all()
context... | pyTakuya/djongoform | form/views.py | views.py | py | 3,361 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "models.UserInfo.objects.all",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.UserInfo.objects",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "models.UserInfo",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": ... |
43134615624 | # -*- coding: utf-8 -*-
from __future__ import print_function
import sys, os, warnings
gpu = sys.argv[ sys.argv.index('-gpu') + 1 ] if '-gpu' in sys.argv else '0'
os.environ['PYTHONHASHSEED'] = '0'
#os.environ['CUDA_VISIBLE_DEVICES']=gpu
#os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # Disable Tensorflow CUDA load stateme... | fjcastellanos/FewShotLayoutAnalysisMusic | main.py | main.py | py | 8,374 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.argv.index",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.config.list_phys... |
74454066272 | # Write a Python program to count the number of characters (character frequency) in a string.
from collections import Counter
m = 'google.com'
count = Counter(m)
print(count)
#Prgram to reverse words the string
def reverse_string_words(text):
for line in text.split('\n'):
return(' '.join(line.split()[::-1]... | IswaryaJ/Practice | String/Prog1.py | Prog1.py | py | 447 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.Counter",
"line_number": 4,
"usage_type": "call"
}
] |
17384052453 | """
Create a Blockchain
"""
import hashlib
import datetime
class Block:
def __init__(self, timestamp, data, previous_hash):
self.timestamp = timestamp
self.data = data
self.previous_hash = previous_hash
self.hash = self.calc_hash()
#Define a function to create... | DomingoCast/DS-and-algorithms | Blockchain.py | Blockchain.py | py | 1,551 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "hashlib.sha256",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "datetime.... |
8415907355 | from django.db import models
from django.contrib.auth.models import User
class Project(models.Model):
name = models.CharField(max_length=256, unique=True)
description = models.TextField()
class Dataset(models.Model):
name = models.CharField(max_length=256)
description = models.TextField()
class Pa... | tcouch/dataset-app-django | data_classifier/projects/models.py | models.py | py | 2,111 | python | en | code | 0 | github-code | 1 | [
{
"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": "... |
74935568354 | import numpy as np
from pdb import set_trace
# load text data
set_trace()
txt_data = "abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz " # input data
# txt_data = open('input.txt', 'r').read() # test external files
chars = list(set(txt_data)) # split and remove duplicate characters. ... | gov-ind/char-rnn | p.py | p.py | py | 6,284 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pdb.set_trace",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pdb.set_trace",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_numbe... |
2744513023 | from setuptools import setup, find_packages
from pathlib import Path
this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text()
def get_version(rel_path):
for line in (this_directory / rel_path).read_text().splitlines():
if line.startswith('__VERSION__'):
... | iisaka51/scrapinghelper | setup.py | setup.py | py | 1,519 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 36,
"usage_type": "call"
}
] |
27037063648 | from rest_framework import serializers
class RegisterDnaSerializer(serializers.Serializer):
dna = serializers.ListField(
child=serializers.CharField()
)
class AllRegisterDnaSerializer(serializers.Serializer):
id = serializers.IntegerField()
dna = serializers.CharField()
isMutant = serial... | felipehoyos1110/Mutant-magneto | xMen/mutant/serializers.py | serializers.py | py | 771 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rest_framework.serializers.Serializer",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.ListField",
"line_number": 5,
"usage_type"... |
24280152763 | import requests
import bs4 as bs
import pandas as pd
import pickle
import sys
from datetime import datetime
import math
# # Puxa o nome dos 1965 ativos que vieram do site da uol e estao no arquivo chamado ativos
# with open('ativos', 'rb') as f:
# ativos = pickle.load(f)
# ########
# Lista de acoes que o program... | pedrocampeloa/UnB-LMF-Data-Science | algoritimo1.py | algoritimo1.py | py | 5,095 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "pandas.DataFrame",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"... |
31496879213 | import serial
import time
ser = serial.Serial('/dev/ttyACM0', baudrate = 9600, timeout = 1)
time.sleep(3)
numPoints = 17 #no.of values coming
dataList = [0]*numPoints
def getValues():
arduinoOutput = ser.readline().decode().split(':')
#print(arduinoOutput)
#print(len(arduinoOutput))
if(numPoints ... | Niyas-A/auto | src/imu/src/imu_pub.py | imu_pub.py | py | 901 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "serial.Serial",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 5,
"usage_type": "call"
}
] |
33827589363 | import redis
import json
import threading
import rospy
from movebase import MoveBase as AdmMove
r = redis.Redis()
p = r.pubsub()
p.subscribe('ros-panel')
map_metadata = None
map_filename = None
current_pos = None
def setupdone(minfo,mapfilename):
global map_metadata, map_filename
map_metadata = minfo
... | adm-sglm/ros-project | src/worker.py | worker.py | py | 1,913 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "redis.Redis",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "movebase.MoveBase",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number... |
70427984994 | import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import linregress
# Data
voltage = np.array([710, 730, 750, 770, 790, 810, 830, 850, 870, 890, 910, 930, 950, 970, 990])
count = np.array([91, 102, 90, 137, 142, 149, 154, 126, 160, 160, 156, 150, 181, 143, 168])
coefficients = np.polyfit(voltage, co... | NolanTrem/phys1494 | experiment10/background.py | background.py | py | 845 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.polyfit",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.poly1d",
"line_number": ... |
21753957627 | from config_data import config
import requests
import json
import re
from loader import logger
endpoint_search = 'locations/v2/search'
endpoint_hotels = 'properties/list'
endpoint_photo = 'properties/get-hotel-photos'
def json_mod(text, file_name):
data = json.loads(text)
with open(file_name, 'w', encoding=... | russe19/telegram-bot-project | api_requests.py | api_requests.py | py | 3,060 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.loads",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 31,
... |
4652979163 | from typing import Dict, List
from datamodel import OrderDepth, TradingState, Order
import numpy as np
class Trader:
period = 15
def __init__(self) -> None:
self.price_log = np.zeros(Trader.period)
self.past_day = {}
def run(self, state: TradingState) -> Dict[str, List[Order]]:
... | Samukat/IMC_Trading_game | Sam/momentum.py | momentum.py | py | 3,833 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.zeros",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datamodel.TradingState",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "datamodel.OrderDepth",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "datamodel.Ord... |
38204015096 | import os,json
from .exceptions import NsValueIsNotDict, NsUuidDoesNotExist
from .nbiapi.identity import bearer_token
from .nbiapi.ns import Ns
from .nbiapi.vim import Vim
from .nbiapi.vnf import Vnf
def getToken():
creds = os.environ.get('OSM_ADMIN_CREDENTIALS')
token = None
if creds:
creds = j... | sonata-nfv/son-monitor | vnv_manager/app/api/management/commands/osm/utils.py | utils.py | py | 5,464 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "os.environ.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "nbiapi.identity.bearer_toke... |
31234711983 | from itertools import permutations
def solution(k, dungeons):
answer = -1
dun_list = list(permutations(dungeons, len(dungeons)))
for dun in dun_list:
tired = k
cnt = 0
for d in dun:
if tired < d[0]:
break
else:
tired -= d[... | earthssu/Programmers-Algorithm | Level2/피로도.py | 피로도.py | py | 401 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "itertools.permutations",
"line_number": 5,
"usage_type": "call"
}
] |
27493427622 | import pygame
import random
import tkinter as tk
# Set up the game window
WINDOW_WIDTH = 500
WINDOW_HEIGHT = 500
pygame.init()
WINDOW = pygame.display.set_mode((WINDOW_WIDTH, WINDOW_HEIGHT))
pygame.display.set_caption("Snake Game")
# Set up the colors
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
RED = (255... | EsmailTaghizadehResume/mini_games | Snake_Game.py | Snake_Game.py | py | 5,558 | python | en | code | 0 | github-code | 1 | [
{
"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": "pygame.display.s... |
31920134745 | #!/home/knielbo/virtenvs/ndhl/bin/python
"""
Build signal(s) from information dynamics in model
@author: kln@cas.au.dk
"""
import os
import numpy as np
from numpy.matlib import repmat
import scipy as sp
from util import load_pcl
# vis and test
import matplotlib as mpl
import matplotlib.pyplot as plt
mpl.rcParams.upda... | centre-for-humanities-computing/NDHL-AHM20 | src/build_signal.py | build_signal.py | py | 5,392 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.rcParams.update",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "numpy.asarray",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "num... |
44068529651 | # Grocery Billing System
from datetime import datetime
print('------WELCOME TO OUR SUPER-MARKET-----------')
name=(input('Enter your Name: '))
#LISTS of items
lists= '''
Rice Rs 20/kg
Sugar Rs 40/kg
Salt Rs 35/kg
Oil Rs 70/kg
Panner Rs 80/kg
Maggi Rs 50/kg
Boost Rs 90/kg
Colgate Rs 20/... | sreenivas782/Grocery-Billing-System | Hi.py/hello.py | hello.py | py | 2,187 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 70,
"usage_type": "name"
}
] |
70436483553 | import torch
from torch.utils.data import DataLoader, Subset
import torch.optim as optim
class AssignmentModel:
def __init__(self, dataloader=None, latent=None, generator=None, critic=None, cost=None, device='cpu', A_couples=None, A_cost=None):
## Variables ##
self.device = device
self.cos... | devbflow/optimal-transport-gan | src/models/AssignmentModel.py | AssignmentModel.py | py | 7,497 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.zeros",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "torch.arange",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "torch.cat",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "torch.unique",
"line_number": ... |
69861434594 | import aws_infrastructure.tasks.library.instance_helmfile
import scope.config
from invoke import Collection
from pathlib import Path
import tasks.terraform.ecr
CONFIG_KEY = "helmfile"
STAGING_LOCAL_HELMFILE_DIR = "./.staging/helmfile"
STAGING_REMOTE_HELM_DIR = "./.staging/helm"
STAGING_REMOTE_HELMFILE_DIR = "./.stagi... | uwscope/scope-aws-infrastructure | tasks/helmfile.py | helmfile.py | py | 6,863 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tasks.terraform.ecr.terraform.ecr.ecr_read_only",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "tasks.terraform.ecr.terraform",
"line_number": 28,
"usage_type": "attribute"... |
10581123244 | import requests
import time
with open('NEWURL.txt','r') as f:
url = f.readlines()
for i in range(len(url)):
url[i] = url[i].strip()
try:
t1 = time.time()
r = requests.get(url[i])
t2 = time.time()
Time = t2 - t1
print(Time)
print(len(r.content))
Throughput = (len(r.content)/ (Time))
... | MieMieWangWang/SNS | throughput.py | throughput.py | py | 466 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "time.time",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 12,
"usage_type": "call"
}
] |
21468516172 | import logging
import os
from motor.motor_asyncio import AsyncIOMotorClient
log = logging.getLogger(__file__)
class Database:
def __init__(self, connection_url: str | None = None):
connection_url = connection_url or os.getenv('DB_CONNECTION_URL')
assert connection_url, 'Connection URL to DB not... | kozlowskimaciej/microblog | backend/api/database/db.py | db.py | py | 758 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "motor.motor_asyncio.AsyncIOMotorClient",
"line_number": 15,
"usage_type": "call"
}
] |
74576595552 | import pandas as pd
from datetime import datetime, timedelta
def add_english_time_column(dataframe):
# Convertissez la colonne de date en datetime si elle n'est pas déjà au format datetime
# if not pd.api.types.is_datetime64_ns_dtype(dataframe['Date']):
# dataframe['Date'] = pd.to_datetime(dataframe['D... | kermia-ai/pythonProject | prepar_data.py | prepar_data.py | py | 1,400 | python | fr | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 21,
"usage_type": "call"
}
] |
42618756934 | import cirq
import sympy
import numpy as np
import tensorflow as tf
import tensorflow_quantum as tfq
from tensorflow.keras import layers
from tensorflow.keras import models
from tensorflow.keras.metrics import Precision, Recall, AUC
from tensorflow.keras.optimizers import Adam
class QConv(tf.keras.layers.Layer):
... | Djack1010/tami | code_models/sota_code_models/QCNN_QConv.py | QCNN_QConv.py | py | 7,873 | python | en | code | 8 | github-code | 1 | [
{
"api_name": "tensorflow.keras",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras.layers.Activation",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras",
"line_number": 20,
"usage_type": "attribute"
},
{
"ap... |
72046529635 | import smtplib
from email.mime.text import MIMEText
from email.utils import COMMASPACE # This is a just a fancy way of doing: COMMASPACE = ", "
def sendEmail():
recipient = ['email@gmail.com','email2@gmail.com']
pwd = 'your password'
sender = 'pyfeeds@gmail.com'
subject = '**** ALERT ****'
messag... | pybokeh/python | email/SendingEmail.py | SendingEmail.py | py | 1,057 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "email.mime.text.MIMEText",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "email.utils.COMMASPACE.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "email.utils.COMMASPACE",
"line_number": 16,
"usage_type": "name"
},
{
"api_n... |
27826917586 | # -*- coding: utf-8 -*-
"""
Created on Fri Sep 15 12:19:30 2023
@author: sharrm
"""
import fiona
import geopandas as gpd
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import pickle
import rasterio
from rasterio.mask import mask
from scipy import spatial
from scipy import ndimage
f... | sharrm/RSD | zero_shoreline_old.py | zero_shoreline_old.py | py | 24,259 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.nanmin",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.nanmax",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "rasterio.open",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "geopandas.read_file",
"li... |
28517427312 | #coding=utf-8
from pyrogram import Client, filters
from pyrogram.errors import FloodWait
from pyrogram.types import ChatPermissions
import time
from time import sleep
import random
import configparser
config = configparser.ConfigParser()
config.read('config.ini')
app = Client("my_account", api_id=config['pyrogra... | Slay-of/dtx_userbot | main.py | main.py | py | 1,384 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pyrogram.Client",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
26157049157 | from fastapi import APIRouter, Response, status, Depends, HTTPException
from psycopg.errors import UniqueViolation
from datetime import datetime
from pydantic import BaseModel
from fastapi.security import OAuth2PasswordBearer
import os
from jose import jwt
from user_db import pool
from .users import User
from profile_d... | MichaelEChristian/ProjectGamma | backend/accounts/api/routers/profile.py | profile.py | py | 3,353 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "fastapi.security.OAuth2PasswordBearer",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "fastapi.APIRouter",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name"... |
15575848076 | # Based on data show cities with positive temperature. Additionally - calculate average temperature for all cities.
# Use map(), filter() and reduce() function for that
from functools import reduce
data_from_api = [
{'city': 'Kraków', 'province_id': 8, 'current_temp': 3.5},
{'city': 'Warszawa', 'province_id'... | deinoo/python | other/filter_map_reduce_for_temperature.py | filter_map_reduce_for_temperature.py | py | 1,113 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "functools.reduce",
"line_number": 17,
"usage_type": "call"
}
] |
9527606346 | from pytest import fixture
from core.db.models import db
from core.db.models.domain_attribute import DomainAttribute
@fixture
def domain_attribute(domain_category):
node = DomainAttribute(
name='domain attribute',
category_id=domain_category.id,
has_taxonomy=False,
taxonomy_is_sco... | NLPDev/Wine_Project | tests/fixtures/domain_attribute.py | domain_attribute.py | py | 632 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "core.db.models.domain_attribute.DomainAttribute",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "core.db.models.db.session.add",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "core.db.models.db.session",
"line_number": 24,
"usage_type":... |
29890631794 | import requests
import random
import string
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
url="http://127.0.0.1:5166"
routes=["/code","/linq","/rawsql"]
tries=50
sum = []
queries=[]
print("------------Starting Benchmark------------")
## generate random search query
for i in range(... | amineamri3/SocialBrothersCase | benchmark.py | benchmark.py | py | 1,407 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "urllib3.disable_warnings",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "urllib3.exceptions",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "random.choices",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "string.... |
34436411858 | #!/usr/bin/env python3
import sys
import os
from threading import Thread
from queue import Queue, LifoQueue
from functools import cache
from operator import itemgetter
from collections import Counter
from rectangle import Rectangle
# Keep a count of each area a rectangle might have
rect_areas = Counter()
rect_queue = ... | atlantistechnology/thinking-about-debugging | queues/summarize.py | summarize.py | py | 2,262 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.Counter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "queue.LifoQueue",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "rectangle.Rectangle",... |
70320340513 | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 9 17:05:27 2021
Author: James Dixon
Date: Summer 2021
Convex Optimisation program
's' is signal estimate
"""
import numpy as np
from scipy.optimize import minimize
def Opt(MeasMtx,y,Errorbars,MaxPhtnNum):
# Generate error bound
epsilo... | jmsdixon/Photon-Stats-ConVxOpt | ConvexOpt1.py | ConvexOpt1.py | py | 2,316 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "numpy.sum",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number... |
11648461448 | import os
import logging
from fastapi import FastAPI
from fastapi.responses import FileResponse
app = FastAPI()
PORT = os.environ.get('PORT', "NNNN")
logger = logging.getLogger("uvicorn.error")
logger.info(f"Server started in port {PORT}")
IMAGE_PATH = "/volume/image.png"
@app.get("/")
async def root():
if os.... | vinhng10/devops-with-kubernetes | part1/exercise-112-Project-v0.6/backend/app/main.py | main.py | py | 458 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"... |
20004381625 | import cv2
from os import listdir
from os.path import isfile, join
import os
import shutil
def rearrange(files):
if "ordered" in files[0]:
return False
if len(files) % 4 != 0:
return False
new = []
for i in range(0, len(files), 4):
for j in range(2):
new.append(files... | dartmouth-review/reorganizer | rearrange.py | rearrange.py | py | 1,875 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "shutil.move",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 31,
... |
25694035511 | import os
from flask import Flask, request, jsonify, render_template
from keras.preprocessing import image
from bs4 import BeautifulSoup
from keras import backend as K
import keras
import requests
import re
app = Flask(__name__,template_folder='/Users/iqbalsandhu/Desktop/finalproject-2')
app.config['UPLOAD_FOLDER'] = '... | thusneem/CNN | finalproject-2/app.py | app.py | py | 3,736 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "keras.models.load_model",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "keras.models",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "keras.backend.ge... |
73564417634 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from main.models import *
from main.forms import *
from django.conf import settings
from django.core import serializers
from django.http import HttpResponse
from django.template import RequestContext
from django.views.decorators.csrf import csrf_exempt
fro... | gruizmir/valporanking | main/views.py | views.py | py | 4,771 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.http.HttpResponse",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 44,
"usage_type": "call"
},
{
"api_na... |
25167180092 | import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
from app import app
from apps import database, measurement, home, posttest, config
import pandas
import glob
app.layout = html.Div([
dcc.Location(id='url', refresh=False),
html.Div(id='page-conte... | donovan97/IAP_Measurement | src/index.py | index.py | py | 977 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "app.app.layout",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "app.app",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "dash_html_components.Div",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "dash_core_compon... |
12889468637 | import numpy as np
import torch
from torch.utils.data.dataloader import DataLoader
from torchvision import transforms
from functions import*
import os
'''
abbvi without any extension
'''
num_epochs=1
batchSize=500
num_S=5#训练的采样数量
dim=1000000+1
num_St=100#测试的采样数量
#eta=0.05#eta、k、w、c这四个参数是和论文对应的
k=1
w=5e13
c=1.3e9
M=10
... | allenzhangzju/Black_Box_Variational_Inference | bbvi_criteo4000000/abbvi_basic.py | abbvi_basic.py | py | 3,145 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "numpy.linspace",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.dataloader.DataLoader",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torch.zeros",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "tor... |
30896401362 | from data import get_data
from experiments import INVASETrainer
from config import get_decode_args
import torch
from models.decoder import LinearDecoder
import os
from tqdm import tqdm
from robustness.tools.helpers import AverageMeter
from argparse import Namespace
from torch import optim
import torch.nn as nn
import m... | choheeee22/invase-pytorch | decode_analysis.py | decode_analysis.py | py | 4,778 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.load",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.