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
72765557812
import dash import collections import dataframe as datos import layout as layout import plotly.express as px import pandas as pd import dash_core_components as dcc import dash_html_components as html import plotly.graph_objects as go import numpy as np from dash.dependencies import Input, Output,State from datetime imp...
cvonplessing/plataformashm
DatosRecientes/app.py
app.py
py
6,324
python
es
code
0
github-code
21
[ { "api_name": "dash.Dash", "line_number": 15, "usage_type": "call" }, { "api_name": "layout.datos_recientes_layout", "line_number": 24, "usage_type": "attribute" }, { "api_name": "dash.dependencies.Output", "line_number": 28, "usage_type": "call" }, { "api_name": ...
33229185726
""" Test driver for KGTK Kypher query engine """ import sys import os import os.path import tempfile import io import argparse from kgtk.exceptions import KGTKException from kgtk.cli_argparse import KGTKArgumentParser, KGTKFiles DEFAULT_GRAPH_CACHE_FILE = os.path.join( tempfile.gettempdir(), 'kgtk-graph-cache-%...
rijulvohra/kgtk
kgtk/cli/query.py
query.py
py
10,555
python
en
code
null
github-code
21
[ { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "tempfile.gettempdir", "line_number": 17, "usage_type": "call" }, { "api_name": "os.environ.get", "l...
40109126950
from flask import Blueprint, Flask, jsonify, render_template, request, make_response, redirect from models.item import Item from models.cart import Cart from flask_jwt_extended import ( jwt_required, create_access_token, get_jwt_identity) from instagram_api.utils.helpers import upload_file_to_aws from app import cs...
SaefKamaruddin/padelle
instagram_api/blueprints/users/store_item.py
store_item.py
py
8,993
python
en
code
1
github-code
21
[ { "api_name": "flask.Blueprint", "line_number": 12, "usage_type": "call" }, { "api_name": "models.item.Item.get_or_none", "line_number": 19, "usage_type": "call" }, { "api_name": "models.item.Item", "line_number": 19, "usage_type": "name" }, { "api_name": "flask.j...
7852925555
# coding: utf-8 import os import sys import json def load_data(file_path): print("Loading data from {}".format(file_path)) with open(file_path, "r") as f: data = [json.loads(l.strip()) for l in f] print("Load {} dialogues".format(len(data))) print("Sample dialogue:") for key, value in dat...
ahclab/arta_corpus
load_data.py
load_data.py
py
609
python
en
code
3
github-code
21
[ { "api_name": "json.loads", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" } ]
34178516316
import divider import combine_multi import combine_final from multiprocessing import Process, Queue import os n_cores = 2 def joiner(core): combine_multi.main(core) if __name__ == "__main__": print("DIVIDING") print("================") print("================") division = divider.main(n_core...
corbotarik98/Combine_Line_OF
main.py
main.py
py
859
python
en
code
0
github-code
21
[ { "api_name": "combine_multi.main", "line_number": 11, "usage_type": "call" }, { "api_name": "divider.main", "line_number": 21, "usage_type": "call" }, { "api_name": "multiprocessing.Queue", "line_number": 25, "usage_type": "call" }, { "api_name": "multiprocessing...
189873956
from conans import ConanFile, CMake import os, fnmatch class OpenCVConan(ConanFile): # Description must be very short for conan.io description = "OpenCV: Open Source Computer Vision Library." name = "OpenCV" version = "3.2.0" opencv_version_suffix = "320" settings = "os", "compiler", "...
xmar/conan-opencv
conanfile.py
conanfile.py
py
9,440
python
en
code
0
github-code
21
[ { "api_name": "conans.ConanFile", "line_number": 4, "usage_type": "name" }, { "api_name": "conans.CMake", "line_number": 109, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 163, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
10235509660
import os from django.forms.models import model_to_dict from django.db.models.fields import DateTimeField from django.db.models.fields.related import ManyToManyField, ForeignKey from django.contrib.contenttypes.fields import GenericRelation from celery.task import Task from tendenci.apps.perms.models import TendenciBas...
musasesay/membershiptemplet
tendenci/apps/exports/tasks.py
tasks.py
py
2,632
python
en
code
1
github-code
21
[ { "api_name": "celery.task.Task", "line_number": 10, "usage_type": "name" }, { "api_name": "tendenci.apps.perms.models.TendenciBaseModel", "line_number": 17, "usage_type": "argument" }, { "api_name": "django.db.models.fields.related.ManyToManyField", "line_number": 42, "u...
43987501873
import Batch import pandas as pd Batch.main from datetime import datetime def dt(hour, minute, second=0): return datetime(2022, 1, 1, hour, minute, second) def test_read_data(): data = [ (None, None, dt(1, 2), dt(1, 10)), (1, 1, dt(1, 2), dt(1, 10)), (1, 1, dt(1, 2, 0), dt(1, 2, 50)), (1, 1...
alevalve/MLOPS_FINAL_PROJECT
Final_Project/tests/test_batch.py
test_batch.py
py
1,137
python
en
code
0
github-code
21
[ { "api_name": "Batch.main", "line_number": 4, "usage_type": "attribute" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 21, "usage_type": "call" }, { "api_name": "Batch.prepare_data",...
8269732980
from collections import deque def bfs(): queue = deque() queue.append(n) while queue: v = queue.popleft() if v == k: return time[v] for next_step in (v - 1, v + 1, v * 2): if 0 <= next_step < 100001 and not time[next_step]: time[next_step] = ...
s2lee/PS
BOJ/Graph Traversal/1697.py
1697.py
py
440
python
en
code
0
github-code
21
[ { "api_name": "collections.deque", "line_number": 5, "usage_type": "call" } ]
28684070263
from django.contrib import admin from .models import * # Register your models here. admin.site.site_header = "SarkerFashion" class SettingAdmin(admin.ModelAdmin): list_display = ['title', 'company', 'status', 'update_at'] class ContactMessageAdmin(admin.ModelAdmin): list_display = ['name', 'status', 'subje...
sanjoy-crypto/Django-Ecommerce
Home/admin.py
admin.py
py
769
python
en
code
1
github-code
21
[ { "api_name": "django.contrib.admin.site", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 5, "usage_type": "name" }, { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 8, "usage_type": "attribute" }, { ...
19366047543
import datetime import unittest from cache_gs.interfaces.serialization import deserialize, serialize class TestSerialization(unittest.TestCase): def test_0(self): test_case = { 'string': 'ABCD', 'number': 1234, 'date': datetime.datetime.now(), 'bool': True...
guionardo/py-cache-guiosoft
tests/interfaces/test_serialization.py
test_serialization.py
py
476
python
en
code
0
github-code
21
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "attribute" }, { "api_name": "ca...
25794542297
import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from keras.utils.np_utils import to_categorical from keras.callbacks import ModelCheckpoint, ReduceLROnPlateau, EarlyStopping from keras.optimizers import RMSprop, Adam, SGD from keras.preprocessi...
szywind/kaggle-Iceberg
code/Iceberg.py
Iceberg.py
py
24,072
python
en
code
1
github-code
21
[ { "api_name": "pandas.read_json", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.stack", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.stack", "line_number": 35, "usage_type": "call" }, { "api_name": "models.Models", "line_nu...
3566986044
import json import httplib import string import base64 from django.http import HttpResponse from django.views.generic import ListView, TemplateView, View from django.core import serializers from django.views.decorators.csrf import csrf_exempt from .models import Repo, Contributor from settings.settings import GITHUB_...
GiantPanda0090/LNU-Timeline-project
server/github/views.py
views.py
py
5,095
python
en
code
0
github-code
21
[ { "api_name": "httplib.HTTPSConnection", "line_number": 16, "usage_type": "call" }, { "api_name": "settings.settings.GITHUB_USER", "line_number": 18, "usage_type": "name" }, { "api_name": "settings.settings.GITHUB_PASSWORD", "line_number": 19, "usage_type": "name" }, ...
23075694560
from threading import Timer, Thread, enumerate import datetime import random # data-structure tree class Tree: # dat can be of any datatype def __init__(self,dat,left=None,right=None): self.dat = dat self.left = left self.right = right def __str__(self): return str(self.da...
rnangia/task-dependency-implementation
task.py
task.py
py
8,677
python
en
code
0
github-code
21
[ { "api_name": "random.random", "line_number": 149, "usage_type": "call" }, { "api_name": "threading.Timer", "line_number": 152, "usage_type": "call" }, { "api_name": "threading.Timer", "line_number": 154, "usage_type": "call" }, { "api_name": "threading.Thread", ...
37363341811
from typing import TYPE_CHECKING, List import fastapi as _fastapi from fastapi import FastAPI from starlette.middleware.cors import CORSMiddleware import services as _services import schemas as _schemas import sqlalchemy.orm as _orm if TYPE_CHECKING: from sqlalchemy.orm import Session app = FastAPI() origins = ...
plucins/worker-board-py
main.py
main.py
py
3,978
python
en
code
0
github-code
21
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 10, "usage_type": "name" }, { "api_name": "fastapi.FastAPI", "line_number": 13, "usage_type": "call" }, { "api_name": "starlette.middleware.cors.CORSMiddleware", "line_number": 21, "usage_type": "argument" }, { ...
4226969472
import ccxt import pandas as pd import requests from datetime import datetime, time JBOT_TEST_CHAT_ID = "" def is_time_between(begin_time, end_time, check_time=None): # If check time is not given, default to current UTC time check_time = check_time or datetime.utcnow().time() if begin_time < end_time: ...
jayeshvg/jbot-pandas-ta
pandas-ta-tutorial-main/autosendmessagetocryptorium.py
autosendmessagetocryptorium.py
py
1,203
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.utcnow", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "name" }, { "api_name": "requests.post", "line_number": 19, "usage_type": "call" }, { "api_name": "ccxt.binance...
71002160694
# -*- coding: utf-8 -*- import json import time from behave import * from features.util import http from features.util import bdd_util from features.util.helper import WAIT_SHORT_TIME from db.mall import models as mall_models from db.member import models as member_models from business.account.webapp_owner im...
chengdg/apiserver
features/steps/member_spread.py
member_spread.py
py
4,877
python
en
code
1
github-code
21
[ { "api_name": "db.member.models.SocialAccount.get", "line_number": 19, "usage_type": "call" }, { "api_name": "db.member.models.SocialAccount", "line_number": 19, "usage_type": "attribute" }, { "api_name": "db.member.models", "line_number": 19, "usage_type": "name" }, ...
6950344389
import requests from bs4 import BeautifulSoup, Comment, NavigableString import sys, codecs, json import logging logging.basicConfig(filename="error.log", level=logging.INFO) class Track(object): def __init__(self, track_name, link, album): self._track_name = track_name self._album = album ...
juanknebel/PyLyricsRockAr
py_lyrics_rock_ar/functions.py
functions.py
py
7,791
python
en
code
0
github-code
21
[ { "api_name": "logging.basicConfig", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 7, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 90, "usage_type": "call" }, { "api_name": "logging.info", "li...
7145969344
#!/usr/bin/env python import wx #---- object ID's ----# # File Menu IDs ID_OPEN = wx.ID_OPEN ID_RELOAD = wx.NewId() ID_LOAD_FILTERS = wx.NewId() ID_SAVE_FILTERS = wx.NewId() ID_EXIT = wx.ID_EXIT # Edit Menu IDs ID_COPY = wx.ID_COPY ID_SELECTALL = wx.ID_SELECTALL ID_FONT ...
sdphome/LovelyLog
src/ll_global.py
ll_global.py
py
475
python
en
code
0
github-code
21
[ { "api_name": "wx.ID_OPEN", "line_number": 7, "usage_type": "attribute" }, { "api_name": "wx.NewId", "line_number": 8, "usage_type": "call" }, { "api_name": "wx.NewId", "line_number": 9, "usage_type": "call" }, { "api_name": "wx.NewId", "line_number": 10, ...
654302463
from itertools import product from django.shortcuts import render, redirect, get_object_or_404 from cart.cart import Cart from store.models import Product from cart.models import Order, OrderItem from customer.models import Customer from django.views.decorators.http import require_POST # Create your views here. def c...
chaugiahuy2000/python-web
cart/views.py
views.py
py
4,896
python
vi
code
0
github-code
21
[ { "api_name": "cart.cart", "line_number": 12, "usage_type": "name" }, { "api_name": "cart.cart.Cart", "line_number": 12, "usage_type": "call" }, { "api_name": "cart.cart", "line_number": 32, "usage_type": "name" }, { "api_name": "cart.cart", "line_number": 50,...
34248776420
import requests from pprint import pprint import datetime APPID = '7e5e7bb1bbb117bdea9074844d36fc36' url = (f"https://api.openweathermap.org/data/2.5/forecast?lat=43.43&lon=39.91&lang=ru&appid={APPID}&units=metric") weather = requests.get(url).json() today = datetime.date.today() tomorow = today + datetime.timedelta...
Fake0n/Weather
weather.py
weather.py
py
1,276
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 10, "usage_type": "attribute" }, { "api_name": "datetime.timedelta...
40513834842
import discord from discord.ext import commands from discord.player import FFmpegPCMAudio from pytube import YouTube import os class Audio(commands.Cog): def __init__(self, client): self.client = client self.song_path = "/home/runner/WeedyBot2/cogs/" # soundboard self.i...
zxld1337/Weedy-Bot
cogs/audio.py
audio.py
py
4,967
python
en
code
0
github-code
21
[ { "api_name": "discord.ext.commands.Cog", "line_number": 8, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 8, "usage_type": "name" }, { "api_name": "discord.ext.commands.Cog.listener", "line_number": 18, "usage_type": "call" }, { ...
10018851512
import torch import torch.nn as nn import torchvision import torch.nn.functional as F import numpy as np resnet = torchvision.models.resnet.resnet50(pretrained=True) class ConvBlock(nn.Module): """ Helper module that consists of a Conv -> BN -> ReLU """ def __init__(self, in_channels, out_channels, pa...
yudawen/SLCNet
SLCNet.py
SLCNet.py
py
15,293
python
en
code
4
github-code
21
[ { "api_name": "torchvision.models.resnet.resnet50", "line_number": 6, "usage_type": "call" }, { "api_name": "torchvision.models", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_...
40754963843
from datetime import datetime import logging from devices.base import get_device from devices.base import devices class Action: def execute(self): raise NotImplementedError() class SwitchAction(Action): def __init__(self, device, switch): self.device = device self.switch = switch ...
whouweling/yelena
lib/action.py
action.py
py
1,258
python
en
code
1
github-code
21
[ { "api_name": "logging.debug", "line_number": 21, "usage_type": "call" }, { "api_name": "devices.base.get_device", "line_number": 25, "usage_type": "call" }, { "api_name": "devices.base.devices", "line_number": 35, "usage_type": "name" }, { "api_name": "logging.de...
16010089531
import os import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap def prepare_data(df, target_column="y"): X = df.drop(target_column, axis=1) y = df[target_column] return X, y def save_plot(df, model, filename="plot.png", plot_dir = "plots"): #I...
HimGos/Modular-Coding-for-Perceptron
utils/all_utils.py
all_utils.py
py
1,922
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.pyplot.axhline", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 20, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.axvline", "line_number": 21, "usage_type": "call" }, { "api_name": ...
74991349491
import os from gi.repository import Gtk, Gdk, Pango from quodlibet import _ from quodlibet import print_w from quodlibet import qltk from quodlibet.player._base import BasePlayer from quodlibet.qltk.songsmenu import SongsMenu from quodlibet.qltk.x import SeparatorMenuItem, Align from quodlibet.qltk import Icons from ...
quodlibet/quodlibet
quodlibet/qltk/info.py
info.py
py
5,660
python
en
code
1,306
github-code
21
[ { "api_name": "gi.repository.Gtk.EventBox", "line_number": 18, "usage_type": "attribute" }, { "api_name": "gi.repository.Gtk", "line_number": 18, "usage_type": "name" }, { "api_name": "quodlibet._", "line_number": 34, "usage_type": "call" }, { "api_name": "quodlib...
31271212646
from rest_framework.views import APIView from rest_framework.permissions import AllowAny from rest_framework.renderers import JSONRenderer from django.contrib.auth.models import AnonymousUser from django.contrib.auth.models import User from .contrib.unique_none import get_unique_or_none from .serializers import UserSer...
afranjin/q-rest-api
core/views.py
views.py
py
2,324
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.views.APIView", "line_number": 18, "usage_type": "name" }, { "api_name": "rest_framework.permissions.AllowAny", "line_number": 22, "usage_type": "name" }, { "api_name": "rest_framework.renderers.JSONRenderer", "line_number": 23, "usage_type":...
42824872936
from flask import Flask from flask_restx import Api from app.views import index_ns from app.limit import limiter app = Flask(__name__) app.url_map.strict_slashes = False app.config["JSON_AS_ASCII"] = False api = Api( app, version="1.1.0", title="Log tools API", description="Homework 23 with SkyPro's P...
ipotemkin/hw_23
app/app.py
app.py
py
463
python
en
code
0
github-code
21
[ { "api_name": "app.views", "line_number": 6, "usage_type": "name" }, { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "app.views.url_map", "line_number": 7, "usage_type": "attribute" }, { "api_name": "app.views", "line_numbe...
20650818271
from typing import List, Any, Dict, Tuple from fastapi import FastAPI from fastapi.responses import HTMLResponse from fastapi.openapi.docs import get_swagger_ui_html import fastapi.openapi.utils from pydantic import BaseModel from fastapi_versionizer.versionizer import api_version, versionize ICON_URL = 'https://ava...
alexschimpf/fastapi-versionizer
examples/advanced.py
advanced.py
py
3,978
python
en
code
52
github-code
21
[ { "api_name": "pydantic.BaseModel", "line_number": 14, "usage_type": "name" }, { "api_name": "pydantic.BaseModel", "line_number": 18, "usage_type": "name" }, { "api_name": "pydantic.BaseModel", "line_number": 23, "usage_type": "name" }, { "api_name": "typing.List"...
9918264514
import logging def get_logger(name='root'): formatter = logging.Formatter( # fmt='%(asctime)s [%(levelname)s]: %(filename)s(%(funcName)s:%(lineno)s) >> %(message)s') fmt='%(asctime)s [%(levelname)s]: %(message)s', datefmt='%Y-%m-%d %H:%M:%S') handler = logging.StreamHandler() handler.setF...
microsoft/computervision-recipes
utils_cv/tracking/references/fairmot/tracking_utils/log.py
log.py
py
503
python
en
code
9,169
github-code
21
[ { "api_name": "logging.Formatter", "line_number": 5, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.WARNI...
70274502132
import configparser import json import os from git import Repo from prefect import task, Flow from prefect.schedules import Schedule from prefect.schedules.clocks import CronClock @task def load_config() -> dict: config = configparser.ConfigParser() config.read("/home/sidhu/prefect-home-automation/git-push/...
Ashton-Sidhu/prefect-home-automation
git-push/main.py
main.py
py
1,199
python
en
code
5
github-code
21
[ { "api_name": "configparser.ConfigParser", "line_number": 14, "usage_type": "call" }, { "api_name": "prefect.task", "line_number": 11, "usage_type": "name" }, { "api_name": "git.Repo", "line_number": 22, "usage_type": "call" }, { "api_name": "prefect.task", "l...
4985229537
import math from math import pi, cos, sin import cv2 import Utils from Utils import Point2f, Point, RRect from globals import GUI COLOR_SHEEP = (255, 255, 0) def rotate_image_without_cropping(mat, angle): """ see https://stackoverflow.com/questions/22041699/rotate-an-image-without-cropping-in-opencv-in-c/3...
hubere/robosheep
py-vision/VirtualSheep.py
VirtualSheep.py
py
6,378
python
en
code
0
github-code
21
[ { "api_name": "cv2.getRotationMatrix2D", "line_number": 23, "usage_type": "call" }, { "api_name": "math.radians", "line_number": 25, "usage_type": "call" }, { "api_name": "math.sin", "line_number": 26, "usage_type": "name" }, { "api_name": "math.cos", "line_nu...
43466236278
from django.shortcuts import render from django.shortcuts import render, redirect from django.views import View from django.views.generic import TemplateView from .models import Tournament, Participant, Match from .forms import ( TournamentCreationForm, TournamentUpdateForm, ParticipantRegistrationForm, ...
lucas-escobar/d2rlld
core/views.py
views.py
py
7,809
python
en
code
0
github-code
21
[ { "api_name": "django.views.generic.TemplateView", "line_number": 15, "usage_type": "name" }, { "api_name": "models.Tournament.objects.filter", "line_number": 20, "usage_type": "call" }, { "api_name": "models.Tournament.objects", "line_number": 20, "usage_type": "attribut...
73032852213
from __future__ import division, absolute_import import time import types import numbers from itertools import groupby import six import numpy as np from neupy.utils import preformat_value, AttributeKeyDict, as_tuple from neupy.helpers import table from neupy.exceptions import StopTraining from neupy.core.base impor...
LiuFang816/SALSTM_py_data
python/itdxer_neupy/neupy-master/neupy/algorithms/base.py
base.py
py
14,753
python
en
code
9
github-code
21
[ { "api_name": "itertools.groupby", "line_number": 47, "usage_type": "call" }, { "api_name": "neupy.utils.preformat_value", "line_number": 65, "usage_type": "call" }, { "api_name": "neupy.utils.preformat_value", "line_number": 74, "usage_type": "call" }, { "api_nam...
73036471093
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from future import standard_library from future.utils import with_metaclass standard_library.install_aliases() from abc import ABCMeta from abc import abstractmethod from...
LiuFang816/SALSTM_py_data
python/pfnet_chainerrl/chainerrl-master/chainerrl/action_value.py
action_value.py
py
5,303
python
en
code
9
github-code
21
[ { "api_name": "future.standard_library.install_aliases", "line_number": 7, "usage_type": "call" }, { "api_name": "future.standard_library", "line_number": 7, "usage_type": "name" }, { "api_name": "future.utils.with_metaclass", "line_number": 20, "usage_type": "call" }, ...
10997129274
import scipy.io.wavfile as waves from scipy.fft import fft import scipy.fftpack as fftpk import matplotlib.pyplot as plt import numpy as np from tkinter import messagebox def fase4(): try: audio='Sound.wav' fsonido, sonido = waves.read(audio) # Extrae un canal en caso de estéreo ca...
Omar211219/Proyecto-Telecomunicaciones
Fase4.pyw
Fase4.pyw
pyw
1,543
python
es
code
0
github-code
21
[ { "api_name": "scipy.io.wavfile.read", "line_number": 11, "usage_type": "call" }, { "api_name": "scipy.io.wavfile", "line_number": 11, "usage_type": "name" }, { "api_name": "numpy.arange", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.cumsum", ...
14535227005
import json from deepdiff import DeepDiff from ec2mc import consts from ec2mc.utils import aws from ec2mc.utils import os2 from ec2mc.utils.base_classes import ComponentSetup class IAMPolicySetup(ComponentSetup): def __init__(self, config_aws_setup): self._iam_client = aws.iam_client() self._poli...
TakingItCasual/ec2mc
ec2mc/commands/aws_setup_sub/iam_policies.py
iam_policies.py
py
8,506
python
en
code
0
github-code
21
[ { "api_name": "ec2mc.utils.base_classes.ComponentSetup", "line_number": 9, "usage_type": "name" }, { "api_name": "ec2mc.utils.aws.iam_client", "line_number": 12, "usage_type": "call" }, { "api_name": "ec2mc.utils.aws", "line_number": 12, "usage_type": "name" }, { ...
18285490590
from environment import Environment from snake_agent import Agent import tensorflow as tf import numpy as np from tensorflow.keras.models import load_model import time import pygame #import os #os.environ["CUDA_VISIBLE_DEVICES"]="-1" ENV_WIDTH = 500 ENV_ROWS = 6 episodes = 100000 GROW = 100000 wall = 0 itself = ...
capitanu/ID1214
qlearn.py
qlearn.py
py
2,912
python
en
code
0
github-code
21
[ { "api_name": "environment.Environment", "line_number": 27, "usage_type": "call" }, { "api_name": "snake_agent.Agent", "line_number": 28, "usage_type": "call" }, { "api_name": "environment.Environment", "line_number": 68, "usage_type": "call" }, { "api_name": "tim...
41186404877
from flask import Flask from flask import send_file from flask import request from flask import flash from flask import redirect import os import datetime import random from object_detection import object_detection app = Flask(__name__) UPLOAD_FOLDER = "files_reception/" CALCULATED_FOLDER = "calculated_ima...
Nooaah/machine-learning-coin-counter-app
server/src/server.py
server.py
py
2,343
python
en
code
6
github-code
21
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 34, "usage_type": "call" }, { "api_name": "datetime.datetime", ...
27641835056
#!/usr/bin/env python3 import click from src.file_uploading import FileUploading import sys sys.tracebacklimit = 0 @click.command() @click.option("--file", required=True) @click.option("--issue_key", required=True) @click.option("--user", required=True, help="You can find user name on the page https://...
atlassian-labs/transfer-api-ref-client
app.py
app.py
py
741
python
en
code
6
github-code
21
[ { "api_name": "sys.tracebacklimit", "line_number": 7, "usage_type": "attribute" }, { "api_name": "src.file_uploading.FileUploading", "line_number": 18, "usage_type": "call" }, { "api_name": "click.command", "line_number": 9, "usage_type": "call" }, { "api_name": "...
8179585533
# coding: utf-8 import time import numpy as np from scipy.optimize import linear_sum_assignment from tqdm import tqdm class BipartiteGraphSolver: solver = linear_sum_assignment @staticmethod def find_min(cost_matrix): row_ind, col_ind = BipartiteGraphSolver.solver(cost_matrix) sum_cost ...
microsoft/ContextualSP
interactive_text_to_sql/src/utils/algo_utils.py
algo_utils.py
py
1,169
python
en
code
348
github-code
21
[ { "api_name": "scipy.optimize.linear_sum_assignment", "line_number": 11, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 28, "usage_type": "call" }, { "api_name": "time.time", "line_number": 29, "usage_type": "call" }, { "api_name": "tqdm.tqdm"...
10128331908
import chess class Game: def __init__(self, white, black, max, display): self.white_player = white self.black_player = black self.max_moves = max self.display_on = display self.result = -1 self.move = 1 def create_game(self): # create board object ...
LattiVuitton/chess
Pre_Node/Python/GameRunner.py
GameRunner.py
py
2,439
python
en
code
1
github-code
21
[ { "api_name": "chess.Board", "line_number": 14, "usage_type": "call" } ]
1453601071
# 你写出一个秘密数字,并请朋友猜这个数字是多少。 # 朋友每猜测一次,你就会给他一个提示,告诉他的猜测数字中有多少位属于数字和确切位置都猜对了(称为“Bulls”, 公牛),有多少位属于数字猜对了但是位置不对(称为“Cows”, 奶牛)。 # 朋友根据提示继续猜,直到猜出秘密数字。 # 请写出一个根据秘密数字和朋友的猜测数返回提示的函数,返回字符串的格式为 xAyB ,x 和 y 都是数字,A 表示公牛,用 B 表示奶牛。 # # xA 表示有 x 位数字出现在秘密数字中,且位置都与秘密数字一致。 # yB 表示有 y 位数字出现在秘密数字中,但位置与秘密数字不一致。 # 请注意秘密数字和朋友的猜测数都可能含有重复数字,每位数字只...
nexusme/leetcode_try
LeetCode/getHint.py
getHint.py
py
1,988
python
zh
code
1
github-code
21
[ { "api_name": "collections.Counter", "line_number": 38, "usage_type": "call" } ]
38341272577
from os import path import random import secrets from PIL import Image, ImageFont, ImageDraw from app import create_app from app.models.user import User from app.utils.tasks import huey width = 480 height = 480 font_size = 260 colors = [ [ (23, 126, 137, 255), (255, 255, 255, 140) ], [ ...
jnsdrtlf/et
app/utils/tasks/picture.py
picture.py
py
1,689
python
en
code
0
github-code
21
[ { "api_name": "app.create_app", "line_number": 40, "usage_type": "call" }, { "api_name": "app.app_context", "line_number": 42, "usage_type": "call" }, { "api_name": "app.models.user.User", "line_number": 43, "usage_type": "argument" }, { "api_name": "app.models.us...
37394588942
""" Step Implementer for the deploy step for ArgoCD. Step Configuration ------------------ Step configuration expected as input to this step. Could come from either configuration file or from runtime configuration. | Configuration Key | Required? | Default | Description |---------------...
shaneboulden/tssc-python-package
tssc/step_implementers/deploy/argocd.py
argocd.py
py
27,104
python
en
code
null
github-code
21
[ { "api_name": "tssc.StepImplementer", "line_number": 152, "usage_type": "name" }, { "api_name": "sh.argocd.login", "line_number": 219, "usage_type": "call" }, { "api_name": "sh.argocd", "line_number": 219, "usage_type": "attribute" }, { "api_name": "sys.stdout", ...
11786595767
import numpy as np from utils import get_test_alpaca_no_act_order_model, set_seeds import pytest import multiprocessing as mp def inner_cuda_forwardpass_no_act_order(flash_attn, mm4b_faster_mode, use_cache): """ Since we do monkey patching - we can not run, for instance: 1. test with flash-attention patc...
johnsmith0031/alpaca_lora_4bit
tests/test_cuda_generation.py
test_cuda_generation.py
py
4,217
python
en
code
496
github-code
21
[ { "api_name": "alpaca_lora_4bit.monkeypatch.llama_flash_attn_monkey_patch.replace_llama_attn_with_flash_attn", "line_number": 24, "usage_type": "call" }, { "api_name": "alpaca_lora_4bit.autograd_4bit.switch_backend_to", "line_number": 26, "usage_type": "call" }, { "api_name": "al...
24824409758
# -*- coding: utf-8 -*- """Unit tests for PubChem API usage.""" from itertools import islice from datetime import date from commongroups import pubchemutils as pc CIDS_WITH_CAS = [311, 2244] # The following might need to be changed if CASRNS are eventually added # to these compounds records. CIDS_WITHOUT_CAS = [1362...
akokai/commongroups-archived
commongroups/tests/test_pubchemutils.py
test_pubchemutils.py
py
1,702
python
en
code
1
github-code
21
[ { "api_name": "commongroups.pubchemutils.get_creation_date", "line_number": 18, "usage_type": "call" }, { "api_name": "commongroups.pubchemutils", "line_number": 18, "usage_type": "name" }, { "api_name": "datetime.date", "line_number": 20, "usage_type": "call" }, { ...
28706327240
from django.urls import path, include from django.conf import settings from django.conf.urls.static import static from . import views urlpatterns = [ path("", views.flux, name='flux'), path('quitter/', views.logout_user, name='logout_user'), path('create_review/', views.create_review, name='create_review'...
Satupathe/OC-P9-AG
livrables/flux/urls.py
urls.py
py
687
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", ...
17124927755
import ast import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages as pdf import statistics import os import page.views def readOutput(): # remove when we connect to pose estimation file = open("front_on.txt", "r") contents = file.read() dictionary = ast.literal_eval(contents...
tandi-c/3820ICT_P2-Work-Integrated-Learning-Part-2
intelligait_app/tf_pose_estimation/gait_analysis.py
gait_analysis.py
py
3,792
python
en
code
0
github-code
21
[ { "api_name": "ast.literal_eval", "line_number": 12, "usage_type": "call" }, { "api_name": "statistics.mean", "line_number": 37, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.gca", "line_number": 44, "usage_type": "call" }, { "api_name": "matplotlib.pyp...
42122403648
from PyQt5.QtWidgets import QApplication from PyQt5.QtCore import Qt def setting(self): # 获取显示器分辨率大小 self.screen_rect = QApplication.desktop().screenGeometry() self.screen_height = self.screen_rect.height() self.screen_width = self.screen_rect.width() self.setGeometry((self.screen_width - self.wid...
YuanXianguo/Python-Project-ITC
demo/settings.py
settings.py
py
756
python
zh
code
1
github-code
21
[ { "api_name": "PyQt5.QtWidgets.QApplication.desktop", "line_number": 7, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QApplication", "line_number": 7, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.Qt.ApplicationModal", "line_number": 14, "usage_type": "attr...
28644454725
"""memocards URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-bas...
alexvydrin/memocards
memocards/urls.py
urls.py
py
2,482
python
en
code
3
github-code
21
[ { "api_name": "django.urls.path", "line_number": 22, "usage_type": "call" }, { "api_name": "mainapp.views.TagsListView.as_view", "line_number": 22, "usage_type": "call" }, { "api_name": "mainapp.views.TagsListView", "line_number": 22, "usage_type": "attribute" }, { ...
134858257
from sattrack.sgp4 import TwoLineElement import requests __all__ = ('TwoLineElement', "getTle") _CELESTRAK_URL = "https://celestrak.com/NORAD/elements/gp.php?{}={}&FORMAT=TLE" def getTle(value: str, query: str = 'name') -> TwoLineElement | None: """ Retrieves a TLE from the Celestrak online repository of ...
qbizzle68/sattrack
src/sattrack/tle.py
tle.py
py
2,019
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 28, "usage_type": "call" }, { "api_name": "sattrack.sgp4.TwoLineElement", "line_number": 34, "usage_type": "call" }, { "api_name": "sattrack.sgp4.TwoLineElement", "line_number": 48, "usage_type": "call" }, { "api_name":...
22292767366
import cv2 import socket from matplotlib import pyplot as plt from static_functions import * from tkinter import * from tkinter import filedialog from PIL import Image from PIL import ImageTk import imutils face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml') eye_casca...
JoaquinIMT/Investigacion-eye-tracker
ENTREGABLE_2.py
ENTREGABLE_2.py
py
13,585
python
en
code
0
github-code
21
[ { "api_name": "cv2.CascadeClassifier", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.data", "line_number": 14, "usage_type": "attribute" }, { "api_name": "cv2.CascadeClassifier", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.data", ...
27710817597
import pyarrow as pa from pathlib import Path, PurePath import typing from fletcherfiltering.common.helpers.struct_type_mapper import StructTypeMapper import re import struct from fletcherfiltering import settings import bitstring import math class XSIMOutputReader(): def __init__(self, in_schema: pa.Schema, out_...
abs-tudelft/FletcherFiltering
tests/helpers/xsim_output_reader.py
xsim_output_reader.py
py
9,650
python
en
code
1
github-code
21
[ { "api_name": "pyarrow.Schema", "line_number": 13, "usage_type": "attribute" }, { "api_name": "fletcherfiltering.settings.LENGTH_SUFFIX", "line_number": 18, "usage_type": "attribute" }, { "api_name": "fletcherfiltering.settings", "line_number": 18, "usage_type": "name" ...
14419944453
import uuid from datetime import datetime, time from django.conf import settings from django.db.backends.base.operations import BaseDatabaseOperations from django.db.backends import utils from django.utils.functional import cached_property from django.utils import six from django.utils import timezone from django.uti...
jnekolny/my-first-blog
myvenv/Lib/site-packages/firebird/operations.py
operations.py
py
18,253
python
en
code
0
github-code
21
[ { "api_name": "django.db.backends.base.operations.BaseDatabaseOperations", "line_number": 16, "usage_type": "name" }, { "api_name": "base.Database.SHRT_MIN", "line_number": 22, "usage_type": "attribute" }, { "api_name": "base.Database", "line_number": 22, "usage_type": "n...
45567788104
__author__ = 'Luca' '''///////////////////////////////////////////////////////////////////////////// // brief Stored JSON handler Functions // // author Luca Petricca // // date 22.09.2015 // // par Copyright: The MIT License (MIT) //Copyright (c) 2016 Broentech Solutions A.S., Norway // //Permiss...
Broentech/PyGateway
stored_jsonhandler.py
stored_jsonhandler.py
py
5,184
python
en
code
2
github-code
21
[ { "api_name": "utility.CONTINUE_RUNNING", "line_number": 37, "usage_type": "attribute" }, { "api_name": "datahandler.NumStoredjson", "line_number": 39, "usage_type": "attribute" }, { "api_name": "os.path.isfile", "line_number": 40, "usage_type": "call" }, { "api_n...
34226887891
#! python # Based on script created by Aleksei Wan on 13.11.2019 # Adapted for use in this project by Aleksei Wan # Imports import os import sys import json from argparse import ArgumentParser import lightgbm as lgbm import numpy as np def train_lgbm_model(params, training_data, validation_data=None, save_model_pat...
alewan/aps360project
lightgbm/train_lightgbm_tree.py
train_lightgbm_tree.py
py
4,049
python
en
code
0
github-code
21
[ { "api_name": "lightgbm.train", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.argsort", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.argmax", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.array", "line_num...
16113073582
import sys import math from PyQt5.QtWidgets import QApplication, QMainWindow, QWidget, \ QPushButton, QVBoxLayout, QHBoxLayout from PyQt5.QtCore import Qt, QTimer, QSize from PyQt5.QtGui import QPixmap, QIcon from PyQt5 import QtCore import pyqtgraph as pg import random class Plotter(QMainWindow): def __init_...
god233012yamil/python_curve_plotter
main.py
main.py
py
9,565
python
en
code
0
github-code
21
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 12, "usage_type": "name" }, { "api_name": "pyqtgraph.setConfigOption", "line_number": 35, "usage_type": "call" }, { "api_name": "pyqtgraph.setConfigOptions", "line_number": 38, "usage_type": "call" }, { "...
22876411377
from datetime import datetime, timedelta, timezone from sys import stdout import geopandas as gpd import pandas as pd import plotly.graph_objects as go from dominate import document from dominate.tags import ( a, button, div, h1, h4, h6, header, html, img, li, link, meta...
painelcovid19/painelcovid19.github.io
scripts/main.py
main.py
py
31,126
python
en
code
5
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 32, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 33, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 34, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
10086080077
import sys,time,os,traceback,json from functools import partial import pandas as pd import serial import serial.tools.list_ports from PySide6 import QtCore, QtWidgets from PySide6.QtCore import QSize, Qt, QThread, QTimer, Signal, Slot,QUrl from PySide6.QtGui import (QAction, QDoubleValidator, QIcon, QIntValidator, ...
zlmturnout/ARPES_BeamSpotSize
BeamSizeScan_ARPES.py
BeamSizeScan_ARPES.py
py
47,076
python
en
code
0
github-code
21
[ { "api_name": "os.getcwd", "line_number": 41, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 43, "usage_type": "call" }, { "api_name": "os.path", "line_number": 43, "usage_type": "attribute" }, { "api_name": "toolbox.Tools_functions.createPat...
39795669406
from __future__ import absolute_import, division, print_function, unicode_literals import random import aiml import nltk import numpy as np import sklearn import string ##import wikipediaapi import json, requests from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics.pairwise import cosine_sim...
ALangsdale-Foster/Artificial_Intelligence_Assignment-27-03-20
finishedChatBot.py
finishedChatBot.py
py
27,824
python
en
code
0
github-code
21
[ { "api_name": "tensorflow.__version__", "line_number": 25, "usage_type": "attribute" }, { "api_name": "gym.make", "line_number": 34, "usage_type": "call" }, { "api_name": "tensorflow.layers.Dense", "line_number": 42, "usage_type": "call" }, { "api_name": "tensorfl...
42256890199
#-*- coding:utf-8 -*- import maya.cmds as cmds def createWindow(): if cmds.window('MeshLightSetter',ex=True): cmds.deleteUI('MeshLightSetter') cmds.window('MeshLightSetter',t='MeshLight Setter',w=600,h=800) cmds.rowLayout(nc=2) cmds.frameLayout(l='aiTranslatorAttributes',w=450) cmds.formL...
onexeno/Maya_Scripts
setMeshLight.py
setMeshLight.py
py
14,450
python
en
code
0
github-code
21
[ { "api_name": "maya.cmds.window", "line_number": 6, "usage_type": "call" }, { "api_name": "maya.cmds", "line_number": 6, "usage_type": "name" }, { "api_name": "maya.cmds.deleteUI", "line_number": 7, "usage_type": "call" }, { "api_name": "maya.cmds", "line_numb...
512801272
from django.forms import formset_factory from django.http import HttpResponseRedirect from django.shortcuts import render # Create your views here. # редактировать оборудование from two.forms import MoveEquipmentForm, MoveMaterialForm, MoveDetailForm, EquipmentForm from two.models import Equipment def subdict(form,...
null
two/views.py
views.py
py
1,429
python
en
code
null
code-starcoder2
83
[ { "api_name": "two.models.Equipment.objects.all", "line_number": 18, "usage_type": "call" }, { "api_name": "two.models.Equipment.objects", "line_number": 18, "usage_type": "attribute" }, { "api_name": "two.models.Equipment", "line_number": 18, "usage_type": "name" }, ...
647764279
import json from rest_framework import viewsets from rest_framework import status from rest_framework.response import Response from django.http import HttpResponse, HttpResponseBadRequest from .models import * from . import serializers from . import filters class OrderViewSet(viewsets.ModelViewSet): queryset =...
null
FlipZonApp/orderapp/viewsets.py
viewsets.py
py
2,660
python
en
code
null
code-starcoder2
83
[ { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 14, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 14, "usage_type": "name" }, { "api_name": "django.http.HttpResponseBadRequest", "line_number": 33, "usage_type": "...
608317201
#!/usr/bin/python3 import dash import dash_core_components as dcc import dash_html_components as html import dash_bootstrap_components as dbc import dash_table import email import glob import os import pandas as pd import shutil import smtplib import ssl import time import yfinance as yf from django.http import HttpR...
null
stock_report.py
stock_report.py
py
5,988
python
en
code
null
code-starcoder2
83
[ { "api_name": "shutil.rmtree", "line_number": 38, "usage_type": "call" }, { "api_name": "os.mkdir", "line_number": 39, "usage_type": "call" }, { "api_name": "yfinance.Ticker", "line_number": 59, "usage_type": "call" }, { "api_name": "time.sleep", "line_number"...
332102042
import torch import numpy as np import pandas as pd import matplotlib.pyplot as plt class Evaluation(object): def __init__(self, args, device, agent, model): super(Evaluation, self).__init__() self.args = args self.device = device self.agent = agent self.model = model if args.mode == 'valid': self....
null
experiment/combineDDPG/kaggle/evaluate.py
evaluate.py
py
3,684
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_pickle", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.read_pickle", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.tensor", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.float32", ...
234906493
# As seen in Hay2011 # Just to setup. The actual values are set up after model building. # Calcium pool decay and conversion from calcium current to concentration. # set moose.element('/model/elec/soma/Ca_conc').B = 10000*gamma/(2*F*depth)*1e4/(sm_area) where default gamma=0.05 and depth=0.1 import numpy as np i...
null
Kinetics/Ca_Conc_(Hay2011).py
Ca_Conc_(Hay2011).py
py
757
python
en
code
null
code-starcoder2
83
[ { "api_name": "moose.CaConc", "line_number": 12, "usage_type": "call" } ]
298409207
import requests as reqs from googlesearch import search from bs4 import BeautifulSoup import html5lib #gets desired url def get_url(): print() place = input("Enter a location in the U.S. (city + state or ZIP code): ") query = place + " site:weather.gov" URL = "" for j in search(query, tl...
null
weather.py
weather.py
py
1,788
python
en
code
null
code-starcoder2
83
[ { "api_name": "googlesearch.search", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 28, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 29, "usage_type": "call" } ]
173432174
import numpy as np from zquantum.core.gradients import finite_differences_gradient from zquantum.core.interfaces.functions import FunctionWithGradient from zquantum.core.interfaces.optimizer_test import ( OptimizerTests, rosenbrock_function, sum_x_squared, ) from .scipy_optimizer import ScipyOptimizer impor...
null
src/python/zquantum/optimizers/scipy_optimizer_test.py
scipy_optimizer_test.py
py
2,302
python
en
code
null
code-starcoder2
83
[ { "api_name": "scipy_optimizer.ScipyOptimizer", "line_number": 21, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 13, "usage_type": "call" }, { "api_name": "zquantum.core.interfaces.optimizer_test.OptimizerTests", "line_number": 24, "usage_type": "...
634461133
#!/usr/bin/python # -*- coding: utf-8 -*- """ Clear database tables. """ from optparse import OptionParser import gluon.main # Sets up logging import logging VERSION = '0.1' LOG = logging.getLogger('app') # Sort tables so those that reference others are first TABLES = [ 'postal_code', 'city',...
null
private/bin/misc/clear_db.py
clear_db.py
py
1,576
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "optparse.OptionParser", "line_number": 53, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 66, "usage_type": "call" }, { "api_name": "logging...
64282867
import os, sys, json, time, copy import subprocess import argparse # import signal # import shutil ''' run tests from tests dir: nbx/tests>pytest -vv [filename] or run: (venvtest1) nbx/tests/> python test_integration.py [--no-tear-down] --no-tear-down : leave directory and notebooks + serv...
null
tests/test_integration.py
test_integration.py
py
4,588
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.getcwd", "line_number": 64, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 67, "usage_type": "call" }, { "api_name": "os.path", "line_number": 67, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number":...
613547417
import torch class PoseModel(torch.nn.Module): def __init__(self): super(PoseModel, self).__init__() self.conv1 = torch.nn.Conv2d(1, 11, 3, 1, 0, bias=True); self.mp1 = torch.nn.MaxPool2d(2) self.conv2 = torch.nn.Conv2d(11,33,3, 1,0, bias=True) self.mp2 = torch.nn.MaxPool...
null
model.py
model.py
py
1,424
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn.Conv2d", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn.MaxPool2d", "li...
201540009
# coding: utf-8 """ Create on 2018/10/31 @author:hexiaosong """ from keras.applications import VGG16 from keras import models,layers from keras.callbacks import TensorBoard from keras.preprocessing.image import ImageDataGenerator train_dir="/Users/apple/Downloads/catvsdog/train" test_dir="/Users/apple/Downloads/catv...
null
catvsdog/train.py
train.py
py
1,702
python
en
code
null
code-starcoder2
83
[ { "api_name": "keras.preprocessing.image.ImageDataGenerator", "line_number": 16, "usage_type": "call" }, { "api_name": "keras.preprocessing.image.ImageDataGenerator", "line_number": 25, "usage_type": "call" }, { "api_name": "keras.applications.VGG16", "line_number": 30, "...
587999238
import numpy as np import librosa from preprocessing import * from similarity_analysis import * from utils import downsampled_average def main(file_path, title, excerpt_lengths: list, weights=None, show=True): """ Perform computations for a specified audio file. :param file_path: Path of the a...
null
main.py
main.py
py
2,198
python
en
code
null
code-starcoder2
83
[ { "api_name": "librosa.load", "line_number": 50, "usage_type": "call" }, { "api_name": "utils.downsampled_average", "line_number": 51, "usage_type": "call" } ]
587644533
import win32api as win,pyautogui as py,time as t,pygame as p import keyboard as key from __init__ import* p.init() clock = p.time.Clock() def sleep(num_press): waiting = True timer = 2*50 while waiting: if key.is_pressed("escape"): print("skipping user...") return ...
null
Sleep.py
Sleep.py
py
585
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.time.Clock", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 5, "usage_type": "attribute" }, { "api_name": "keyboard.is_pressed", ...
351114556
from django.db import models from django.contrib.auth.models import User from django.db.models.signals import post_save class UserProfile(models.Model): user = models.OneToOneField(User) dispalay_picture = models.ImageField() name_of_ministry = models.CharField(max_length=100) status ...
null
rapture/posts/models.py
models.py
py
1,042
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.models.Model", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 10, "usage_type": "name" }, { "api_name": "django.db.models.OneToOneField", "line_number": 11, "usage_type": "call" }, { "api_n...
5466317
''' David Fuller Food class - Handles the Food object. 10-18-2017 ''' import pygame from .Constants import black, fill class Processing(object): ''' Sets up a Processing class ''' def __init__(self, screen): ''' Processing's init method. initializes Processing variable...
null
app/processing/Processing.py
Processing.py
py
6,034
python
en
code
null
code-starcoder2
83
[ { "api_name": "Constants.black", "line_number": 30, "usage_type": "name" }, { "api_name": "Constants.black", "line_number": 32, "usage_type": "name" }, { "api_name": "pygame.draw.line", "line_number": 96, "usage_type": "call" }, { "api_name": "pygame.draw", "l...
510485621
from collections import deque def find_consecutive_runs(values, run_length=3, step=1): """ Find all runs of three consecutive numbers that increase or decrease by one. Return the start indices of the first element in each run. If there are no consecutive runs, None will be returned. Exampl...
null
samples/fcr47.py
fcr47.py
py
3,442
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.deque", "line_number": 22, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 61, "usage_type": "attribute" }, { "api_name": "unittest.main", "line_number": 100, "usage_type": "call" } ]
455611338
import sys import time import json from PyQt5.QtCore import * from PyQt5.QtCore import QTime from PyQt5.QtGui import * from PyQt5.QtWidgets import QApplication, QDialog, QTextBrowser, QLineEdit, \ QVBoxLayout, QHBoxLayout, QGridLayout, QFileDialog, QDialogButtonBox, QFrame, \ QCheckBox, QComboBox, QDateEdit, Q...
null
gooey/examples/thing.py
thing.py
py
6,981
python
en
code
null
code-starcoder2
83
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 32, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 46, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 47, "usage_type": "call" }, { "api_name": ...
252899205
import arcpy import csv from collections import defaultdict def find_state_field(feature_state): field_names = [f.name for f in arcpy.ListFields(feature_state)] state_field = "GPS_STATE" if "GPS_STATE" not in field_names: state_field = "WORKAREASTATE" if "WORKAREASTATE" not in field_names:...
null
migration/CheckoutCommon.py
CheckoutCommon.py
py
2,741
python
en
code
null
code-starcoder2
83
[ { "api_name": "arcpy.ListFields", "line_number": 7, "usage_type": "call" }, { "api_name": "arcpy.Exists", "line_number": 17, "usage_type": "call" }, { "api_name": "arcpy.ListFields", "line_number": 20, "usage_type": "call" }, { "api_name": "arcpy.env", "line_n...
341086239
import requests import json def whatsApp(): return "what's up Yo" def getAttractions(city, attractions): url = "https://maps.googleapis.com/maps/api/place/textsearch/json?query=" API_KEY = "AIzaSyDJf6XiNsSQzWe-QXY_gT1yfa01W5PryZs" attractionList = attractions myCity = city queryStr = "" if...
null
TravelApp/Attraction.py
Attraction.py
py
1,761
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 28, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 29, "usage_type": "call" } ]
587003994
#!/usr/bin/python3 # coding: utf-8 import torch from torch.utils import data from torchvision import datasets, transforms ################################################################## ## Pytorch 的数据读取主要包含三个类: # Dataset # DataLoader # DataLoaderIter # 这三者大致是一个依次封装的关系: 1. 被装进 2., 2. 被装进 3. ##########################...
null
bin/template/src/jptpytorch/l6_torch-utils.py
l6_torch-utils.py
py
3,248
python
en
code
null
code-starcoder2
83
[ { "api_name": "torchvision.transforms.Compose", "line_number": 18, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 18, "usage_type": "name" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 18, "usage_type": "call" }, { ...
204960883
import os from PIL import Image import torch from torch.autograd import Variable from torchvision import transforms from torchvision.utils import save_image from config import * from facades import get_facades_loader from models import Generator from utils import make_dirs, make_gifs_test device = 'cuda...
null
pth_vid_demo.py
pth_vid_demo.py
py
2,376
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.cuda.is_available", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 14, "usage_type": "attribute" }, { "api_name": "utils.make_dirs", "line_number": 20, "usage_type": "call" }, { "api_name": "config.infere...
223294485
import os import logging from hdbcli import dbapi import pandas as pd import numpy as np from sklearn import model_selection import joblib # from tensorflow import gfile import pickle from trainer import metadata from google.cloud import storage from fedml_gcp import DbConnection from sklearn.model_selection import ...
null
GCP/sample-notebooks/LinearRegression/LinearRegression/trainer/utils.py
utils.py
py
2,793
python
en
code
null
code-starcoder2
83
[ { "api_name": "google.cloud.storage.Client", "line_number": 21, "usage_type": "call" }, { "api_name": "google.cloud.storage", "line_number": 21, "usage_type": "name" }, { "api_name": "logging.info", "line_number": 27, "usage_type": "call" }, { "api_name": "pickle....
298381118
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
null
sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models_py3.py
_models_py3.py
py
75,333
python
en
code
null
code-starcoder2
83
[ { "api_name": "msrest.serialization.Model", "line_number": 16, "usage_type": "name" }, { "api_name": "msrest.serialization.Model", "line_number": 36, "usage_type": "name" }, { "api_name": "msrest.serialization.Model", "line_number": 74, "usage_type": "name" }, { "...
409927391
import sys import matplotlib.pyplot as plt import numpy as np if len(sys.argv) > 1: vm = 20 fm = 0.5 vp = 5 fp = 5 else: inp = input("Ingrese el voltaje de la moduladora: \n") try: vm = float(inp) except ValueError: print("Ingrese un numero valido") sys.exit() in...
null
fm.py
fm.py
py
1,761
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.argv", "line_number": 5, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 22, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 28, ...
393174599
import json from casing import cluster_manager import jinja2 import os import webapp2 import logging from google.appengine.ext import deferred JINJA_ENVIRONMENT = jinja2.Environment( loader=jinja2.FileSystemLoader(os.path.dirname(__file__)), extensions=['jinja2.ext.autoescape'], autoescape=True) class...
null
main.py
main.py
py
3,960
python
en
code
null
code-starcoder2
83
[ { "api_name": "jinja2.Environment", "line_number": 12, "usage_type": "call" }, { "api_name": "jinja2.FileSystemLoader", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", ...
570503547
# USAGE # python object_size.py --image images/example_01.png --width 0.955 # python object_size.py --image images/example_02.png --width 0.955 # python object_size.py --image images/example_03.png --width 3.5 from scipy.spatial import distance as dist from imutils import perspective from imutils import contours impor...
null
Dev/cargo_dimension/api/utils/DimensionCalculator.py
DimensionCalculator.py
py
5,918
python
en
code
null
code-starcoder2
83
[ { "api_name": "Point.Point", "line_number": 19, "usage_type": "call" }, { "api_name": "Point.Point", "line_number": 20, "usage_type": "call" }, { "api_name": "Point.Point", "line_number": 21, "usage_type": "call" }, { "api_name": "Point.Point", "line_number": ...
448089000
import random import time import pandas as pd import numpy as np from matplotlib import pyplot as plt from DataProcess import wrangle as wr from DataProcess import datasets as ds from DataProcess import display as disp from Model_Maker import modeler as mm from keras.layers import Dense, Input, Concatenate, Flatte...
null
ex_nets/predict_markets/predict_markets6.py
predict_markets6.py
py
9,224
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 22, "usage_type": "call" }, { "api_name": "DataProcess.wrangle.get_cols", "line_number": 25, "usage_type": "call" }, { "api_name": "DataProcess.wrangle", "line_number": 25, "usage_type": "name" }, { "api_name": "Data...
124048191
import re import sys import requests from PySide6.QtCore import ( QObject, QRunnable, QThreadPool, QTimer, Signal, Slot, ) from PySide6.QtWidgets import ( QApplication, QLabel, QMainWindow, QPlainTextEdit, QPushButton, QVBoxLayout, QWidget, ) class WorkerSignals(QO...
null
pyside6-source/concurrent/qrunnable_io_parser.py
qrunnable_io_parser.py
py
2,885
python
en
code
null
code-starcoder2
83
[ { "api_name": "PySide6.QtCore.QObject", "line_number": 24, "usage_type": "name" }, { "api_name": "PySide6.QtCore.Signal", "line_number": 32, "usage_type": "call" }, { "api_name": "PySide6.QtCore.QRunnable", "line_number": 35, "usage_type": "name" }, { "api_name": ...
48151387
from django.urls import path,include from . import views app_name="neox_medipip_core" urlpatterns=[ #================================================ #LANDING PAGES #================================================ path('',views.landing_page_index,name='landing_page_index'), path('about/',views.landing_page...
null
neox_medipip/neox_medipip_core/urls.py
urls.py
py
1,548
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 13, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 14, "usage_type": "call" }, { "api_name": "django.urls.path",...
120066287
import numpy as np from sklearn.covariance import EllipticEnvelope from sklearn.datasets import make_blobs X, _ = make_blobs(n_samples=10, n_features=2, centers=1, random_state=1) X[0,0] = 10000 X[0,1] = 10000 outliner_detector = EllipticEnvelope(contamination=.1...
null
Machine-Learning/Preprocessing-Structured-Data/code/Detecting-Outliers.py
Detecting-Outliers.py
py
384
python
en
code
null
code-starcoder2
83
[ { "api_name": "sklearn.datasets.make_blobs", "line_number": 5, "usage_type": "call" }, { "api_name": "sklearn.covariance.EllipticEnvelope", "line_number": 13, "usage_type": "call" } ]
537002560
#============================================================================== # 2. Manually split your data, creating a training set consisting of the first 80% of entries and a test set for the remaining 20% # 3. Change your model.fit and model.evaluate calls to use the training and test sets respectively #======...
null
ANN workshop2/Split80percent.py
Split80percent.py
py
1,739
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.random.seed", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.loadtxt", "line_number": 15, "usage_type": "call" }, { "api_name": "keras.models.Sequen...
181422923
from __future__ import absolute_import import sys import os import six from . import types from .schema import Settings, Value, DictValue, StaticValue class BaseDjangoSettings(Settings): SECRET_KEY = Value(str) DEBUG = Value(types.boolean, default=False) ALLOWED_HOSTS = Value(types.list(str), default=t...
null
coolfig/django.py
django.py
py
2,171
python
en
code
null
code-starcoder2
83
[ { "api_name": "schema.Settings", "line_number": 12, "usage_type": "name" }, { "api_name": "schema.Value", "line_number": 13, "usage_type": "call" }, { "api_name": "schema.Value", "line_number": 14, "usage_type": "call" }, { "api_name": "schema.Value", "line_nu...
627367338
""" threefive.Cue Class """ from base64 import b64decode import json from sys import stderr from .section import SpliceInfoSection from .commands import command_map from .descriptors import splice_descriptor class Cue: """ The threefive.Splice class handles parsing SCTE 35 message strings. Example usa...
null
threefive/cue.py
cue.py
py
5,603
python
en
code
null
code-starcoder2
83
[ { "api_name": "section.SpliceInfoSection", "line_number": 31, "usage_type": "call" }, { "api_name": "descriptors.splice_descriptor", "line_number": 66, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 105, "usage_type": "call" }, { "api_name": "b...
200464032
""" This file contains unit tests for bonsai config library. """ import os import tempfile from unittest import TestCase try: from unittest.mock import patch except ImportError: from mock import patch from six.moves.configparser import ConfigParser from bonsai_config import BonsaiConfig class TestBrainConfi...
null
bonsai_config/test_bonsai_config.py
test_bonsai_config.py
py
3,338
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 17, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "tempfile.gettempdir", ...
577261230
# Copyright 2015 Leon Sixt # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, sof...
null
deepdecoder/mask_loss.py
mask_loss.py
py
20,427
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 45, "usage_type": "call" }, { "api_name": "os.path", "line_number": 45, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 45, "usage_type": "call" }, { "api_name": "theano.sandbox.cuda.basic_o...
28924321
from pathlib import Path import requests from Crypto.Cipher import AES import httpx from utils import ts2mp4 def add_to_16(value): while len(value) % 16 != 0: value += '\0' return str.encode(value) def decrypt(ciphertext, key): iv = ciphertext[:AES.block_size] cipher = AES.new(key, AES.MOD...
null
downloader.py
downloader.py
py
2,790
python
en
code
null
code-starcoder2
83
[ { "api_name": "Crypto.Cipher.AES.block_size", "line_number": 17, "usage_type": "attribute" }, { "api_name": "Crypto.Cipher.AES", "line_number": 17, "usage_type": "name" }, { "api_name": "Crypto.Cipher.AES.new", "line_number": 18, "usage_type": "call" }, { "api_nam...
264382502
# -*- coding: utf-8 -*- """ Created on Fri Jul 15 12:25:40 2016 @author: Luciano Masullo, Federico Barabas """ import os import time import math import numpy as np from scipy import ndimage as ndi import tifffile as tiff from PIL import Image import matplotlib.pyplot as plt import pyqtgraph as pg from pyqtgraph.Qt im...
null
labnanofisica/ringfinder/ringFinder.py
ringFinder.py
py
23,070
python
en
code
null
code-starcoder2
83
[ { "api_name": "pyqtgraph.Qt.QtGui.QMainWindow", "line_number": 23, "usage_type": "attribute" }, { "api_name": "pyqtgraph.Qt.QtGui", "line_number": 23, "usage_type": "name" }, { "api_name": "pyqtgraph.Qt.QtGui.QWidget", "line_number": 32, "usage_type": "call" }, { ...
262396064
import numpy as np import imutils import cv2 cap = cv2.VideoCapture('Q1.avi') fgbg = cv2.BackgroundSubtractorMOG() numframes = cap.get(cv2.cv.CV_CAP_PROP_FRAME_COUNT) count = 1 firstFrame = None while count <= 100: ret, frame = cap.read() gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) gray = cv2.Gau...
null
HW5_bkground_sub_motion_detect/HW5_1B.py
HW5_1B.py
py
2,362
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.VideoCapture", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.BackgroundSubtractorMOG", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.cv", "line_number": 12, "usage_type": "attribute" }, { "api_name": "cv2.cvtColor"...