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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
14794717807 | import os
# force TF to use CPU instead of GPU (sadly my discrete card is not support the latest CUDA version)
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
import gym
from gym import envs
import numpy as np
from keras.models import Sequential
from keras.layers import Dense
from keras.optimizers import Adam
import matplo... | Ielay/ml-lunar-lander-problem-rl | src/train_model.py | train_model.py | py | 5,554 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "keras.models.Sequential",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "keras.layers.Dense",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "keras.layer... |
33460982801 | import bpy
import os
from io_scs_tools.utils.printout import lprint
from io_scs_tools.utils import get_scs_globals as _get_scs_globals
def strip_sep(path):
"""Strips double path separators (slashes and backslashes) on the start and the end of the given path
:param path: path to strip separators from
:type... | paypink/BlenderTools | addon/io_scs_tools/utils/path.py | path.py | py | 24,096 | python | en | code | null | github-code | 1 | [
{
"api_name": "os.sep",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "bpy.path.abspath",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "bpy.path",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "os.path.normpath",
"li... |
9519485154 | from django.shortcuts import render, get_object_or_404
from django.core.paginator import Paginator
from ..models import Posts
from django.db.models import Q, Count
def index(request, category=None):
page = request.GET.get('page', '1') # 페이지를 읽어온다. 없을경우 1을 뱉는다 ?page =
kw = request.GET.get('kw', '') # 검색어
... | Ksiyeong/MyDiary | main/views/base_views.py | base_views.py | py | 2,242 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "models.Posts.objects.filter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "models.Posts.objects",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "models.Posts",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "mo... |
14247111818 | from typing import Text
import requests
import json
import pprint as pp
from datetime import datetime
import re
def get_suggestions(search_string: str):
base_url = 'https://utility.arcgis.com/usrsvcs/servers/b89ba3a68c664268b9bdea76948b4f11/rest/services/World/GeocodeServer/suggest'
query_data = {
... | jmmeneguel/SaneparWaterRestrictionCalendar | src/Sanepar/main.py | main.py | py | 3,227 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": ... |
27387352934 | from __future__ import print_function
import os.path
import sys
import densenet
import numpy as np
import sklearn.metrics as metrics
from keras.datasets import cifar10
from keras.utils import np_utils
from keras.preprocessing.image import ImageDataGenerator
from keras.optimizers import Adam
from keras.callbacks impor... | nima200/densenet-ablation | src/cifar10/BNLGrowthRate/cifar10.py | cifar10.py | py | 10,546 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "keras.backend.image_dim_ordering",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "sys.argv",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "sys.argv... |
1952095518 | import torch
import torch.nn as nn
import torch.nn.functional as F
import logging
import collections
from util import compute_aggreeings, AverageMeter, get_mask, mask_tokens
def eval(model, val_loader, a2v, args, test=False):
model.eval()
count = 0
metrics, counts = collections.defaultdict(int)... | antoyang/just-ask | train/train_videoqa.py | train_videoqa.py | py | 6,219 | python | en | code | 103 | github-code | 1 | [
{
"api_name": "collections.defaultdict",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "util.get_mask",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torch.topk",
... |
6759682425 | import json
class Kasir:
stokBarang = {}
barangPembeli = {}
def __init__(self):
pass
def simpanBeliJson(self):
with open("beli.json", "w") as beliFileJson:
json.dump(Kasir.barangPembeli, beliFileJson)
def isiStok(self):
with open("stok.json", "r") as stokRea... | TakayumAja/ipplUasSem5 | Kasir.py | Kasir.py | py | 5,060 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.dump",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 40,
... |
33198791197 | from datetime import datetime
from django.core.paginator import Paginator
from django.db.models import Q
from django.http import JsonResponse
from django.core.serializers import serialize
from django.shortcuts import render
from django.urls import reverse_lazy
from django.views.generic import CreateView, DeleteView, D... | Sampleeeees/MyHouse24 | Master_application/views.py | views.py | py | 5,264 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "models.MatsterApplication",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "models.MatsterApplication.objects.all",
"line_number": 20,
"usage_type": "call"
... |
41244035127 | import glob
import argparse
import re
import os.path
import shutil
import sys
import tempfile
import itertools
import json
VALID_PROTOCOLS = ['git', 'ssh', 'http', 'https', 'ssh-colon', 'file', 'relative']
VERSION = '0.2.0'
parser = argparse.ArgumentParser(
description = 'Recursively search directory for .git... | misje/git-rename-uri | git-rename-uri.py | git-rename-uri.py | py | 13,138 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "argparse.RawDescriptionHelpFormatter",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr",
"line_number": 118,
"usage_type": "attribute"
},
{
... |
17335067722 | # -*- coding: utf-8 -*-
__doc__ == """
Simple view that exposes a REST API over HTTP
to retrieve the least of last read books from
a bookshelf.
To run it:
.. code-block:: python
$ python last_read.py --topic mytopic --broker <BROKER_ADDR>:9092 --port 8080 --name lastread --id lastread1 --tags book last
This will... | antifragilesoftware/sandbox | kafka/microservices/last_read.py | last_read.py | py | 2,901 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "asyncio.get_event_loop",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "aiohttp.web.Response",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "aiohttp.web",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "json.dumps",
... |
20165127873 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.dashboard, name='dashboard'),
url(r'^add_mentor$', views.add_mentor, name='add_mentor'),
url(r'^add_investor$', views.add_investor, name='add_investor'),
url(r'^show_startups$', views.show_startups, name='show_start... | ramgopal18998/incubator-management-system | Startup_incubator/administrator/urls.py | urls.py | py | 1,817 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.co... |
43220039182 | import yaml
from modulemd.components import ModuleComponents
from modulemd.content import ModuleContent
from modulemd.rpms import ModuleRPMs
from modulemd.profile import ModuleProfile
supported_mdversions = ( 0, )
class ModuleMetadata(object):
"""Class representing the whole module."""
REPODATA_FILENAME = "... | xsuchy/modulemd | modulemd/__init__.py | __init__.py | py | 25,774 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "yaml.safe_load",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "modulemd.profile.ModuleProfile",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "modulemd.components.ModuleComponents",
"line_number": 107,
"usage_type": "call"
},
{
... |
20828379656 | from users.models import MossaicUser
from risk_models.models import *
from projects.models import *
from communities.models import *
from django import forms
from django.forms.models import *
from django.forms import ModelForm, Textarea
from django.forms.widgets import HiddenInput
from django.forms.models import inli... | parauchf/mossaic | communities/forms.py | forms.py | py | 1,961 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "django.forms.widgets.HiddenInput",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "django.forms.widgets.HiddenInput",
"line_number": 25,
"usage_type": "name"
},
... |
13035732107 | from pyramid.httpexceptions import HTTPError
from pyramid.httpexceptions import HTTPNotFound
from oekocms.views import error_view
from oekocms.views import exception_decorator
from fanstatic import Library
from fanstatic import Resource
import kotti.static as ks
lib_oekocms = Library('oekocms', 'static')
view_css = ... | chrneumann/oekocms | oekocms/__init__.py | __init__.py | py | 1,328 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "fanstatic.Library",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "fanstatic.Resource",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "kotti.static.view_css",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "kotti... |
29250118675 | import sys
from collections import deque
dq = deque()
N, K = map(int, sys.stdin.readline().rstrip().split(' '))
for i in range(1, N + 1):
dq.append(i)
eleminated = []
while len(dq) != 0:
count = 1
while count < K:
dq.append(dq.popleft())
count += 1
eleminated.append(dq.popleft())
prin... | ho991217/Python | BOJ/Data Structure/Queue/[11866] Yosefus.py | [11866] Yosefus.py | py | 463 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.deque",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.stdin.readline",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 4,
"usage_type": "attribute"
}
] |
41321025697 | import streamlit as st
import pandas as pd
import matplotlib.pyplot as plt
import pickle
from joblib import dump, load
from sklearn import ensemble
from sklearn import metrics
import numpy as np
def main():
GrBosstClass = load_GRB()
Bagging = load_Bagging()
data = loadSet()
defaulData = loadDefaultSet()
cur... | sanloid/WheaterPrediction | App.py | App.py | py | 5,315 | python | ru | code | 0 | github-code | 1 | [
{
"api_name": "streamlit.title",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "streamlit.markdown",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "streamlit.sidebar.markdown",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "streaml... |
73631206115 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="outlierpack-NG",
version="0.1.0",
author="Nikhil Gupta",
author_email="ngupta_be17@thapar.edu",
description="Removing outliers from a pandas dataframe",
url='https://github.com/CachingNik... | CachingNik/OutlierPack | setup.py | setup.py | py | 629 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "setuptools.setup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 15,
"usage_type": "call"
}
] |
27990442786 | import requests
import threading
import sys
import os
from bs4 import BeautifulSoup
from pandas import DataFrame
from functools import reduce
if len(sys.argv) == 1:
CSV_FNAME = 'volunteermatch_data.csv'
else:
CSV_FNAME = sys.argv[1]
URL_PART1 = 'https://www.volunteermatch.org/search/'
locations = ['New+York%... | UChicago-Tech-Team-In2It/scraping | scrape.py | scrape.py | py | 2,580 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line... |
10273949450 | """
wordcloud.py: A reusable library for word cloud visualizations
"""
"""
from PIL import Image
from wordcloud import WordCloud, STOPWORDS
import matplotlib.pyplot as plt
import pandas as pd
def make_wordcloud(results, vid_dict):
cloud = WordCloud(background_color="white",width=1000,height=1000, max_words=10,re... | johnmccarthy23/textbeast | wc.py | wc.py | py | 871 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "wordcloud.WordCloud",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "matplo... |
18204561723 | """URL patterns for Directory Services"""
from django.urls import path
# Must be full path import to allow including url patterns in project urls
from os2datascanner.projects.admin.import_services import views
urlpatterns = [
path('ldap/add/<uuid:org_id>',
views.LDAPAddView.as_view(),
name='... | os2datascanner/os2datascanner | src/os2datascanner/projects/admin/import_services/urls.py | urls.py | py | 1,526 | python | en | code | 8 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os2datascanner.projects.admin.import_services.views.LDAPAddView.as_view",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os2datascanner.projects.admin.import_services.views.LDAPA... |
33519675992 | import wx
from wx.lib.agw import customtreectrl
from wx.lib.agw.aui import GetManager
from ..controller.project import Project
from ..pluginapi import Plugin
from ..pluginapi.plugin import ActionInfo
class FileExplorerPlugin(Plugin):
"""Provides a tree view for Files and Folders. Opens selected item with mouse r... | robotframework/RIDE | src/robotide/ui/fileexplorerplugin.py | fileexplorerplugin.py | py | 5,378 | python | en | code | 910 | github-code | 1 | [
{
"api_name": "pluginapi.Plugin",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pluginapi.Plugin.__init__",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pluginapi.Plugin",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "wx.App.Ge... |
7757712695 | #coding=utf-8
import sys
import pygame
from Bullet import Bullet
from Alien import Alien
from time import sleep
def check_keydown_events(event,ai_settings,screen,ship,bullets,stats,play_Button,aliens,sb):
"""按键响应"""
#按下的是方向键右
if event.key == pygame.K_RIGHT:
ship.moving_right = True
#按下的是方向键左
... | zXin1112/Python-Practice | alien_invasion/alien_invasion/game_function.py | game_function.py | py | 9,113 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.K_RIGHT",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.K_LEFT",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pygame.K_SPACE",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pygame.K_q... |
35733666865 | # -*- coding: utf-8 -*-
# @Time : 2020/11/22 8:50
# @Author : Zhongyi Hua
# @FileName: ssr_utils.py
# @Usage:
# @Note:
# @E-mail: njbxhzy@hotmail.com
from Bio import SeqIO
from os import remove as del_file
import multiprocessing as multi
from tqdm import tqdm
def build_rep_set(repeat_file, unit_cutoff=None, motif_l... | Hua-CM/IdenSSR | ssr_utils.py | ssr_utils.py | py | 5,154 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "Bio.SeqIO.parse",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "Bio.SeqIO",
"line_number": 103,
"usage_type": "name"
},
{
"api_name": "multiprocessing.Pool",
"line_number": 111,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"li... |
38907288611 | import math
import random
import pygame
import sys
from pygame.locals import *
from copy import deepcopy
pygame.init()
pygame.mixer.init()
width, height = 640, 480
screen = pygame.display.set_mode((width, height))
player1keys = [False, False, False, False]
player2keys = [False, False, False, False]
player1pos = [0] #M... | prfy9b/Ponkle | Ponkle/main.py | main.py | py | 7,606 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.mixer.init",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mode"... |
11807782156 | import os
import re
import csv
import spacy
import convert2txt
nlp = spacy.load('skill-cv-bn')
def create_dic(filename):
result = {
'Filename': filename,
'Name':[],
'Number':[],
'Email':[],
'Experience':[],
'Companies'... | remon-rakibul/FitFinder | test-skill-cv-bn.py | test-skill-cv-bn.py | py | 4,365 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "spacy.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "convert2txt.extract_text",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "convert2txt.extract_tex... |
41055718886 | import json
from test_tools.example_stubber import ExampleStubber
class OrganizationsStubber(ExampleStubber):
"""
A class that implements a variety of stub functions that are used by the
AWS Organizations unit tests.
The stubbed functions all expect certain parameters to be passed to them as
par... | awsdocs/aws-doc-sdk-examples | python/test_tools/organizations_stubber.py | organizations_stubber.py | py | 3,333 | python | en | code | 8,378 | github-code | 1 | [
{
"api_name": "test_tools.example_stubber.ExampleStubber",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "json.d... |
19509604543 | import json
import pytest
from api.processing import units
from unyt import unyt_quantity
def test_unyt_encoder():
test_unyt_dict = {
"test_quantity": unyt_quantity(5, "Mpc"),
}
expected = '{"test_quantity": "5 Mpc"}'
assert expected == json.dumps(test_unyt_dict, cls=units.UnytEncoder)
def... | UCL-ARC/dirac-swift-api | tests/test_units.py | test_units.py | py | 3,144 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "unyt.unyt_quantity",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "api.processing.units.UnytEncoder",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "a... |
31518563478 | import flask
from flask import Flask, render_template, request, redirect
from web3 import Web3
app = Flask(__name__)
candidates = {1: "badi mohammad", 2: "hamza saht", 3: "omar hussein"}
# Connect to the Sepolia network
web3 = Web3(
Web3.HTTPProvider(
"https://eth-sepolia.g.alchemy.com/v2/ji4q... | NaturalT314/Dapp-Voting-System | app.py | app.py | py | 3,156 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "web3.Web3",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "web3.Web3.HTTPProvider",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "web3.Web3",
"line_num... |
73152578915 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.db.models.signals import m2m_changed
from django.core.mail import send_mail
import uuid
from time import sleep
import geocoder
import urllib3
urllib3.disable_war... | donlafranchi/gfcmap | general/models.py | models.py | py | 3,400 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "urllib3.disable_warnings",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.AbstractUser",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 21,
"usage_type": "call"
}... |
27969864189 | # coding=utf-8
from django import forms
from django.db.models import Q
from django.forms.models import formset_factory
from BanBanTong.db import models
class RolePrivilegesForm(forms.ModelForm):
class Meta:
model = models.RolePrivilege
exclude = ['uuid', 'role']
class RoleForm(forms.ModelForm)... | xiaolin0199/bbt | apps/BanBanTong/forms/role.py | role.py | py | 1,348 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "BanBanTong.db.models.RolePrivilege",
"line_number": 12,
"usage_type": "attribute"
},
{
"ap... |
39893956481 | import ipaddress
import math
class FirstSpyEstimator:
def __init__(self, tx_maps, true_sources: {ipaddress.ip_address: [int]}):
self.p = 0.0
self.r = 0.0
self.r_old = 0.0
benign_nodes = len(true_sources)
self.observer_map = {} # BLOCK_ID: observer
txs = sorted([it... | jansp/kadcast-privacy | kadcast/estimators.py | estimators.py | py | 1,833 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "ipaddress.ip_address",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "math.inf",
"line_number": 17,
"usage_type": "attribute"
}
] |
41425319510 | import numpy as np
import pandas as pd
import csv
from datetime import datetime, timedelta
from polygon import RESTClient
import yfinance as yf
import matplotlib.pyplot as plt
d2 = datetime.today() - timedelta(days=1)
d1 = d2 - timedelta(days=365)
d3 = d2 - timedelta(days=30)
start_d = d1.strftime('%Y-%m-%d')
end_d = ... | amoszczynski/Mid-Term_Algo-Trader | v1/signaling.py | signaling.py | py | 7,971 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "datetime.datetime.today",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.ti... |
2350374306 | '''
Lex Strings
Name: <your name>
'''
from collections import Counter, defaultdict
#
# Complete the 'rearrangedString' function below.
#
# The function is expected to return a STRING.
# The function accepts following parameters:
# 1. STRING s
#
# 1. This function will filter the alphanumeric characters from the str... | tkong9/ACSL-Sr | Assignments/lex.py | lex.py | py | 2,876 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "collections.Counter",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 66,
"usage_type": "attribute"
}
] |
33357721855 | import pygame
from pygame.surface import Surface
import sys
from Screens.Content import Content, State
from Options.Options import KEY_REPEAT_DELAY, KEY_REPEAT_INTERVAL, TITLE_H_START, TITLE_W_START, TITLE_H_SIZE, BUTTON_H, BUTTON_W, FONT, BRICK_SIZE, ICON_H, ICON_W
from Options.Colors import Colors, Color_mod
class... | HTsuyoshi/py-tetris | src/Screens/Settings.py | Settings.py | py | 4,030 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "Screens.Content.Content",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "Options.Options.TITLE_H_SIZE",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "Options.Options.BUTTON_H",
"line_number": 25,
"usage_type": "name"
},
{
"api... |
6585776436 | import threading
import time
import serial.tools.list_ports
from os import environ
from re import search
from PyQt6.QtCore import QObject, pyqtSignal
from UM.Platform import Platform
from UM.Signal import Signal, signalemitter
from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin
from UM.i18n import i18nC... | Ultimaker/Cura | plugins/USBPrinting/USBPrinterOutputDeviceManager.py | USBPrinterOutputDeviceManager.py | py | 6,487 | python | en | code | 5,387 | github-code | 1 | [
{
"api_name": "UM.i18n.i18nCatalog",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "PyQt6.QtCore.QObject",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "UM.OutputDevice.OutputDevicePlugin.OutputDevicePlugin",
"line_number": 22,
"usage_type": "name"
... |
11510469822 | # Released under the MIT License. See LICENSE for details.
#
"""Playlist related functionality."""
from __future__ import annotations
import copy
import logging
from typing import Any, TYPE_CHECKING
import babase
if TYPE_CHECKING:
from typing import Sequence
from bascenev1._session import Session
Playlist... | efroemling/ballistica | src/assets/ba_data/python/bascenev1/_playlist.py | _playlist.py | py | 20,107 | python | en | code | 468 | github-code | 1 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "bascenev1._session.Session",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "babase.app... |
28833725406 | import sqlite3
import typing
from timetable_loader import BaseTimetableLoader
def add_new_user(cursor: sqlite3.Cursor, user_id, group_id: int):
cursor.execute("""
INSERT INTO users VALUES (?, ?)
""", (user_id, group_id))
def delete_timetable_for_group(cursor: sqlite3.Cursor, group_id: int):
cur... | just3mhz/timetable_bot | sql_queries.py | sql_queries.py | py | 874 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "sqlite3.Cursor",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.Cursor",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.Cursor",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "timetable_... |
32396154456 | import scipy.stats as sts
import argparse
import pandas as pd
import glob
def ParseArguments():
parser = argparse.ArgumentParser(description="Kolmogorov–Smirnov test")
parser.add_argument('--input-file', default="generated_numbers.pkl", required=False, help='input file (default: %(default)s)')
parser.add_a... | lorek/ZPS2021 | scripts/z3KStest.py | z3KStest.py | py | 2,157 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_pickle",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "scipy.stats.kstest",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "scipy.st... |
32952521600 | import binascii
import base58
import hashlib
from hashlib import sha256
from ecdsa import SECP256k1,VerifyingKey,util,BadSignatureError
from six import b
#字符串按字节反转。大小端数据的字符串转换。eg:"123456" to "563412"
def str_reverse_on_byte(data):
return binascii.hexlify(binascii.unhexlify(data)[::-1]).decode()
#16进制字符串转整型。eg:"11... | whichouno/Python | BlockChain/Utils.py | Utils.py | py | 8,269 | python | de | code | 0 | github-code | 1 | [
{
"api_name": "binascii.hexlify",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "binascii.unhexlify",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "binascii.a2b_hex",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "binascii.hexlify... |
27982625722 | from sqlalchemy import Boolean, Column, ForeignKey, Integer, String, TIMESTAMP, Float, Table
from sqlalchemy.orm import relationship
from sqlalchemy.sql.sqltypes import Text
from database import Base
class User(Base):
__tablename__ = "users"
# user_id, roll_no, name, email, phone_number, password, c... | Gautam-Nanda/FEAST | models.py | models.py | py | 4,781 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "database.Base",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "sqlalchemy.Colu... |
70852848035 | import torch
import torchvision
from torch import nn
class MyBetaModel(nn.Module):
def __init__(self):
super(MyBetaModel, self).__init__()
self.convModel = nn.Sequential(
nn.Conv2d(3, 32, kernel_size=5, stride=1, padding=2),
nn.MaxPool2d(2),
nn.Conv2d(32, 32, 5,... | JevonLiuZz/PyTorchBaseStone | Models/BetaModel.py | BetaModel.py | py | 1,062 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
41858320835 | import json
notas = list()
medias = list()
auxiliar = list()
def cadastro_aluno(ficha):
cont = 0
resp = 'S'
print('\nCADASTRAR ALUNO\n')
while cont < 1 and resp in 'Ss' :
aluno = input('Digite o nome do aluno: ')
cad = 0
for alunos in ficha:
for nome in alunos:
... | niverton-felipe/unifacisa | cadastro.py | cadastro.py | py | 16,107 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "json.dumps",
"line_number": 429,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 442,
"usage_type": "call"
}
] |
20564522844 | from re import search
import hashlib
from Crypto.Cipher import AES
from Crypto import Random
import os
from configparser import ConfigParser
from locale import getdefaultlocale
import gettext
from subprocess import check_output, CalledProcessError
import logging
from logging.handlers import TimedRotatingFileHandler
imp... | j4321/CheckMails | checkmailslib/constants.py | constants.py | py | 8,761 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.access",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.W_OK",
"line_number": 1... |
3588852824 | import logging
from typing import Any, Dict
from sqlalchemy import NUMERIC, DateTime, bindparam, case, func, select
from sqlalchemy.dialects.postgresql import INTERVAL
from sqlalchemy.sql import Select
from sqlalchemy.sql.functions import concat
from execution_engine.constants import CohortCategory
from execution_eng... | CODEX-CELIDA/execution-engine | execution_engine/omop/criterion/drug_exposure.py | drug_exposure.py | py | 10,683 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "execution_engine.omop.criterion.abstract.Criterion",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "execution_engine.constants.CohortCategory",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "execution_engine.omop.concepts.Concept",
"line_n... |
32081852087 | # tests.py
from unittest import TestCase, main as unittest_main
from app import app
from unittest import TestCase, main as unittest_main, mock
from bson.objectid import ObjectId
sample_id = ObjectId('5d55cffc4a3d4031f42827a3')
sample_deck = { 'img': "static/red.jpeg", 'description': 'Red playing cards' }
sample_data... | Gaoyagi/Contractor | test.py | test.py | py | 1,596 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "bson.objectid.ObjectId",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bson.objectid.ObjectId",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "app.ap... |
71710416995 | import json
import requests
import pandas as pd
import sweetviz as sv
import pandas_profiling
def extract_data(url = "http://api.tvmaze.com/schedule/web?date=2020-12-"):
data = []
for i in range(1,32):
url_api = url + str(i).zfill(2)
result = requests.get(url_api)
dato = json.loads(r... | Harolencio/lulo_bank_data_test | src/automatic_process.py | automatic_process.py | py | 7,651 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number... |
21061957738 | import numpy as np
import glob
import sys
import cv2
import os
import json
import operator
from matplotlib import pyplot as plt
def get_data(directory):
MIN_MATCH_COUNT = 10
img1 = cv2.imread('data/original.jpg',0) #queryImage
# Initiate SIFT detector
sift = cv2.xfeatures2d.SIFT_cr... | aishwaryaanaidu/sketch-recognition | sift/looping.py | looping.py | py | 1,926 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "cv2.imread",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.xfeatures2d.SIFT_create",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cv2.xfeatures2d",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "cv2.Flann... |
42926702835 | import requests
import re
url = "http://46.101.60.26:31068/question3/"
session = requests.Session()
with open("top-usernames-shortlist.txt", "r") as f:
wordlist = f.readlines()
time_taken = {}
print("Testing the time taken")
print("======================")
for word in wordlist:
word = word.rstrip()
data = {
... | singha-brother/Web_Security_Notes | HTB_Academy/BROKEN_AUTHENTICATION/questions/username_bf03.py | username_bf03.py | py | 619 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "requests.Session",
"line_number": 6,
"usage_type": "call"
}
] |
73732029792 | from django.urls import path
from tasks.views import complete, create, create_task_to_card, delete, list_all, update, find_by_id
app_name = 'tasks'
urlpatterns = [
path('create-task/', create, name='create'),
path('tasks/', list_all, name='list_all'),
path('tasks/<int:pk>/', find_by_id, name='find_by_id'... | l-eduardo/potential-pancake | tasks/urls.py | urls.py | py | 590 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tasks.views.create",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tasks.views.lis... |
27706601958 | from datetime import datetime, date, timedelta
from datetime import timedelta
import tweepy
from tweepy import OAuthHandler
import json
from lab9_config import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
# Authorization setup to access the Twitter API
auth = OAuthHandler(CONSUMER_KEY, CONSUMER... | wudixiaoyu008/twitter-api-and-database | test.py | test.py | py | 821 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tweepy.OAuthHandler",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "lab9_config.CONSUMER_KEY",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "lab9_config.CONSUMER_SECRET",
"line_number": 13,
"usage_type": "argument"
},
{
"... |
425665856 | from typing import Union
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import patches
from matplotlib import lines
# Custom imports:
from Synthetic_Sequencer import synthtools as syn
# matrix_imager(tp_matrix, classes, facies_dict, layout, filepath, title=None):
# ============================... | Ruben0-0/bep | Visualization_Tools/matrix_visualizers.py | matrix_visualizers.py | py | 5,698 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.ndarray",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "matpl... |
43343485878 | #python script to concatenate tiff files of split timepoint movies
#Author: M. Secchi with the help of N. Gogoberidze
#Date: 2022-12-06
#Lines 16 and 39 have to be edited to match the path of the folder containing the split movies and the path of the folder where the concatenated movies will be saved
import os
import... | Mas515/Image_analysis | concatenate.py | concatenate.py | py | 1,913 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.walk",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 30,
"us... |
9295811562 | import numpy as np
from gym.utils import seeding
import math
import matplotlib.pyplot as plt
from maze import MazeWorldSmall
def randargmax(b, np_random=None):
if np_random is None:
np_random = np.random
return np_random.choice(np.flatnonzero(b == b.max()))
class Agent(object):
def __init__(self... | windweller/AutoGrade | autograde/toy/q_learning.py | q_learning.py | py | 8,613 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.random",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.flatnonzero",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "gym.utils.seeding.np_random",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "gym.u... |
22575362577 | import sys
import itertools
def solution(mylist):
number= [x for x in range(1,mylist+1)]
answer= list(map(list, itertools.permutations(number)))
answer.sort()
return answer
n = int(input())
results = solution(n)
for i in results:
for j in i:
print(j,end=" ")
print("") | dydwkd486/coding_test | baekjoon/python/baekjoon10974.py | baekjoon10974.py | py | 303 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "itertools.permutations",
"line_number": 6,
"usage_type": "call"
}
] |
70957373473 | """create relation between users and papers
Revision ID: 4e860e37bb37
Revises: 1bd8afe10204
Create Date: 2013-10-03 20:59:42.374353
"""
# revision identifiers, used by Alembic.
revision = '4e860e37bb37'
down_revision = '1bd8afe10204'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands a... | dedalusj/PaperChase | backend/alembic/versions/4e860e37bb37_create_relation_betw.py | 4e860e37bb37_create_relation_betw.py | py | 1,028 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "alembic.op.create_table",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
19780094728 | # bot.py
import discord # IMPORT DISCORD.PY. ALLOWS ACCESS TO DISCORD'S API.
import os # IMPORT THE OS MODULE.
import sqlite3
import time
from datetime import datetime, date
from dotenv import load_dotenv # IMPORT LOAD_DOTENV FUNCTION FROM DOTENV MODULE.
from discord.ext import commands, tasks # IMPORT COMMAND... | JoelW2003/Bin-Reminder-Bot | cindyBot/bot.py | bot.py | py | 7,980 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "discord.Intents.default",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "discord.Intents"... |
72772102433 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import math
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.model_selection import KFold
#数据加载 & 处理
def create_data():
corpus_path = './naiveBayes'
sample_cate = ['a... | kildallithro/HW_ML-2020-2021_1 | naiveBayes_20newsgroups/naiveBayes.py | naiveBayes.py | py | 3,569 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.datasets.fetch_20newsgroups",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.text.TfidfVectorizer",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 42,
"usage_type": "call"
... |
89305565 | # -*- coding: utf-8 -*-
import os
import re
import ssl
import threading
from math import pi
import rospy
from geometry_msgs.msg import Twist
import paho.mqtt.client as mqtt
from fiware_ros_turtlesim.params import getParams, findItem
from fiware_ros_turtlesim.logging import getLogger
logger = getLogger(__name__)
cl... | tech-sketch/fiware-ros-turtlesim | src/fiware_ros_turtlesim/command_sender.py | command_sender.py | py | 7,227 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "fiware_ros_turtlesim.logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "paho.mqtt.client.Client",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "paho.mqtt.client",
"line_number": 21,
"usage_type": "name"
},
{
"a... |
36046629711 | import requests
from bs4 import BeautifulSoup as bs
page = requests.get('https://umggaming.com/leaderboards')
soup = bs(page.text, 'html.parser')
# Get table with the id of leaderboards
leaderboards = soup.find('table', {'id': 'leaderboard-table'})
# Get tbody from table
tbody = leaderboards.find('tbody')
# Get all... | edwardspresume/Sandbox | python/Data-scraper/leaderboard.py | leaderboard.py | py | 599 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 5,
"usage_type": "call"
}
] |
24981871542 | # encoding='utf-8'
import contextlib
import functools
import inspect
from multiprocessing import Lock as m_lock
class TestDecorator:
'''
test decorate
'''
def __init__(self, name):
self.name = name
self.mark = "test"
def __call__(self, *args, **kwargs):
i... | hautof/haf | haf/mark.py | mark.py | py | 3,472 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "inspect.isfunction",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Lock",
"line_number": 96,
"usage_type": "name"
},
{
"api_name": "functools.wraps",
"line_number": 122,
"usage_type": "call"
},
{
"api_name": "multiprocess... |
13518570965 | import requests
from concurrent.futures import ThreadPoolExecutor, as_completed
import threading
import time
import pprint
from bs4 import BeautifulSoup
import csv
import os
class WebSpider(threading.Thread):
def __init__(self, cookies, headers):
self.cookies = cookies
self.headers = headers
... | huchiwen/LearnSpider | qa_crawl.py | qa_crawl.py | py | 5,023 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "threading.Thread",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "csv.writer",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
... |
31966512950 | from typing import List
from synt.terminals import *
from lex.tokens import *
TERMINAL_COLOR = "\033[36m"
NONTERMINAL_COLOR = "\033[37m"
RESET_COLOR = "\033[0m"
class Rule:
def __init__(self, result, parts):
self.result = result
self.parts = parts
def loadGrammar() -> list:
file = open("sy... | PaulCh4/compiler-labs | compiler/synt/syntax.py | syntax.py | py | 2,323 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 39,
"usage_type": "name"
}
] |
10317462795 | import uproot4
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from matplotlib.collections import PatchCollection
from matplotlib import cm
from matplotlib.colors import LogNorm, Normalize
import awkward1 as ak
from lxml import etree as ET
def get_module_positions(base_name, tree):
# <posit... | eic/hybrid_calorimeter_tools | event_display.py | event_display.py | py | 3,470 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "matplotlib.patches.Rectangle",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "matplotlib.patches",
"line_number": 54,
"usage_type": "name"
},
{
"api_name": "matplotlib.collections.PatchCollection",
"line_number": 57,
"usage_type": "call"
},
{... |
3560320164 | # In this Bite you calculate the total amount of points earned with Ninja Belts
# by accessing the given ninja_belts dict.
#
# You learn how to access score and ninjas (= amount of belt owners) from
# no less than a namedtuple (if you're new to them, check out the basic Point example in the docs).
#
# Why a namedtuple,... | panpusto/codewars_exercises | exercises/intro_bites_08_by_PyBites.py | intro_bites_08_by_PyBites.py | py | 1,186 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.namedtuple",
"line_number": 18,
"usage_type": "call"
}
] |
40882243652 | import click
import dotenv
from rich import print
from rich.console import Console
console = Console()
from dotenv import load_dotenv
load_dotenv()
import os
import pynetbox
import requests
import re
import yaml
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
NETBOX_TOKEN = os.geten... | jeremypng/netbox-to-pyats | netbox_to_testbed.py | netbox_to_testbed.py | py | 5,377 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "rich.console.Console",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "urllib3.disable_warnings",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "urllib... |
10380546163 | #! /usr/bin/env python3
import rospy
import tf
def main():
rospy.init_node("robot_tf_broadcaster")
tf_br = tf.TransformBroadcaster()
rate = rospy.Rate(100)
while not rospy.is_shutdown():
translate_date = (0.1, 0.0, 0.2)
rotation_data = (0, 0, 0, 1)
tf_br.sendTransform(translate_date, rotation_... | Jieshoudaxue/ros_senior | learning_tf_homework/scripts/tf_broadcaster.py | tf_broadcaster.py | py | 430 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "rospy.init_node",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "tf.TransformBroadcaster",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "rospy.Rate",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "rospy.is_shutdown",
... |
37338999785 | from concurrent import futures
import grpc
import servicos_pb2
import servicos_pb2_grpc
import threading
import fila
import banco
import time
import os
import config
import random
_ONE_DAY_IN_SECONDS = 60 * 60 * 24
f1 = fila.Fila()
f2 = fila.Fila()
f3 = fila.Fila()
f4 = fila.Fila()
bd = banco.Banco()... | ruehara/SdPython | protos/server_grpc.py | server_grpc.py | py | 4,072 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "fila.Fila",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "fila.Fila",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "fila.Fila",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "fila.Fila",
"line_number": 17,
... |
27405001850 | import numpy as np
import torch
import torch.nn as nn
import random
from collections import deque
from vicero.policy import Policy
from copy import deepcopy
from vicero.algorithms.common.neuralnetwork import NeuralNetwork, NetworkSpecification
# DQN (Deep Q Networks)
# DQN is an approximated variant of Q-learning
# Si... | CogitoNTNU/vicero | vicero/algorithms/deepqlearning.py | deepqlearning.py | py | 7,626 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "torch.device",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "torch.set_default_tensor_type",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "torch.optim",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.... |
1707036596 | """Team and Tessera models
Revision ID: 20c506662a93
Revises: 089ccde49d20
Create Date: 2021-10-06 13:50:48.166391
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "20c506662a93"
down_revision = "089ccde49d20"
branch_labels = None
depends_on = None
def upgrade(... | tesselo/giges | migrations/versions/202110061350_20c506662a93_team_and_tessera_models.py | 202110061350_20c506662a93_team_and_tessera_models.py | py | 3,004 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "alembic.op.create_table",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.CHAR"... |
43184286389 | # 串接串接。擷取公開資料
import urllib.request as request #1.網路連線模組
import json #2.為了解讀json格式所以載入json模組
src="https://padax.github.io/taipei-day-trip-resources/taipei-attractions-assignment.json"
with request.urlopen(src) as response: #3.將網址中的資料整塊讀取下來
data=json.load(response) #4.利用js... | TaiLinChung/week-3.github.io | week03/w0301.py | w0301.py | py | 1,742 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "urllib.request",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 6,
"usage_type": "call"
}
] |
31588169742 | from selenium import webdriver
from bs4 import BeautifulSoup as bs
import pandas as pd
import requests, re
import os
import time
import pandas as pd
page = 15
name = '北京朝阳大悦城'
info_table = pd.DataFrame(columns=['昵称', '口味', '环境', '服务', '时间', '评论'])
css_headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10... | moyuweiqing/dazhongdianping | by-selenium.py | by-selenium.py | py | 9,781 | python | en | code | 35 | github-code | 1 | [
{
"api_name": "pandas.DataFrame",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_numbe... |
45470229472 | import queue
import sys
import threading
import time
import os
import cv2
from PyQt5 import QtCore
from PyQt5.QtCore import Qt
from PyQt5.QtCore import QTimer
from PyQt5.QtGui import QImage, QPixmap
from PyQt5.QtWidgets import QDialog, QApplication, QMessageBox
from PyQt5.uic import loadUi
import serial
import csv
fro... | jaehyunShinRmit/OpencvTest | main2.py | main2.py | py | 11,014 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "PyQt5.uic.loadUi",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "serialThreadFile.serialThreadClass",
"line_number": 57,
"usage_type": "call"
},
{
"api_n... |
44303046716 | import gym
import numpy as np
from keras_ppo_icm import Agent
if __name__ == '__main__':
#env_name = 'MountainCar-v0'
env_name = 'CartPole-v1'
env = gym.make(env_name)
agent = Agent(
input_shape=env.observation_space.shape,
action_num=env.action_space.n,
alpha=1e-3,
bet... | Techno263/rl-exploration | keras_ppo_icm/keras_ppo_learn.py | keras_ppo_learn.py | py | 2,196 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "gym.make",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "keras_ppo_icm.Agent",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.utils.plot_model",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tensorf... |
1959000648 | # -*- coding: utf-8 -*-
from googleapiclient.http import MediaFileUpload
import pandas as pd
import os
from googleapiclient.discovery import build
from google.oauth2.credentials import Credentials
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from oauth2clien... | StevePrat/google_service_python | google_service.py | google_service.py | py | 15,535 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.exists",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "google.oauth2.credentials.Credentials.from_authorized_user_file",
"line_number": 37,
"usage_type": "call"
}... |
41334978552 | import base64
import json
import jwt
import os
import re
import time
from urllib.parse import urlencode
from jupyterhub.handlers.login import LogoutHandler
from jupyterhub.utils import url_path_join
from oauthenticator.generic import GenericOAuthenticator
from tornado.httpclient import HTTPClientError, HTTPRequest, As... | ChameleonCloud/jupyterhub-chameleon | jupyterhub_chameleon/authenticator/openstack_oauth.py | openstack_oauth.py | py | 10,242 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "jupyterhub.handlers.login.LogoutHandler",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "jupyterhub.handlers.login.LogoutHandler",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "jupyterhub.utils.url_path_join",
"line_number": 47,
"usag... |
33939740836 | import numpy as np
import matplotlib.pyplot as plt
tempMDS = np.load("MDS_temperature.npy")
grassmannMDS = np.load("MDS_Grassmann.npy")
plt.figure()
plt.title("MDS plot (from euclidean distances between T fields)")
plt.scatter(tempMDS[:,0],tempMDS[:,1], c = 'b', marker = 'o', s=30)
plt.show()
plt.figure()
plt.t... | siyuanhenpc/HESIYUAN | TP3/04-visu_MDS.py | 04-visu_MDS.py | py | 453 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.load",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"... |
30469737676 | # Find unique
# Given the list of IDs, which contains many duplicate integers and one unique
# integer, find the unique integer.
from functools import reduce
from typing import List
import unittest
def find_unique(arr: List[int]) -> int:
return reduce(lambda x, y: x ^ y, arr)
class TestFindUnique(unittest.Test... | kchenx/interview-practice | 11-bit-manipulation/find_unique.py | find_unique.py | py | 610 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "functools.reduce",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "unittest.main",
... |
8604062010 | import kivy
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.clock import Clock
from kivy.uix.tabbedpanel import TabbedPanelItem, TabbedPanel
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
from kivy.uix.checkbox import CheckBox
f... | jurrutiag/Robotic-Manipulator | InfoDisplay/InformationWindow.py | InformationWindow.py | py | 14,142 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "kivy.uix.tabbedpanel.TabbedPanelItem",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.close",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 52,
"usage_type": "name"
},
{
"ap... |
72367971553 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 10 20:16:54 2020
Various preprocessing functions
@author: kfinity
"""
import pandas as pd
import numpy as np
import json
import nltk
from youtube_transcript_api import YouTubeTranscriptApi
from youtube_transcript_api._errors import TranscriptsDis... | kfinity/capstone-speeches | preproc.py | preproc.py | py | 6,682 | python | en | code | 7 | github-code | 1 | [
{
"api_name": "pandas.DataFrame",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "nltk.pos_tag",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "nltk.WhitespaceTokenizer"... |
5562710262 | """Gateway Class Module"""
from typing import Dict
import internal_schema
import stores.chirpstack.base
import stores.chirpstack.gateway_profile
import stores.chirpstack.network_server
import stores.chirpstack.organization
import stores.chirpstack.service_profile
import exception
class Gateway(stores.chirpstack.base... | williamlun/fastapi_playground | keycloak_import/src/stores/chirpstack/gateway.py | gateway.py | py | 2,806 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "stores.chirpstack.base.chirpstack",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "stores.chirpstack.base",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "internal_schema.Gateway",
"line_number": 13,
"usage_type": "attribute"
},... |
9526298834 | """
@author: Aashis Khanal
@email: sraashis@gmail.com
"""
from collections import OrderedDict as _ODict
import os as _os
import torch as _torch
import coinstac_sparse_dinunet.config as _conf
import coinstac_sparse_dinunet.metrics as _base_metrics
import coinstac_sparse_dinunet.utils as _utils
import coinstac_sparse_d... | bishalth01/coinstac_sparse_dinunet | coinstac_sparse_dinunet/nn/basetrainer.py | basetrainer.py | py | 20,152 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "coinstac_sparse_dinunet.utils.FrozenDict",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "coinstac_sparse_dinunet.utils",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "coinstac_sparse_dinunet.utils.FrozenDict",
"line_number": 30,
"usa... |
5264072017 | #! /usr/bin/env python
# coding:utf-8
# Author qingniao
from logging.handlers import RotatingFileHandler
from logging import getLogger, ERROR
from os.path import join, isdir
from sys import stdout
from os import mkdir
def log_out(conf):
"""set log output
set log file and level
:return: None
"""
... | XorgX304/xss_fuzz | lib/log.py | log.py | py | 1,034 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_num... |
38169728179 | import requests
rhost = "http://localhost:"
red = "\033[0;31m"
green = "\033[0;32m"
blue = "\033[0;34m"
nc = "\033[0m"
def getRequest(port, uri, expected):
print(red + "GET " + rhost + str(port) + uri + nc)
print(green + "Expected: " + expected + nc)
r = requests.get(rhost + str(port) + uri)
print(blu... | acoudert/webserv_tester | test/get/classic.py | classic.py | py | 1,135 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
}
] |
70887149155 | from __future__ import absolute_import, division, unicode_literals, print_function, nested_scopes
import logging
import os
import subprocess
from sshutil import conn
from sshutil.cache import _setup_travis
__author__ = 'Christian Hopps'
__version__ = '1.0'
__docformat__ = "restructuredtext en"
logger = logging.getLog... | choppsv1/pysshutil | sshutil/cmd.py | cmd.py | py | 11,231 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sshutil.cache._setup_travis",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "subprocess.CalledProcessError",
"line_number": 19,
"usage_type": "attribute"
},
{
"... |
29160921048 | # -*- coding: utf-8 -*-
"""
Created on Sat Oct 19 17:15:14 2019
@author: KUSHAL
"""
import cv2
import numpy as np
import matplotlib.pyplot as plt
import scipy.signal as sg
# Harris Corner Detector
class HarrisCornerDetector:
def InputImage(self, img, thres = 117):
"""Takes input image for ... | kushal123478/Motion-Tracking | MotionTracking.py | MotionTracking.py | py | 9,112 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.float64",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "cv2.Sobel",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "cv2.CV_64F",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "cv2.Sobel",
"line_number"... |
16452225862 | import torch
import unittest
import sys
import torch_testing as tt
sys.path.append("..")
from layer_sim.networks import *
from layer_sim import datasets
class TestCNNLeNet(unittest.TestCase):
def setUp(self):
self.lenet = LeNet5(10)
self.x = torch.rand((2,1,28,28))
def test_... | marcozullich/pruned_layer_similarity | tests/test_networks.py | test_networks.py | py | 3,634 | python | en | code | 7 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.rand",
"... |
588989209 | import matplotlib.pyplot as plt
import numpy as np
def dft(samples: np.ndarray, bins: int) -> np.ndarray:
freq_components = np.zeros(bins, dtype=complex)
for freq_bin in range(bins):
freq_weight = 0
freq = freq_bin / bins
for sample_idx in range(samples.size):
angle = 2 * n... | lenka98/digital_signal_processing | discrete_fourier_transform.py | discrete_fourier_transform.py | py | 1,241 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.ndarray",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.exp",
"line_numb... |
21767862234 | import glob
import json
import os
import unittest
from pytext.builtin_task import register_builtin_tasks
from pytext.config import LATEST_VERSION, pytext_config_from_json
from pytext.config.config_adapter import ADAPTERS, upgrade_one_version
from pytext.utils.file_io import PathManager
register_builtin_tasks()
cla... | amohamedwa/pytext | pytext/config/test/config_adapter_test.py | config_adapter_test.py | py | 1,855 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pytext.builtin_task.register_builtin_tasks",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pytext.config.LATEST_VERSION",
"line_number": 18,
"usage_type": "argume... |
31636778041 | # Hidden Markov Models
#
# Author: Ron Weiss <ronweiss@gmail.com>
# Shiqiao Du <lucidfrontier.45@gmail.com>
# API changes: Jaques Grobler <jaquesgrobler@gmail.com>
# Modifications to create of the HMMLearn module: Gael Varoquaux
# More API changes: Sergei Lebedev <superbobry@gmail.com>
# FSHMM code: Elizabeth F... | elifons/FeatureSaliencyHMM | hmm.py | hmm.py | py | 20,656 | python | en | code | 11 | github-code | 1 | [
{
"api_name": "base._BaseHMM",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "base._BaseHMM.__init__",
"line_number": 145,
"usage_type": "call"
},
{
"api_name": "base._BaseHMM",
"line_number": 145,
"usage_type": "name"
},
{
"api_name": "numpy.array",
... |
42389999243 | """
Homework4.
Replace 'pass' by your implementation.
"""
import numpy as np
import helper
# Insert your package here
from sympy import *
from scipy.ndimage.filters import gaussian_filter
from scipy.optimize import leastsq, minimize
'''
Q2.1: Eight Point Algorithm
Input: pts1, Nx2 Matrix
pts2, Nx2 Ma... | danenigma/Traditional-Computer-Vision | 3D-Reconstruction-bundle-adjustment/code/submission.py | submission.py | py | 9,561 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.eye",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.vstack",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.svd",
"line_number... |
19158925299 | """
Logic for transferring a subunit (aka XBlock, XModule) from Open edX to a Blockstore Bundle.
"""
from __future__ import absolute_import, print_function, unicode_literals
import json
import logging
from django.utils.translation import gettext as _
from . import compat
from .block_serializer import XBlockSerialize... | open-craft/openedx-blockstore-relay | openedx_blockstore_relay/transfer_data.py | transfer_data.py | py | 3,962 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "block_serializer.XBlockSerializer",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "blockstore_client.create_bundle",
"line_number": 67,
"usage_type": "call"
},
{
... |
10597139413 | import csv
import codecs
from itertools import zip_longest
from datetime import datetime, date
from typing import List, Dict
class InvalidDatasetError(Exception):
"""
Raised when there is an issue with the format of a dataset
"""
def __init__(self, reason):
self.message = f'Invalid format for d... | fireflycons/acg-challenge-2020-09 | src/transform.py | transform.py | py | 5,600 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 104,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 124,
"usage_type": "call"
},
{
"api_na... |
20808228948 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sqlite3;
import uuid;
import datetime;
from storyedit.user import *;
from storyedit.schema import *;
from storyedit.error import *;
from storyedit.story import *;
STORAGEFILE = "db/data.sqlite3";
class SETable(object):
__slots__ = ['name']
def __init__(self, name):... | welovy/storyedit-ss | storyedit/storage.py | storage.py | py | 4,918 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sqlite3.connect",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "uuid.uuid1",
"line_number": 43,
"usage_type": "call"
}
] |
36440192858 | import torch
from image_filter_transformer import Captioner
device = 'cuda'
from torch.utils.data import DataLoader
from captioning_dataset import CaptioningDataset, MyCollate
from tokenizers import Tokenizer
tokenizer_path ="/home/ivlabs/Documents/Kshitij/archive/Flickr_tokenizer.json"
tokenizer = Tokenizer.from_file... | Kshitij-Ambilduke/Image-Captioning | filter_captioning/testing.py | testing.py | py | 3,164 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tokenizers.Tokenizer.from_file",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tokenizers.Tokenizer",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "captioning_dataset.CaptioningDataset",
"line_number": 14,
"usage_type": "call"
},
{... |
20293381596 | import math as math
import numpy as np
import utm
import json
from .optimalControl import OptimalControl
class Navigation:
# Object for vehicle controller
controller = OptimalControl()
path = None # Trajectory goals
endReached = True
pathCount = 1 # Counter to select which goal to go to... | ZultTheReal/RobuROC---Python | control/navigation.py | navigation.py | py | 5,349 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "optimalControl.OptimalControl",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
15556401986 | from cProfile import label
import math
import matplotlib.pyplot as plt
class Perceptron():
def perceptron(self):
tabla_or = [[0, 0, 0],[0, 1, 1],[1, 0, 1],[1, 1, 1]]
tabla_and = [[0,0,0], [0,1,0],[1,0,0],[1,1,1]]
tabla_xor = [[0,0,0],[0,1,1],[1,0,1],[1,1,0]]
#listas
lista_w... | militomba/inteligenciaArtificial | TP2/perceptron.py | perceptron.py | py | 4,318 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "math.exp",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 100,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 100,
"usage_type": "name"
},
{
"api_name": "matplotlib.py... |
74395377633 | import torch
import torch.nn as nn
import torch.nn.functional as F
class CNN_1D(nn.Module):
def __init__(self):
super(CNN_1D,self).__init__()
# 160x20 -> 128x32 -> 64x32
self.conv_layer1 = nn.Sequential(
nn.Conv1d(in_channels=20, out_channels=32, kernel_size=33),
n... | BrightSoulXYHY/pattern-recognition-hw01 | bs_nets.py | bs_nets.py | py | 1,386 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
74540182432 | from tornado import ioloop, options, web
options.define("port", default=8080, help="port to listen on")
options.define(
"host", default="127.0.0.1", help="host interface to connect on (0.0.0.0 is all)"
)
options.define("path", help="the files to serve")
SETTINGS = dict(
# enabling compression can have securit... | jupyter/accessibility | pa11y-jupyter/serve.py | serve.py | py | 1,663 | python | en | code | 63 | github-code | 1 | [
{
"api_name": "tornado.options.define",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "tornado.options",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "tornado.options.define",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "tornado.op... |
75080076513 | from fractions import Fraction
from .Belief import Belief
# fstring -- String -- String representation of formula (in s-expression style) (e.g. (Believes!4 alice now phi))
# fstring_no_ann -- String -- String form with no likelihood
# justification -- Justification || None -- Lin... | RAIRLab/ShadowAdjudicator | adjudicator/formula/LBelief.py | LBelief.py | py | 3,346 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "Belief.Belief",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "Parser.parse_fstring",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "fractions.Fraction",
"line_number": 58,
"usage_type": "call"
}
] |
28195259379 | from flask import Flask, jsonify, request, make_response
import jwt
import datetime
from functools import wraps
# import pliku
app = Flask(__name__)
app.config['SECRET_KEY'] ='thisisthesecretkey'
def token_required(f):
@wraps(f)
def decorated(*args, **kwargs):
token = request.args.get('token') #http:... | san24id/Arduino-Webservice | bbs.py | bbs.py | py | 1,725 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "flask.reque... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.