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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
25549551579 | import logging
from core.connect_db import connect_db
from logger.logger import configLogger
from settings.settings import load_settings
logger = logging.getLogger()
class BaseFetcher(object):
def __init__(self):
super(BaseFetcher, self).__init__()
configLogger()
self._connect_to_db()
... | cipriantruica/news_diffusion | news-spreading-master/fetchers/base_fetcher.py | base_fetcher.py | py | 774 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logger.logger",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logger.logger.configLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logger.logge... |
22034953643 | import pandas as pd
import s3fs
def main(event = None, context = None):
print("Start running LinkedInScraper")
values = [['Atreish Ramlakhan',
'New York, New York, United States',
'Katz School at Yeshiva University',
'Graduate Teaching Assistant',
'https:... | sczhou0705/IA-FinalProject-YUconnect | LambdaDeployment/Code/LinkedInScraper.py | LinkedInScraper.py | py | 1,878 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.DataFrame",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "s3fs.S3FileSystem",
"line_number": 31,
"usage_type": "call"
}
] |
72478034429 | """HartPro URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | cjxxu/A_Fiction_web | HartPro/urls.py | urls.py | py | 2,203 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "art.models.Tag.objects.all",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "art.models.Tag.objects",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "art.models.Tag",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": ... |
27264160200 | """
GenT2MF_Trapezoidal.py
Created 3/1/2022
"""
from __future__ import annotations
from typing import List
from juzzyPython.generalType2zSlices.sets.GenT2MF_Prototype import GenT2MF_Prototype
from juzzyPython.intervalType2.sets.IntervalT2MF_Trapezoidal import IntervalT2MF_Trapezoidal
from juzzyPython.type1.sets.T1MF_Tr... | LUCIDresearch/JuzzyPython | juzzyPython/generalType2zSlices/sets/GenT2MF_Trapezoidal.py | GenT2MF_Trapezoidal.py | py | 6,556 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "juzzyPython.generalType2zSlices.sets.GenT2MF_Prototype.GenT2MF_Prototype",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "juzzyPython.intervalType2.sets.IntervalT2MF_Trapezoidal.IntervalT2MF_Trapezoidal",
"line_number": 28,
"usage_type": "name"
},
{
"api... |
22768172274 | from backend import credential
import urllib.parse
from google.cloud import storage
import streamlit as st
import os
import json
import fnmatch
import file_io
import utils
import traceback
import io
def init():
creds_str = credential.google_creds()
if not os.path.exists('temp'):
os.makedirs('temp')
... | sean1832/Mongrel-Assemblies-DB | src/backend/gcp_handler.py | gcp_handler.py | py | 6,361 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "backend.credential.google_creds",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "backend.credential",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.... |
23541886221 |
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 22 15:37:26 2022
@author: jeros
Hu moments analysis
"""
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.ticker import PercentFormatter
def plotter(huN = 1, bananas = None,oranges = None,lemons = None):
# if bananas is not None:
... | jeroserpa/FruitClassifier | histogram_analisys.py | histogram_analisys.py | py | 1,459 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.linspace",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"li... |
29510374823 | import re
import pandas as pd
import fool
from copy import copy
from starter_code1.NER.ner01 import *
test_data = pd.read_csv('../data/info_extract/test_data.csv', encoding='gb2312', header=0)
# print(test_data.head())
test_data['ner'] = None
ner_id = 1001
ner_dict_new = {} # 存储所有实体
ner_dict_reverse_new = {} # 储存所... | jiangq195/tanxin | starter_code1/NER/ner02.py | ner02.py | py | 4,477 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "copy.copy",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "fool.analysis",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_nu... |
63614571 | import torch
import torch.nn.functional as F
import matplotlib.pyplot as plt # for making figures
import os
# read in all the words
current_dir = os.getcwd()
words = open(current_dir+'/makemore/names.txt', 'r').read().splitlines()
# print(f"{words[:8]}")
# build the vocabulary of characters and mappings to/from integ... | code-cp/bitesize_ai_rs | makemore/scripts/mlp.py | mlp.py | py | 2,642 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "os.getcwd",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "random.seed",
"line_number": 3... |
86625823283 | #! /usr/bin/env python
import argparse
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description='Linearly normalize intensity to between 0 and 255')
parser.add_argument("input_spec", type=str, help="Input specification")
parser.add_argument("out_version", type=str, ... | mistycheney/MouseBrainAtlas | preprocess/normalize_intensity_adaptive.py | normalize_intensity_adaptive.py | py | 8,733 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "argparse.RawDescriptionHelpFormatter",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 16,
"usage_type": "call"
},
{
"a... |
4034606024 | import argparse
import glob
import multiprocessing as mp
import os
import shutil
import time
import cv2
import tqdm
import numpy as np
from detectron2.config import get_cfg
from partseg import add_partseg_config
from detectron2.data.detection_utils import read_image
from detectron2.utils.logger import setup_logger
fr... | hansongfang/CompNet | PartSeg/predict_net.py | predict_net.py | py | 5,233 | python | en | code | 33 | github-code | 6 | [
{
"api_name": "detectron2.config.get_cfg",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "partseg.add_partseg_config",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.... |
386960757 | import os
from flask import Response,Flask, request
from flask_cors import CORS
from insgraph import util, instagram
def create_app(test_config=None):
"""Create and configure an instance of the Flask application."""
app = Flask(__name__, instance_relative_config=True)
print("zhuangjb flask start.....:"+__... | jiebinzhuang/insgraph-flask | insgraph/__init__.py | __init__.py | py | 2,301 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
30409488540 | import os
import pytest
import logging
import cocotb
from cocotb.clock import Clock, Timer
from cocotb.binary import BinaryValue
from cocotb.runner import get_runner
from cocotb.triggers import FallingEdge
from cocotbext.uart import UartSource, UartSink
src_dir = os.path.dirname(os.path.dirname(os.path.abspath(__fi... | ryarnyah/zenika-fpga-pres | demo/fpga-risc-cpu/src/test/test_soc.py | test_soc.py | py | 2,170 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"l... |
32644614877 | """
Given a universal mesh, record the placements of guide nodes as it relative to
universal mesh. And then repoisition guides to that relative position should
the universal mesh change from character to character.
from mgear.shifter import relativeGuidePlacement
reload(relativeGuidePlacement)
Execute the following c... | mgear-dev/mgear4 | release/scripts/mgear/shifter/relative_guide_placement.py | relative_guide_placement.py | py | 19,592 | python | en | code | 209 | github-code | 6 | [
{
"api_name": "maya.cmds.listRelatives",
"line_number": 106,
"usage_type": "call"
},
{
"api_name": "maya.cmds",
"line_number": 106,
"usage_type": "name"
},
{
"api_name": "maya.cmds.objectType",
"line_number": 111,
"usage_type": "call"
},
{
"api_name": "maya.cmds",... |
36347921741 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_pyredatam
Tests for `pyredatam` module.
"""
from __future__ import unicode_literals
import unittest
import nose
import pyredatam
import queries
class RedatamTestCase(unittest.TestCase):
def test_arealist_query(self):
# Test case AREALIST1
... | abenassi/pyredatam | tests/test_pyredatam.py | test_pyredatam.py | py | 3,362 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pyredatam.arealist_query",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "queries.AREALIST1.strip",
"line_number": 32,
"usage_type": "call"
},
{
"api_name"... |
22329941730 | from discord.ext import commands, tasks
import discord
import asyncio
import os
import json
import sqlite3
from dotenv import load_dotenv
import requests
from datetime import datetime,time
load_dotenv()
class Birthday(commands.Cog):
"""Birthday commands."""
def __init__(self, client):
self.client = c... | micfun123/Simplex_bot | cogs/birthday.py | birthday.py | py | 14,104 | python | en | code | 24 | github-code | 6 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.Cog",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": ... |
29279761170 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Ambre chamber
"""
__author__ = "Dennis van Gils"
__authoremail__ = "vangils.dennis@gmail.com"
__url__ = "https://github.com/Dennis-van-Gils/project-Ambre-chamber"
__date__ = "31-08-2020"
__version__ = "2.0"
# pylint: disable=bare-except, broad-except, try-except-raise
... | Dennis-van-Gils/project-Ambre-chamber | src_python/main.py | main.py | py | 22,276 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyqtgraph.setConfigOptions",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "pyqtgraph.setConfigOptions",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "pyqtgraph.setConfigOptions",
"line_number": 53,
"usage_type": "call"
},
{
"... |
11579227616 | import cv2
import numpy as np
from imageclassifier import ImageClassifier
n_clusters = [3, 4, 5, 6, 7, 8]
kmeans_keys = [
[0], [1], [2],
[0, 1], [0, 2], [1, 2],
[0, 1, 2]
]
sorting_lambdas = [
lambda pixel: pixel[0],
lambda pixel: pixel[1],
lambda pixel: pixel[2],
lambda pixel: sum(pixe... | elraffray/pyImage | classifier.py | classifier.py | py | 4,167 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.COLOR_BGR2HSV",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "cv2.COLOR_BGR2LAB",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "cv2.COLOR_BGR2HLS",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "... |
42992886102 | import gspread
import numpy as np
import pandas as pd
from datetime import date
from datetime import datetime
import csv
import pytz
from oauth2client.service_account import ServiceAccountCredentials
import requests
#authorization
service_account = gspread.service_account(filename = 'capstone-362722-f3745d9260b7.json' ... | mcenek/TeamLiftCSWaterProject | CloudUpload/datapusher.py | datapusher.py | py | 5,965 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "gspread.service_account",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "oauth2client.service_account.ServiceAccount... |
35379919905 | from flask import Flask
from flask_apscheduler import APScheduler
# config scheduling class
from statuschecker import get_health_status
class Config(object):
JOBS = [
{
'id': 'check_health',
'func': 'app:check_health',
'trigger': 'interval',
'seconds': 180... | tynorantoni/HealthCheckService | app.py | app.py | py | 687 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "statuschecker.get_health_status",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "flask_apscheduler.APScheduler",
"line_number": 33,
"usage_type": "call"
}
] |
29010500134 | import functools
import os
import sys
from typing import Any, Callable, Iterable, Optional, TextIO, Tuple
import click
from click import Command
from click_option_group import MutuallyExclusiveOptionGroup
from . import __version__
from .core import (
CheckHashLineError,
HashFileReader,
HashFileWriter,
... | xymy/gethash | src/gethash/script.py | script.py | py | 11,381 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "typing.Optional",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "core.HashFileWriter",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.utime",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "os.path.getmtime",
"... |
42307014223 | import os
import sys
import time
from acbbs.drivers.ate.ClimCham import ClimCham
from acbbs.drivers.ate.DCPwr import DCPwr
from acbbs.drivers.ate.PwrMeter import PwrMeter
from acbbs.drivers.ate.RFSigGen import RFSigGen
from acbbs.drivers.ate.RFSigGenV import RFSigGenV
from acbbs.drivers.ate.SpecAn import SpecAn
from a... | Wonters/IHMweb | calib/tasks.py | tasks.py | py | 13,334 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "acbbs.tools.log.get_logger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "configuration.CHANNELS",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "configuration.INPUTS",
"line_number": 23,
"usage_type": "attribute"
},
{
"... |
29128123138 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import embed_video.fields
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('tracks', '0006_... | TimBest/ComposersCouch | tracks/migrations/0007_video.py | 0007_video.py | py | 924 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.swappable_dependency",
"line_number": 12,
"usage_type": "call... |
21396441749 | import os
from django.conf import settings
from django.db import connection, close_old_connections
from django.db.utils import OperationalError
from fastapi import FastAPI
from fastapi.responses import JSONResponse
from racetrack_client.utils.shell import shell, CommandError
from lifecycle.django.registry.database im... | TheRacetrack/racetrack | lifecycle/lifecycle/endpoints/health.py | health.py | py | 2,317 | python | en | code | 27 | github-code | 6 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "lifecycle.config.Config",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "os.environ.get",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.environ",
... |
8655705907 | import errno
import os
import requests
from pathlib import Path
import sly_globals as g
import supervisely as sly
from supervisely.app.v1.widgets.progress_bar import ProgressBar
progress5 = ProgressBar(g.task_id, g.api, "data.progress5", "Download weights", is_size=True, min_report_percent=5)
local_weights_path = No... | supervisely-ecosystem/unet | supervisely/train/src/ui/step05_models.py | step05_models.py | py | 4,736 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "supervisely.app.v1.widgets.progress_bar.ProgressBar",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sly_globals.task_id",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sly_globals.api",
"line_number": 10,
"usage_type": "attribut... |
11353167972 | # Licensed under a 3-clause BSD style license - see LICENSE
from __future__ import print_function, division
from astropy.table import Table, Column
from .import_modules import *
##----- ----- ----- ----- ----- ----- ----- ----- ----- -----##
## Miscellaneous utilities
## Contain functions that do not pertain to a p... | bretonr/Icarus | Icarus/Utils/Misc.py | Misc.py | py | 3,104 | python | en | code | 11 | github-code | 6 | [
{
"api_name": "astropy.table.Table",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "astropy.table.Column",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "astropy.table.Table",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "operator... |
20503848569 | # Необходимо парсить страницу со свежими статьями (вот эту) и выбирать те статьи, в которых встречается хотя бы одно из ключевых слов (эти слова определяем в начале скрипта). Поиск вести по всей доступной preview-информации (это информация, доступная непосредственно с текущей страницы). Вывести в консоль список подходя... | Dimasuz/HW_4.3 | HW_4.3.py | HW_4.3.py | py | 3,750 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 69,
"usage_type": "call"
}
] |
70097868029 | import pygame as pg
from pygame.sprite import Sprite
class Ship(Sprite):
def __init__(self, screen, settings):
super(Ship, self).__init__()
self.screen = screen
self.settings = settings
self.sprite = pg.image.load('./assets/spaceship.png')
self.scale_factor = 10
... | hoangdesu/Alien-Invasion-Pygame | ship.py | ship.py | py | 1,239 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pygame.sprite.Sprite",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "pygame.image.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pygame.transf... |
33198762995 | import ConfigParser
import io
import sys
import os
import numpy as np
from scipy.stats import cumfreq
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import matplotlib.cm as cm
from mpl_toolkits.axes_grid1 import make_axes_locatable
from mpl_toolkits.basemap import Basemap
from matp... | edwinkost/PCR-GLOBWB_validation | niko_validation_scripts/standAlone/plotValidation.py | plotValidation.py | py | 7,155 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "ConfigParser.RawConfigParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pypl... |
30569513843 | from flask import Flask, render_template, flash, redirect, url_for, session, logging, request
from wtforms import Form, StringField, validators
import Project
import re
app = Flask(__name__)
@app.route("/search")
def search():
return render_template('search.html')
class WordPredictionForm(Form):... | jmgang/wordpredictor | app.py | app.py | py | 1,218 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "wtforms.Form",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "wtforms.StringField",
... |
32742347893 | import requests,time
from bs4 import BeautifulSoup
import p_mysql,json
class jxy_all():
def xunhuan(self,gol_cookies):
wrong = 0
first_run = 0
jishu = 0
toufayu = False
multiple = [1, 3, 7, 15, 31, 63, 127, 34, 55, 89, 144, 1, 1]
maxwrong = 6
global moni
... | ssolsu/newproject | server_jxy.py | server_jxy.py | py | 13,611 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.strftime",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_numbe... |
18015910724 | import os
import numpy as np
import matplotlib.pyplot as plt
import cv2
# Import PyWavelets library
import pywt
import pywt.data
# Load an example image
path = os.path.dirname(__file__)
image_path = "image.jpg"
original_image = cv2.imread(os.path.join(path, image_path), cv2.IMREAD_GRAYSCALE)
# Perform 2D wavelet tra... | kio7/smart_tech | Submission 2/Task_4/wavelet_transform.py | wavelet_transform.py | py | 1,989 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numb... |
17661433287 | from itertools import islice
from collections import defaultdict
def distance(point):
return abs(point[0]) + abs(point[1])
def neighbours(point):
x, y = point
return ((x+1, y), (x-1, y), (x, y+1), (x, y-1),
(x+1, y+1), (x-1, y-1), (x+1, y-1), (x-1, y+1))
def spiral_seq():
yield 0, 0
x... | pdhborges/advent-of-code | 2017/3.py | 3.py | py | 1,231 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "itertools.islice",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "itertools.islice",
"line_number": 38,
"usage_type": "call"
}
] |
7354238248 | # -*- coding: utf-8 -*-
import scrapy
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
from kouzi_crawler.items import KouziCrawlerItem
class QzkeySpider(CrawlSpider):
name = 'qzkey'
allowed_domains = ['qzkey.com']
start_urls = ['http://mimi1688.aly611.qzkey.com/... | largerbigsuper/kouzi_crawler | kouzi_crawler/spiders/qzkey.py | qzkey.py | py | 1,054 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scrapy.spiders.CrawlSpider",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "scrapy.spiders.Rule",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "scrapy.linkextractors.LinkExtractor",
"line_number": 13,
"usage_type": "call"
},
{
... |
28857307321 |
import torch
import numpy as np
from six import string_types
from torch import optim
import inspect
import torch.nn as nn
import torch.nn.parallel
from torch.autograd import Variable
import torch.nn.functional as F
from tqdm import tqdm
import copy
def get_function_args( fn ):
"""returns a list of all argum... | divamgupta/pytorch-propane | pytorch_propane/utils.py | utils.py | py | 4,467 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "inspect.getargspec",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "inspect.getargspec",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "inspect.getargspec",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "inspect.geta... |
74280993467 | import os
import sys
import threading
import asyncio
sys.path.append(os.path.join(os.path.dirname(__file__), "lib"))
import discord
client = None
channel = None
ready = False
def init():
global client
global channel
intents = discord.Intents.default()
intents.message_content = True
client = disc... | mojyack/rpi-cat-monitor | remote.py | remote.py | py | 1,161 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
21071659263 | from enum import Enum
import ffmpeg
import numpy as np
import pandas as pd
import torch
from data_processing.custom_segmentation import CustomSegmentationStrategy
from data_processing.simple_segmentation import SimpleSegmentation
from data_processing.voice_activity_detection import VADSilero
class Method(Enum):
... | centre-for-humanities-computing/Gjallarhorn | data_processing/convert_audiofile_to_segments.py | convert_audiofile_to_segments.py | py | 4,941 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "data_processing.voice_activity_detection.VADSilero",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "data_processing.custom_segmentation.CustomSegmentationStrategy",
"line_number": ... |
18602034777 | from django import forms
from bankapp.models import Person, City
GENDER_CHOICES = [
('Male', 'Male'),
('Female', 'Female')
]
MATERIALS_PROVIDE_CHOICE = [
('Debit Card', 'Debit Card'),
('Credit Card', 'Credit Card'),
('Check Book', 'Check Book'),
]
class PersonCreationForm(forms.ModelForm):
gender = forms.Ch... | Manjith123/Easybankproject | bankapp/forms.py | forms.py | py | 2,110 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.forms.ChoiceField",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "dja... |
10719490049 | import sys
import pathlib
import generator_func
import generator_logging
from datetime import datetime
from PyQt6.QtCore import QRunnable, QThreadPool, QDateTime, QSettings
from PyQt6.QtWidgets import (QApplication,
QDateTimeEdit,
QLabel,
... | Steelglowhawk/updateTool | generator_gui.py | generator_gui.py | py | 10,348 | python | ru | code | 1 | github-code | 6 | [
{
"api_name": "PyQt6.QtCore.QRunnable",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "genera... |
73817284346 | """Basic status commands to check the health of the bot."""
import datetime
import discord
from discord.ext import commands
from metricity.config import BotConfig
DESCRIPTIONS = (
"Command processing time",
"Last event received",
"Discord API latency",
)
ROUND_LATENCY = 3
INTRO_MESSAGE = "Hello, I'm {nam... | python-discord/metricity | metricity/exts/status.py | status.py | py | 1,958 | python | en | code | 39 | github-code | 6 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.Bot",
"line_number": 21,
"usage_type": "attribute"
},
{
"... |
44075659516 | from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
import time
import pickle
import os
#put url here
#example_url= "https://archive.thehated3.workers.dev/0:/Statio... | aniket328/workers-dev-download-folders | fx.py | fx.py | py | 4,837 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.FirefoxOptions",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 29,
"usage_type": "call"
},
{
"a... |
24013809061 | from QLearning import Game
from collections import Counter
import pandas as pd
import matplotlib.pyplot as plt
gamma = 0.1
def Menu():
usr_op = None
while usr_op != 0:
print('//-//-//-// Card-Jitsu Menu //-//-//-//')
print('\nSelect an option to continue: ')
print('1. Play game vs AI.'... | Marinovsky/Card-Jitsu | metrics_modifications/game.py | game.py | py | 3,225 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "QLearning.Game",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "QLearning.Game",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame.from_dict",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "pandas.DataF... |
19637375362 | import serial
import datetime as dt
import sys
class gps:
def __init__(self, port = "/dev/serial0"):
# Initializes serial connection for gps communication
try:
self.__ser = serial.Serial(port)
except Exception as e:
sys.exit("Can not connect with GPS usin... | maciejzj/pi-observer | scripts/gps.py | gps.py | py | 5,664 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "serial.Serial",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"... |
9357540363 | #!/usr/bin/env python
__author__ = 'j5wagner@ucsd.edu'
import commands
from d3r.celppade.custom_protein_prep import ProteinPrep
class chimera_dockprep(ProteinPrep):
"""Abstract class defining methods for a custom docking solution
for CELPP
"""
ProteinPrep.OUTPUT_PROTEIN_SUFFIX = '.mol2'
... | drugdata/tutorial_rdock_implementation | tutorial_rdock_implementation/tutorial_rdock_implementation_protein_prep.py | tutorial_rdock_implementation_protein_prep.py | py | 3,827 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "d3r.celppade.custom_protein_prep.ProteinPrep",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "d3r.celppade.custom_protein_prep.ProteinPrep.OUTPUT_PROTEIN_SUFFIX",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "d3r.celppade.custom_protein_... |
75316082746 | import os
import wx
from wx.lib.colourchooser.canvas import Canvas
class ImageCanvas(wx.Panel):
"""
Image Panel
"""
def __init__(self, parent, image_path=None, *args, **kwargs):
"""
Constructor
:param parent:
"""
wx.Panel.__init__(self, parent=parent, *args, ... | JoenyBui/boa-gui | boaui/panel/image.py | image.py | py | 4,085 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "wx.Panel",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "wx.Panel.__init__",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "wx.Panel",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "wx.Bitmap",
"line_nu... |
856153134 | from setuptools import setup
import sys
VERSION = '1.2.1263'
plist = dict(
CFBundleName='VisTrails',
CFBundleShortVersionString=VERSION,
CFBundleGetInfoString=' '.join(['VisTrails', VERSION]),
CFBundleExecutable='vistrails',
CFBundleIdentifier='edu.utah.sci.vistrails',
)
sys.path.append('../..')
... | VisTrails/VisTrails | scripts/dist/mac/setup_itk.py | setup_itk.py | py | 1,027 | python | en | code | 100 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "setuptools.setup",
"line_number": 27,
"usage_type": "call"
}
] |
16325116494 | from functools import wraps
from typing import Callable
from util.threading import Thread, TimeoutException
from util.typing import P
from .AbstractHandler import PAYLOAD_TYPE, RESPONSE_TYPE, CONTEXT_TYPE, AbstractHandler
class AbstractTimeoutHandler(AbstractHandler[PAYLOAD_TYPE, RESPONSE_TYPE, CONTEXT_TYPE]):
... | MysteriousChallenger/nat-holepunch | protocol/interface/request_handler/AbstractTimeoutHandler.py | AbstractTimeoutHandler.py | py | 1,804 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "AbstractHandler.AbstractHandler",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "AbstractHandler.PAYLOAD_TYPE",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "AbstractHandler.RESPONSE_TYPE",
"line_number": 10,
"usage_type": "name"
},... |
21228252116 | from django.urls import path
from widgets.views import HomePageView, UserProfilePageView, SharedWidgetsPageView, \
PrivateWidgetsPageView, MemoryWidgetsView
urlpatterns = [
path('', HomePageView.as_view(), name='home'),
path('home/shared-widgets/', SharedWidgetsPageView.as_view(), name='shared-widgets'),
... | alex-polo/homepage | widgets/urls.py | urls.py | py | 607 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "widgets.views.HomePageView.as_view",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "widgets.views.HomePageView",
"line_number": 7,
"usage_type": "name"
},
{
"api_n... |
72143866108 |
from typing import Any, Dict
def play_game() -> None:
print('playing game')
def update_state(current_state: Dict) -> Dict:
print('here we change things')
possible_actions = {
'mod status': lambda : print('modifting status'),
'remove status': lambda : print('removing status'),
... | levensworth/udesa-pc-tutorial | 2022-a/4-testing_and_train/solutions/example_command.py | example_command.py | py | 1,096 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "typing.Dict",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 25,
"usage_type": "name"
}
] |
38722538066 | import pandas as pd
import numpy as np
import tensorflow as tf
import sklearn.model_selection as sk
import helper as hp
import preprocessing as pre
import machine_learning as ml
import json
import os
from flask import Flask, redirect, url_for, request, jsonify
from tensorflow.keras import layers
from tensorflow.keras.... | ahmedhazemfekry/Neural-Network-Flask-Server | server.py | server.py | py | 4,067 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "flask.request.data",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
... |
29191289762 | import datetime
import json
import os
import re
import shutil
class Fileop():
def isDirectory(self, fDir):
return os.path.isdir(fDir)
def countDir(self, dPath):
dirListing = next(os.walk(dPath))[2]
return len(dirListing)
def CjsonLoad(self, jfile):
fdir = os.path.join(Fil... | kkweli/Avaya | Avy/avayaFile.py | avayaFile.py | py | 4,353 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.isdir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.walk",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": ... |
13453404410 | import sqlite3
from flask import Flask
import json
app = Flask(__name__)
@app.route('/animals/<idx>')
def animals(idx):
with sqlite3.connect("animal.db") as connection:
cursor = connection.cursor()
query = f"""
select * from animals_final
left join outcomes on outcomes.ani... | aquwue/lesson_15 | main_program.py | main_program.py | py | 812 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 30,
"usage_type": "call"
}
] |
41439897989 | from django.test import TestCase
from django.urls.base import reverse
from .models import Provinces
# Create your tests here.
class ProvincesModelTests(TestCase):
def test_get_one_province(self):
"""if not province exist with passed id, return appropiate message"""
province = Provinces.objects.cre... | matiasfeliu92/crud_provincias | server/provinciasCrud/tests.py | tests.py | py | 1,119 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.test.TestCase",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "models.Provinces.objects.create",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.Provinces.objects",
"line_number": 10,
"usage_type": "attribute"
},
{
... |
5243707290 | #!/usr/bin/env python3
import sys
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
NUMBER_OF_WORDS = 50
file_path = sys.argv[1]
lines = pd.read_table(file_path, header=None, delim_whitespace=True)
lines = lines.sample(NUMBER_OF_WORDS).reset_index(drop=Tru... | data-science-and-big-data-analytics/data-science-frameworks | FastText/evaluation.py | evaluation.py | py | 819 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_table",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.decomposition.PCA",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.... |
43242415991 | from os.path import abspath, dirname, join
from preggy import expect
from tornado.testing import gen_test
from tests.base import TestCase
from thumbor.compatibility.storage import Storage
from thumbor.config import Config
from thumbor.context import Context, ServerParameters
from thumbor.importer import Importer
STO... | thumbor/thumbor | tests/compatibility/test_compatibility_storage.py | test_compatibility_storage.py | py | 4,916 | python | en | code | 9,707 | github-code | 6 | [
{
"api_name": "os.path.abspath",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tests.base.TestCase",
... |
32169695426 | import requests
from .models import Item
import datetime
from django.utils.timezone import make_aware
def fetch_items():
conn = requests.get('https://hacker-news.firebaseio.com/v0/newstories.json?print=pretty')
res = sorted(conn.json())
return list(reversed(res))[:5] # top 5 stories
def fetch_item_by_id(i... | Alisjj/HackerNews | newsList/fetcher.py | fetcher.py | py | 2,008 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "models.Item.objects.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "models.Item.objects"... |
10422172533 | from __future__ import annotations
from PySide6.QtCore import QMargins, QPoint, QRect, QSize, Qt
from PySide6.QtWidgets import QLayout, QSizePolicy, QWidgetItem
class FlowLayout(QLayout):
def __init__(self, parent=None, center=False):
super().__init__(parent)
if parent is not None:
s... | randovania/randovania | randovania/gui/lib/flow_layout.py | flow_layout.py | py | 3,663 | python | en | code | 165 | github-code | 6 | [
{
"api_name": "PySide6.QtWidgets.QLayout",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PySide6.QtCore.QMargins",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PySide6.QtWidgets.QWidgetItem",
"line_number": 14,
"usage_type": "name"
},
{
"ap... |
74589712187 | import cv2
smilecascade=cv2.CascadeClassifier('haarcascade\\haarcascade_smile.xml')
cap = cv2.VideoCapture(0)
while 1:
ret, img=cap.read()
#gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
smiles = smilecascade.detectMultiScale(img, 1.3,50 )
for (x,y,w,h) in smiles:
cv2.rectangle(img, ... | harshikesh-kumar/Projects | Project Smile Detect.py | Project Smile Detect.py | py | 488 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"... |
29954994164 | from __future__ import print_function
import re
import bitarray
def filterFeatures(sr_obj, feature_types=None, qualifier_regexs=None):
"""Filter a `SeqRecord` object's `SeqFeature` list by type and qualifiers.
Args:
sr_obj (``SeqRecord``) : instantiated Biopython
... | Wyss/mascpcr | mascpcr/genbankfeatures.py | genbankfeatures.py | py | 7,725 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "re.search",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "bitarray.bitarray",
"line_number": 144,
"usage_type": "call"
},
{
"api_name": "bitarray.bitarray",
"line_number": 146,
"usage_type": "call"
},
{
"api_name": "bitarray.bitarray",
... |
71066866429 | from ....utils.onlinetex import tex_to_svg_file_online
from ....utils.jupyter import video
from ..scene import SceneGL
from ..config import Size
from .plot import Plot
from .scatter import Scatter
from pathlib import Path
import re
import time
import shutil
from manimlib import (
BLUE,
GREEN,
ShowCreation,... | beidongjiedeguang/manim-express | manim_express/backend/manimgl/express/eager.py | eager.py | py | 10,559 | python | en | code | 13 | github-code | 6 | [
{
"api_name": "scene.SceneGL",
"line_number": 56,
"usage_type": "name"
},
{
"api_name": "config.Size.big",
"line_number": 59,
"usage_type": "attribute"
},
{
"api_name": "config.Size",
"line_number": 59,
"usage_type": "name"
},
{
"api_name": "manimlib.config.parse_... |
21365592875 | from __future__ import print_function
import sys
import os
from os.path import exists, dirname
import numpy as np
import pickle
import json
import time
import six
if six.PY3:
import _thread as thread
from queue import Queue
else:
import thread
from Queue import Queue
from collections import OrderedDict
... | liyishuilys/SMPT | src/utils.py | utils.py | py | 7,884 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "six.PY3",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pahelix.utils.splitters.RandomSplitter",
"line_number": 128,
"usage_type": "call"
},
{
"api_name": "pahelix.utils.splitters.IndexSplitter",
"line_number": 130,
"usage_type": "call"
}... |
34221019372 | """
UP42 authentication mechanism and base requests functionality
"""
import json
from pathlib import Path
from typing import Dict, List, Optional, Union
import requests
import requests.exceptions
from tenacity import (
Retrying,
wait_fixed,
wait_random_exponential,
stop_after_attempt,
retry_if_exc... | stasSajinDD/up42-py | up42/auth.py | auth.py | py | 10,421 | python | en | code | null | github-code | 6 | [
{
"api_name": "up42.utils.get_logger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tenacity.retry_if_exception",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "requests.exceptions",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_na... |
22879333885 | # import socket
# import json
# s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# # host = socket.gethostname()
# port = 9999
# s.connect(("127.0.0.1", port))
# msg = s.recv(1024)
# msg = msg.decode('utf-8')
# print(msg)
# s.close()
import socket
import json
s = socket.socket(socket.AF_INET, socket.SOCK_STR... | HugoXK/ECE-445-Senior-Design | client.py | client.py | py | 491 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "socket.socket",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "json.dumps"... |
35241998177 | from flask import Flask
#from flask_cors import CORS, cross_origin
from pymongo import MongoClient
connection = MongoClient("mongodb://localhost:27017/")
def create_mongodatabase():
try:
dbnames = connection.database_names()
if 'cloud_native' not in dbnames:
db = connection.cloud_nativ... | AnatolyS1/Cloud-Native-Python | app.py | app.py | py | 8,921 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "flask.make_response",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
... |
72740356347 | import subprocess
from dataclasses import dataclass
from typing import Dict
import json
from src.config import LOGGER
@dataclass
class Server:
server_name: str
server_id: int
class SpeedTestGateway:
@classmethod
def get_speed_test_result(cls, server_id: int) -> Dict:
command = [
... | galloramiro/internet-connection-log | src/speed_test_gateway.py | speed_test_gateway.py | py | 1,128 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "subprocess.check_output",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "subprocess.CalledProcessError",
"line_number": 29,
"usage_type": "attribute"
},
{
"a... |
19703597779 | # check the costs after every time consuming all examples
# usage: python check_costs.py
import mnist_loader
training_data, validation_data, test_data = mnist_loader.load_data_wrapper()
import network
import numpy as np
import matplotlib.pyplot as plt
net = network.Network([784, 30, 10])
net.set_check_cost_inside_SGD... | hzget/machine-learning | dl_tutorial/check_costs.py | check_costs.py | py | 617 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "mnist_loader.load_data_wrapper",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "network.Network",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "... |
26171304664 | import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from torch.nn import CrossEntropyLoss
from torch.optim import Adam
from datetime import datetime
class MLPClassifier(nn.Module):
def __init__(self):
super().__init__()
self.MLP = nn.Sequential(
nn.Linear(10000... | Charlie-Bell/stack-overflow-classifier | src/MLP.py | MLP.py | py | 2,284 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
30665509176 | from django.urls import path
from . import views
urlpatterns = [
path('', views.home, name='home'),
path('about/', views.about, name='about'),
path('cows/', views.cows_index, name='index'),
path('cows/<int:cow_id>/', views.cows_detail, name='detail'),
path('cows/create/', views.CowCreate.as_view(), name='cow... | jessmucklow/cowcollector | main_app/urls.py | urls.py | py | 1,122 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
28395227304 | import torch
import torch.nn as nn
class ContentLoss(nn.Module):
def __init__(self, target):
super(ContentLoss, self).__init__()
# 必须要用detach来分离出target,否则会计算目标值的梯度
self.target = target.detach()
self.criterion = nn.MSELoss()
def forward(self, inputs):
self.loss = self.c... | cwpeng-cn/style-transfer | losses.py | losses.py | py | 1,004 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.MSELoss",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_num... |
18187145317 | # -----------------------------
# pluieOS source code
# made with heart by dadoum
# -----------------------------
# Partly based on rainbox
# -----------------------------
import subprocess
import sys
import time
import signal
import os
import traceback
import matplotlib as matplotlib
import numpy
import sh... | Dadoum/pluieOS | pluieLauncher.py | pluieLauncher.py | py | 4,248 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "os.getenv",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pluieAPI.Application",
"line_... |
24213867050 |
from django.contrib import admin
from django.urls import path, include
from . import views
#应用的名称
app_name = 'userprofile'
urlpatterns = [
path('login/', views.user_login, name='login'),
path('logout/', views.user_logout, name='logout'),
path('register/', views.user_register, name='register'),
#用户信息
pa... | blackjibert/Blog | myblog/userprofile/urls.py | urls.py | py | 392 | python | en | code | 0 | github-code | 6 | [
{
"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",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
25091116397 | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 8 13:14:13 2019
@author: jordan loll
Creating a cards library / deck
"""
import random
from PIL import Image, ImageDraw
#Local Path
local_path =r"C:\Users\jorda\Documents\PythonPrograms\Questar\Git_Stuff\Quest-Game"
#local_path = r"C:\Users\xTheC\Desktop\Quest\Quest-G... | scottwedge/Quest-Game | Old Files/cards.py | cards.py | py | 1,214 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PIL.Image.open",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 33,
"usage_type": "name"
}
] |
33147997203 | from covid_constants_and_util import *
import geopandas as gpd
import statsmodels.api as sm
import json
import copy
from fbprophet import Prophet
from collections import Counter
import re
import h5py
import ast
from shapely import wkt
from scipy.stats import pearsonr
import fiona
import geopandas
import csv
import os
f... | snap-stanford/covid-mobility | helper_methods_for_aggregate_data_analysis.py | helper_methods_for_aggregate_data_analysis.py | py | 68,047 | python | en | code | 146 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number":... |
29942141352 | import functools
import typing as tp
import shapely.geometry
import torch
import torchmetrics
from torch.nn.utils.rnn import PackedSequence
def _multiarange(counts: torch.Tensor) -> torch.Tensor:
"""Returns a sequence of aranges concatenated along the first dimension.
>>> counts = torch.tensor([1, 3, 2])
... | gchaperon/pointer-networks | ptrnets/metrics.py | metrics.py | py | 8,846 | python | en | code | 20 | github-code | 6 | [
{
"api_name": "torch.Tensor",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.ones",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.int64",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "torch.Tensor",
"lin... |
35616526877 | # https://adventofcode.com/2022/day/15
from dataclasses import dataclass
from aoctk.data import Range, weighted_union_size
from aoctk.input import get_lines
from aoctk.metric import manhattan2d as md
@dataclass
class Sensor:
pos: complex
beacon: complex
distance: int
def __init__(self, desc):
... | P403n1x87/aoc | 2022/15/code.py | code.py | py | 1,883 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "aoctk.metric.manhattan2d",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "aoctk.data.Range",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "aoctk... |
23936105649 | import numpy as np
from scipy.io import loadmat
from variables import*
def load_mat_file(mat_file):
mat_data = loadmat(mat_file)
x, y = mat_data['X'], mat_data['y']
x = x.reshape(
-1,
input_shape[0],
input_shape[1],
input_shape[2]
... | 1zuu/SVHN-Image-Classification | util.py | util.py | py | 543 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scipy.io.loadmat",
"line_number": 7,
"usage_type": "call"
}
] |
70720136829 | import re
from zipfile import ZipFile
nothing = 90052
nothings = []
with ZipFile('channel.zip', 'r') as myzip:
def get_path(nothing):
return '{0}.txt'.format(nothing)
def get_next_nothing(nothing):
data = myzip.read(get_path(nothing)).decode('utf-8')
m = re.search('(\d*)$', data)
... | akiran/pythonchallenge | challenge7.py | challenge7.py | py | 758 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "zipfile.ZipFile",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 12,
"usage_type": "call"
}
] |
40253497699 | from django.urls import path
from . import views
app_name = 'chat'
urlpatterns = [
path('', views.index, name='index'),
path('create_room/', views.create_room, name='create_room'),
path('my_rooms/', views.rooms_list, name='rooms_list'),
path('<str:room_name>/', views.room, name='room'),
]
| michalr45/django-chat | chat/urls.py | urls.py | py | 308 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"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",
... |
71997536508 | from django.shortcuts import render, redirect
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from .forms import *
from .models import *
# from my side...
@login_required(login_url='/useraccount/common_login')
def business_location_list(request):
if request.method =... | chaitphani/New-DivMart | div_settings/views.py | views.py | py | 3,238 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.messages.success",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 22,
"usage_type": "call"
},
{
... |
71969681149 | """This module is useful for generating yaml files for the withParams tests and for running unformal
compiler tests during development."""
import time
from kfp.compiler import compiler
from kfp import dsl
from kfp.dsl import _for_loop
class Coder:
def __init__(self, ):
self._code_id = 0
def get_code... | kubeflow/kfp-tekton-backend | sdk/python/tests/compiler/compiler_withparams_test_helper.py | compiler_withparams_test_helper.py | py | 3,332 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "kfp.dsl._for_loop.LoopArguments",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "kfp.dsl._for_loop",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "kfp.dsl.ParallelFor",
"line_number": 19,
"usage_type": "attribute"
},
{
"a... |
6969799516 | import re
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.checkpoint as cp
from collections import OrderedDict
from torch import Tensor
from torch.jit.annotations import List
#added
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
from load_utils... | ada-shen/icCNN | densenet_ori_train.py | densenet_ori_train.py | py | 20,335 | python | en | code | 18 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "torch.nn.BatchNorm2d",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"li... |
36724497528 | from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.db.models import Count
from django.http import Http404
from django.shortcuts import render, get_object_or_404, redirect
from django.urls import reverse_lazy, reverse
from django.utils import t... | zawi99/web-boards | boards/views.py | views.py | py | 4,855 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "models.Board",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "django.views.generic.ListView",
"line_number": 24,
"usage_type": "name"
},
{
"api_name... |
73008021309 | #Lesson / Exercise 23 my code, sort the customer total amount
from pyspark import SparkConf, SparkContext #boilerplate
conf = SparkConf().setMaster("local").setAppName("TotalAmountOrdered")
sc = SparkContext(conf = conf)
def parseLine(line):
fields = line.split(',')
return (int(fields[0]), float(fields[2])... | CenzOh/Python_Spark | MyCode/customerTotalAmountSorted.py | customerTotalAmountSorted.py | py | 1,078 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyspark.SparkConf",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pyspark.SparkContext",
"line_number": 5,
"usage_type": "call"
}
] |
28749398084 | import urllib2
import json
import mraa
import threading
import sys
import time
moveSensor = mraa.Gpio(20)
moveSensor.dir(mraa.DIR_IN)
soundSensor = mraa.Gpio(21)
soundSensor.dir(mraa.DIR_IN)
fotoSensor = mraa.Gpio(43)
fotoSensor.dir(mraa.DIR_IN)
gasSensor = mraa.Gpio(17)
gasSensor.dir(mraa.DIR_IN)
def update():
... | Jasiu0/SmartGlassIoT | client-linkit/rest_client.py | rest_client.py | py | 1,172 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "mraa.Gpio",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "mraa.DIR_IN",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "mraa.Gpio",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "mraa.DIR_IN",
"line_number": 1... |
22458997174 | import flask
from flask import Flask,request,jsonify
import json
from sqlib import cek_data_user, input_data,input_dataa, show_data, node1_suhu, node1_kelembapanudara, node1_kelembapantanah, node1_keltanah_konversi, node1_intensitascahaya, node1_curahhujan, node1_curahhujan_konversi, node2_suhu, node2_kelembapanudara, ... | triani16/Aplikasi-Monitoring-Tanaman | penerima.py | penerima.py | py | 6,735 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "flask.jsonify",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line... |
18454402127 | # -*- coding: utf-8 -*-
from __future__ import print_function, absolute_import
import sys
import argparse
import logging.config
from pathlib import Path
sys.path.append(str(Path().absolute()))
from mx_crm.main import run_completing
from mx_crm.settings import LOGGING
logging.config.dictConfig(LOGGING)
logger = log... | alexpinkevichwork/squirrel | complete_data.py | complete_data.py | py | 2,311 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.config.config.dict... |
26425792111 | import pandas as pd
import optuna
import numpy as np
from pathlib import Path
import datetime
import lightgbm
import pickle
from functools import partial
import logging
import argparse
from clearml import Task
WORK_DIR = Path(".")
STUDY_PATH = WORK_DIR.joinpath(
f'total_dataset_study_{datetime.datetime.now().strft... | Anaksibia/Ticket_distribution_system | scripts/run_optuna_5_dates.py | run_optuna_5_dates.py | py | 13,803 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pandas.Data... |
39634585253 | # supervised training
import argparse
import os
import numpy as np
import math
import itertools
import datetime
import time
import sys
import torchvision.transforms as transforms
import torchvision.models as models
from torchvision.utils import save_image
from torch.utils.data import DataLoader
from torchvision impor... | JingshuaiLiu/HFMRI | single_coil_dense_network.py | single_coil_dense_network.py | py | 21,183 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "h5topng.common.subsample.MaskFunc",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "h5topng.common.subsample",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "h5topng.data.transforms.fft2",
"line_number": 45,
"usage_type": "call"
},
... |
37502345925 | import numpy as np
from typing import Callable, Dict, List, Optional, Tuple, Union
import fvcore.nn.weight_init as weight_init
import torch
from torch import nn
from torch.nn import functional as F
from torch.nn.init import xavier_uniform_, constant_, uniform_, normal_
from torch.cuda.amp import autocast
from detectr... | zfonemore/NewVIS | minvis/share_mask_fpn.py | share_mask_fpn.py | py | 10,597 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "detectron2.layers.ShapeSpec... |
73401806589 | from torch import nn
class Mojmyr(nn.Module):
def __init__(self, input_shape, hidden_units, output_shape):
super().__init__()
# Copy TinyVGG structure, modify it slightly for this specific case
self.conv_block_1 = nn.Sequential(
nn.Conv2d(input_shape, hidden_units, 3, 1, 1),
... | PopeCorn/myr | code/model.py | model.py | py | 1,162 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
650322467 | #! /bin/python
import os
import sys
import json
from concurrent import futures
import numpy as np
import vigra
import luigi
import z5py
import nifty
import nifty.tools as nt
import nifty.distributed as ndist
from elf.segmentation.lifted_multicut import get_lifted_multicut_solver
from elf.segmentation.multicut import ... | constantinpape/cluster_tools | cluster_tools/lifted_multicut/solve_lifted_subproblems.py | solve_lifted_subproblems.py | py | 13,622 | python | en | code | 32 | github-code | 6 | [
{
"api_name": "luigi.Task",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "luigi.Parameter",
"l... |
31153800734 | import pygame
import random
import numpy as np
class Explosion(pygame.sprite.Sprite):
def __init__(self, frames, xcoord, ycoord, scale=1.5, update_n=1):
pygame.sprite.Sprite.__init__(self) # call Sprite initializer
self.frame = 0
self.frames = frames
self.image = self.frames[self.... | Hiimbawb/Spacey | Spacey.py | Spacey.py | py | 32,449 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.sprite",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.Sprite.__init__",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pyga... |
27284711802 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import pandas_datareader as data
from sklearn.preprocessing import MinMaxScaler
# noinspection PyUnresolvedReferences
import silence_tensorflow.auto # for ignoring tensorflow info and warnings
from keras.layers import Dense, Dropout, LSTM
from ... | aashima1433/StockProject | LSTM_model.py | LSTM_model.py | py | 3,046 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.date.today",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pandas_datareader.DataReader",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas... |
811063416 | # Network Delay Time - https://leetcode.com/problems/network-delay-time/
'''There are N network nodes, labelled 1 to N.
Given times, a list of travel times as directed edges times[i] = (u, v, w), where u is the source node,
v is the target node, and w is the time it takes for a signal to travel from source to target.... | Saima-Chaity/Leetcode | Graph/networkDelayTime.py | networkDelayTime.py | py | 2,428 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "heapq.heappop",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "heapq.h... |
10356870047 | import time
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from torch.optim.lr_scheduler import ExponentialLR
import argparse
import os
# pylint: disable=E1101, W0612
"""
# GPU CLUSTER
source = '/vol/gpudata/rar2417/src/model1' #path to code location
data_path = '/vol/gpudata/rar2417/Data'... | remit0/SpeechRecognitionProject | legacy/training3.py | training3.py | py | 4,844 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "torch.set_default_tensor_t... |
44530888336 | import cv2
import numpy as np
from dlclive import DLCLive, Processor
from skimage.transform import (hough_line, hough_line_peaks)
folder = 'model/'
dlc_proc = Processor()
dlc_live = DLCLive(folder, processor=dlc_proc)
dlc_live.init_inference()
i = 0
while True:
# Load frame
i += 1
frame = cv2.imread('fra... | nghess/dlc-live-test | head-angle-vf.py | head-angle-vf.py | py | 2,324 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dlclive.Processor",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "dlclive.DLCLive",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_num... |
21480391270 | from collections import namedtuple, defaultdict
import numpy as np
import bmesh
import bpy
from ..math import get_dist_sq
from ..log import log, logd
from ..helpers import get_context, get_modifier_mask
# shape_key_apply_modifiers TODO:
# - Specialcase more merging modifiers, solidify for example
# - Trans... | greisane/gret | mesh/shape_key_apply_modifiers.py | shape_key_apply_modifiers.py | py | 15,203 | python | en | code | 298 | github-code | 6 | [
{
"api_name": "collections.namedtuple",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.single",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "bmesh.new",
... |
28969795163 | """
Artifact module.
"""
from __future__ import annotations
import typing
from typing import Self
from sdk.entities.artifact.metadata import build_metadata
from sdk.entities.artifact.spec import build_spec
from sdk.entities.base.entity import Entity
from sdk.entities.utils.utils import get_uiid
from sdk.utils.api imp... | trubbio83/core | sdk/sdk/entities/artifact/entity.py | entity.py | py | 14,056 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "sdk.entities.base.entity.Entity",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "sdk.entities.artifact.metadata.ArtifactMetadata",
"line_number": 34,
"usage_typ... |
392386374 | import numpy as np
import matplotlib
import matplotlib.pyplot as plt
# random data
A = [2,5,7,9,11,16,19,23,22,29,29,35,37,40,46]
b = [2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]
# Visualize data
plt.plot(A,b,'ro')
# array to [[ ]]
# change row vector to column vector
A = np.array([A]).T
b = np.array([b]).T
# Create ve... | suanthuy/AI_Project | Unit3.1_linear.py | Unit3.1_linear.py | py | 773 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
22779572502 | from collections import deque
vowels = deque(x for x in input().split())
consonants = [x for x in input().split()]
flowers = {
"rose": [],
"tulip": [],
"lotus": [],
"daffodil": []
}
def check_for_a_match():
for word, found in flowers.items():
if len(found) == len(word):
retur... | DanieII/SoftUni-Advanced-2023-01 | advanced/exam_practice/flower_finder.py | flower_finder.py | py | 1,076 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 3,
"usage_type": "call"
}
] |
24531644863 |
import os
import json
import random as rd
from copy import deepcopy
from matplotlib.pylab import *
import math
import torch
import torchvision.datasets as dsets
import torch.nn as nn
import torch.nn.functional as F
# import torch_xla
# import torch_xla.core.xla_model as xm
device = torch.device("cud... | DebadityaPal/RoBERTa-NL2SQL | seq2sql_model_internal_functions.py | seq2sql_model_internal_functions.py | py | 11,929 | python | en | code | 17 | github-code | 6 | [
{
"api_name": "torch.device",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.nn.utils.rnn.pack_padded_sequence",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "torch.nn.utils",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.