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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
32001834251 | from msilib.schema import Error
import pandas as pd
import numpy as np
import time
import re
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException
from bs4 import BeautifulSoup
import warn... | sohee0/final_sh | naver_map.py | naver_map.py | py | 3,472 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 34,
"usage_type": "call"
},
{
"api_name... |
74534010782 | import singer
from .base_stream import BaseStream
from tap_appfigures.context import Context
from tap_appfigures.exceptions import AppfiguresNotFoundError
from multiprocessing import Pool
LOGGER = singer.get_logger()
class CompanyStream(BaseStream):
stream_id = 'companies'
stream_name = 'companies'
key_pr... | kellymondor/tap-appfigures | tap_appfigures/streams/company_stream.py | company_stream.py | py | 3,302 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "singer.get_logger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "base_stream.BaseStream",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "tap_appfigures.context.Context.stream_objects",
"line_number": 17,
"usage_type": "attribute"
},
... |
3908706419 | from tkinter import *
from modu import top_canvas, left_semester, result_format
import sqlite3
from tkinter import messagebox
import json
class Semester:
def clear(self):
self.var_sub1.set("")
self.var_sub2.set("")
self.var_sub3.set("")
self.var_sub4.set("")
self.var_sub5.s... | bibash29/Result-Management-System | bca.py | bca.py | py | 12,859 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sqlite3.connect",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number":... |
38241622867 | import asyncio
import logging
from google.protobuf.empty_pb2 import Empty
from grpc import ServicerContext
from meteo_service import MeteoService
from proto.messages.meteo.meteo_messages_pb2 import RawMeteoData, RawPollutionData
from proto.services.meteo import meteo_service_pb2_grpc
logger = logging.getLogger(__nam... | bystepii/meteo | load_balancer/meteo_service_servicer.py | meteo_service_servicer.py | py | 1,357 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "proto.services.meteo.meteo_service_pb2_grpc.MeteoServiceServicer",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "proto.services.meteo.meteo_service_pb2_grpc",
"line_n... |
29076795558 | import cv2
import numpy as np
import matplotlib.pyplot as plt
# import sys
# sys.setrecursionlimit(100000)
def curve_search(curve_map, point):
"""
Curve Search
:param curve_map: single pixel wide line, can have some branch(will return multiple line)
:param point: curve start point(get from "find_end... | BboyHanat/CurveSearch | curve_search.py | curve_search.py | py | 5,261 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "cv2.imshow",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 97,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 1... |
38873689569 | # -*- coding: utf-8 -*-
"""
@author: Ethan
"""
from keras import regularizers
from keras.optimizers import SGD
from keras.models import Model
from keras.layers.core import Dense, Flatten
from keras.layers import Input
from keras.utils.np_utils import to_categorical
import numpy as np
import pandas as pd
f... | cWren0110/Kaggle-Competitions | Digit Recognition/Simple_NN.py | Simple_NN.py | py | 4,153 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "keras.regularizers.l2",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "keras.regularizers",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "keras.layers.Input",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.flo... |
3623657791 | #!/usr/bin/env python3
# Author: Damjan Krstajic
import argparse
import saspy
import os.path
import sys
# Usage:
# ./run_sas.py -s example_1.sas
# ./run_sas.py -s example_1.sas example_2.sas
# ./run_sas.py -s example_1.sas -l out1.log -o out1.lst
# ./run_sas.py -s example_1.sas -r TEXT
# ./run_sas.py -s example_1.sa... | sassoftware/saspy | saspy/scripts/run_sas.py | run_sas.py | py | 3,366 | python | en | code | 345 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path.path.isfile",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path.path",
... |
16397394479 | import requests
def encrypt_flag():
r = requests.get("https://aes.cryptohack.org/ecbcbcwtf/encrypt_flag/")
return r.json()["ciphertext"]
def decrypt_flag(ciphertext):
r = requests.get("https://aes.cryptohack.org/ecbcbcwtf/decrypt/" + ciphertext)
return r.json()["plaintext"]
encrypted = encr... | Tatsu-0/Cryptohack-solved | Courses/3-Symmetric Cryptography/ecbcbcwtf.py | ecbcbcwtf.py | py | 539 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
}
] |
70039133344 | import numpy as np
from scipy import integrate
from scipy import special
from random import random
import matplotlib.pyplot as plt
import plotly.plotly as py
mean = 5
sigma = 2
domain = [0, 10]
max = integrate.quad(lambda x: np.exp(-np.square((x-mean)/sigma)/2)/np.sqrt(2*sigma*np.pi), -np.inf, 10)[0]
min ... | balbok0/MC-and-Jet-Tutorial | Monte Carlos/invTransformGaussian.py | invTransformGaussian.py | py | 769 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "scipy.integrate.quad",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "scipy.integrate",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "numpy.exp",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.square",
"li... |
37883704912 | import unittest
from selenium import webdriver
from TestData.login_data import *
from TestData.common_data import *
from PageObjects.login_page import LoginPage
from PageObjects.bid_page import BidPage
from PageObjects.index_page import IndexPage
from TestData.bit_data import *
from ddt import ddt, data
@ddt
class Te... | littlecutecat/vaga | TestCase/test_bid.py | test_bid.py | py | 1,637 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "unittest.TestCase",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "P... |
20571039708 | import decimal
import opencryptobot.emoji as emo
import opencryptobot.utils as utl
from telegram import ParseMode
from opencryptobot.ratelimit import RateLimit
from opencryptobot.api.apicache import APICache
from opencryptobot.api.coingecko import CoinGecko
from opencryptobot.plugin import OpenCryptoPlugin, Category, ... | Endogen/OpenCryptoBot | opencryptobot/plugins/price.py | price.py | py | 5,597 | python | en | code | 89 | github-code | 7 | [
{
"api_name": "opencryptobot.plugin.OpenCryptoPlugin",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "opencryptobot.utils.get_kw",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "opencryptobot.utils",
"line_number": 23,
"usage_type": "name"
},
{
... |
3099002965 | from flask import Flask, render_template, request
from flask_cors import CORS, cross_origin
from urllib.request import urlopen as uReq
from bs4 import BeautifulSoup as soup
import os
import json
app = Flask(__name__)
cors = CORS(app)
app.config["CORS_HEADERS"] = "Content-Type"
player = "James Harden"
year = "2021"
st... | arnav404/dd-api | app.py | app.py | py | 4,036 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "flask_cors.cross_origin",
"l... |
72873045663 | # -*- coding: utf-8 -*-
from b3j0f.utils.ut import UTCase
from unittest import main
from b3j0f.conf import Configurable, category, Parameter
from link.utils.log import logrecord_to_dict
import logging
class TestConfigurableLogger(UTCase):
def setUp(self):
self.logger = logging.getLogger('link.utils.test... | linkdd/link.utils | link/utils/test/log.py | log.py | py | 2,048 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "b3j0f.utils.ut.UTCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "b3j0f.conf.Configurable.get_annotations",
"line_number": 19,
"usage_type": "call"
},
{
"a... |
44736697900 | # -----------------------------------------------------------
# plot distributions about data
#
# created by Jeanquartier 2020
# Released under GNU Public License (GPL)
# -----------------------------------------------------------
import pandas as pd
import os
import matplotlib.pyplot as plt
import numpy as ... | radiance/glioma-mutations-xai | scripts/Distributionplot/main.py | main.py | py | 3,090 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.show",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.tight_layout",
"line_number": 28,
"usage_type": "call"
},
{
"api_name"... |
74063313184 | from logging import error, exception
from flask import Flask, render_template, request, redirect, send_file
from so import get_so_jobs
from exporter import save_to_file
app = Flask("SuperScrapper")
db = {}
@app.route("/")
def home():
return render_template("index.html")
@app.route("/report")
def report():
word =... | moaoh/nomad | python-for-beginners/Courses/page_srcs/main.py | main.py | py | 959 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.request... |
19250451462 | import matplotlib
from annotations import annotate, annotateEndLockdown2
from colors import getColorByIndex
from dataHandling.mohData import MetricToPlot, MetricToChooseTowns, datagov_source_text, useTestsDataInsteadOfTested, \
getMohDf, getCompleteTownList, getPopulationByCityCode, populationData, getTownsBy, gro... | DeDuckProject/covid19-google-mobility-israel | plotting/mohMetricsPlot.py | mohMetricsPlot.py | py | 6,054 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.use",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.dates.MonthLocator",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.dates",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "matplotl... |
22189666565 | import numpy as np
import numexpr as ne
class UGyr:
def __init__(self, incompressible=False):
self.name = 'I' * incompressible + 'ugyr'
self.incompressible = incompressible
def create_datasets(self, file, dic_quant, dic_param):
if self.incompressible:
raise NotImplementedE... | jeandet/Exact_laws | exact_laws/preprocessing/quantities/ugyr.py | ugyr.py | py | 688 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numexpr.evaluate",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.float64",
"line_number": 19,
"usage_type": "attribute"
}
] |
21718561483 | from bs4 import BeautifulSoup
import datetime
import pickle
import requests
import os
import numpy as np
import wx_config
web_link = 'https://mesonet.agron.iastate.edu/mos/table.phtml?'
station = wx_config.get_station_id_4code()
start_dt = datetime.datetime.combine(datetime.date.today(), datetime.datetime.min.time())
... | linjonathan/wx_climatology | scrape_mos.py | scrape_mos.py | py | 2,804 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "wx_config.get_station_id_4code",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.combine",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "attribute"
},
{
"a... |
72920792543 | import argparse
import os
import sys
import shutil
import tensorflow as tf
import tensorflow_hub as hub
import datetime
import hashlib
import layer
import data_processor
import evaluator
import numpy as np
from featurizer import BertFeaturizer
from tensorflow.keras import optimizers
from tensorflow.keras import backend... | aerinkim/Zeal | main.py | main.py | py | 8,806 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath"... |
22848350672 | # Lint as: python3
# pylint: enable=line-too-long
"""Hugging Face Competitions
"""
from setuptools import find_packages, setup
with open("README.md") as f:
long_description = f.read()
QUALITY_REQUIRE = [
"black~=22.0",
"isort==5.8.0",
"flake8==3.9.2",
"mypy==0.901",
]
TEST_REQUIRE = ["pytest", "... | abhishekkrthakur/diffuzers | setup.py | setup.py | py | 1,694 | python | en | code | 535 | github-code | 7 | [
{
"api_name": "setuptools.setup",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 43,
"usage_type": "call"
}
] |
42692128276 | from pyspark import SparkContext
from pyspark.sql import SparkSession
from pyspark.sql import SQLContext
from set_config import config
#
# from sellgoods.sql import sales_quantity
# spark_context = config.shellgoods_params['spark_context']
db_context = config.db_context
# db_context = config.db_context
class SparkDb:
... | LRJliurj/GoodsServer | sellgoods/salesquantity/utils/sparkdb.py | sparkdb.py | py | 1,686 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "set_config.config.db_context",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "set_config.config",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "pyspark.SparkContext",
"line_number": 15,
"usage_type": "call"
},
{
"api_name":... |
316913507 | from flask import request
from bija.app import app
from bija.db import BijaDB
from bija.helpers import is_hex_key, is_bech32_key, is_nip05, bech32_to_hex64, request_nip05
DB = BijaDB(app.session)
class Search:
def __init__(self):
self.term = None
self.message = None
self.results = None
... | renesugar/bija | bija/search.py | search.py | py | 1,976 | python | en | code | null | github-code | 7 | [
{
"api_name": "bija.db.BijaDB",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bija.app.app.session",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "bija.app.app",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "flask.request.args... |
43245044389 | import requests
import json
def get_prometheus_metrics(url):
# Tworzenie zapytania do Prometheus API
response = requests.get(url)
data = response.json()
# Przetwarzanie danych odpowiedzi
metrics = []
for result in data['data']['result']:
metric = result['metric']
value = result... | adrianryt/SUU_AGH | resources/scripts/prometheus-metrics.py | prometheus-metrics.py | py | 1,003 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 24,
"usage_type": "call"
}
] |
14298823346 | from django.contrib import admin
# Register your models here.
from .models import Pitch, Vote, Room, Slot, Schedule, Flag
def collapse_pitches(model_admin, request, pitch_set):
base_pitch = pitch_set[0]
for pitch in pitch_set[1:]:
base_pitch.merge(pitch)
collapse_pitches.short_description = 'Collapse... | kyoung/unconf | server/pitches/admin.py | admin.py | py | 1,041 | python | en | code | 12 | github-code | 7 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 30,
"usage_type": "attribute"
... |
23442977914 | # collections.OrderedDict - ещё один похожий на словарь объект, но он помнит порядок, в котором ему были даны ключи.
import collections
d = {'banana': 3, 'apple': 4, 'pear': 1, 'orange': 2}
o_dict = collections.OrderedDict(sorted(d.items(), key=lambda t: t[0]))
print(o_dict) # OrderedDict([('apple', 4), ('banana', 3)... | boo-learn/SpecialistPython2_v2 | Module9/examples/03_collections_OrderedDict.py | 03_collections_OrderedDict.py | py | 865 | python | ru | code | 6 | github-code | 7 | [
{
"api_name": "collections.OrderedDict",
"line_number": 5,
"usage_type": "call"
}
] |
30588868854 | # SPDX-License-Identifier: GPL-2.0-or-later
from PyQt5.QtWidgets import QApplication
from PyQt5.QtGui import QPalette, QColor
themes = [
("Light", {
QPalette.Window: "#ffefebe7",
QPalette.WindowText: "#ff000000",
QPalette.Base: "#ffffffff",
QPalette.AlternateBase: "#fff7f5f3",
... | vial-kb/vial-gui | src/main/python/themes.py | themes.py | py | 6,689 | python | en | code | 733 | github-code | 7 | [
{
"api_name": "PyQt5.QtGui.QPalette.Window",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtGui.QPalette",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtGui.QPalette.WindowText",
"line_number": 9,
"usage_type": "attribute"
},
... |
6995588870 |
import datetime
import collections
import threading
import queue
from fast_trader.dtp_quote import settings
from fast_trader.serializer import serializer
def get_client():
import pyssdb
host = settings['quote_feed_store']['ssdb_host']
port = settings['quote_feed_store']['ssdb_port']
client = pyssdb... | kmmao/fast-trader | fast_trader/ssdb.py | ssdb.py | py | 3,633 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "fast_trader.dtp_quote.settings",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "fast_trader.dtp_quote.settings",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "pyssdb.Client",
"line_number": 16,
"usage_type": "call"
},
{
"api_n... |
21467162251 | """Merge & compress dataframe.
"""
import numpy as np
import pandas as pd
import sys
sys.path.append(".")
from scripts.util import timer, reduce_mem_usage
with timer("reading feather data"):
DATA_FEATHER = "data/processed/"
train = pd.read_feather(DATA_FEATHER + "train.feather")
test = pd.read_feather(DATA... | statefb/ashrae-energy-prediction | scripts/data/preprocess/191031_merge_compress.py | 191031_merge_compress.py | py | 2,223 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "scripts.util.timer",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_feather",
... |
31477889643 | # -*- coding: utf-8 -*-
"""
Created on Th December 1 2022
@author: davidsantiagoquevedo
@author: ntorresd
"""
import warnings
warnings.filterwarnings('ignore')
import sys
import yaml
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
config = yaml.load(open("config.yml", "r"))["default"]
SCR... | davidsantiagoquevedo/covid19-waves-bogota | plots/figure_3.py | figure_3.py | py | 1,854 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line... |
9719894498 | import pytest
from os2mint_omada.omada.models import OmadaUser
@pytest.fixture
def omada_user() -> dict:
"""Base Omada user, as returned by the API."""
return {
"Id": 12345678,
"UId": "5fe3ef67-c6e5-4d09-bdee-80b9bf40544d",
"VALIDFROM": "2016-06-15T00:00:00+02:00",
"VALIDTO": ... | magenta-aps/os2mint-omada | tests/test_omada_models.py | test_omada_models.py | py | 1,183 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pytest.fixture",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os2mint_omada.omada.models.OmadaUser.parse_obj",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os2mint_omada.omada.models.OmadaUser",
"line_number": 23,
"usage_type":... |
23070009413 | import os
from googletrans import Translator
ROOT_DIR = os.path.join(os.path.join(os.environ['USERPROFILE']), 'Desktop/Pearlcat/text/text_eng')
OUTPUT_DIR = os.path.join(os.path.join(os.environ['USERPROFILE']), 'Desktop/Pearlcat/text')
translator = Translator()
SRC = "en"
DEST = "es"
langMap = {
"fr": "fre",... | forthbridge/pearlcat | translatetext.py | translatetext.py | py | 1,668 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "os.path.join",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_numbe... |
42684730779 | import pytest
from pprint import pprint as pp
from scout.parse.case import (parse_case, parse_ped, parse_individuals,
parse_individual, parse_case_data,
removeNoneValues)
from scout.exceptions import PedigreeError
from scout.constants import REV_SEX_MAP
def ... | Clinical-Genomics-Lund/scout | tests/parse/test_parse_case.py | test_parse_case.py | py | 9,191 | python | en | code | null | github-code | 7 | [
{
"api_name": "scout.parse.case.parse_case",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "scout.parse.case.parse_case",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "scout.parse.case.parse_case",
"line_number": 29,
"usage_type": "call"
},
{
... |
17573258123 | import csv
import json
import os
import pandas
import pydantic_core
import torch
from py_config import read_app_config, model_dir, print_3pc_banner, data_dir
from tqdm import tqdm
from pathlib import Path
from color.extractor import ColorExtractor
from color.hsv_repository import HSVRepository
from image_handler impo... | Badisches-Landesmuseum/xcurator | data-enrichment/1-artefact-object-color/src/enrichment-script.py | enrichment-script.py | py | 3,559 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "torch.cuda.empty_cache",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "py_config.print_3pc_banner",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.... |
72870465502 | from commondescentvector.common_descent_vector import CommonDescentVector
import logging
import time
class MultiObjectiveCDV(CommonDescentVector):
""" MultiObjectiveCDV class. Inherits from the CommonDescentVector
class.
MultiObjectiveCDV is used to return the common descent vector for
a single objec... | Ascend/ModelZoo-PyTorch | PyTorch/dev/others/Multi-Gradient_Descent_ID0349_for_PyTorch/commondescentvector/multi_objective_cdv.py | multi_objective_cdv.py | py | 5,800 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "commondescentvector.common_descent_vector.CommonDescentVector",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "logging.debug",
"line_number": 133,
"usage_type": "call"
},
{
"api_name": "time.process_time",
"line_number": 134,
"usage_type": "call"
... |
40261409368 | from django.urls import path
from .views import CauseCreateView, CauseDeleteView, CauseListView, CauseUpdateView
urlpatterns = [
path('', CauseListView.as_view(), name='causes'),
path('cause/new/', CauseCreateView.as_view(), name='cause_new'),
path('cause/<int:pk>/edit/', CauseUpdateView.as_view(), name='cause_edit'),... | aha99an/clinic | cause/urls.py | urls.py | py | 404 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "views.CauseListView.as_view",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "views.CauseListView",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.... |
73377381022 | from time import time
import six
import json
from chameleon import PageTemplate
import numpy as np
import argparse
from time_limit import set_time_limit
parser = argparse.ArgumentParser()
parser.add_argument('-num_of_rows', type=int, default=400)
parser.add_argument('-num_of_cols', type=int, default=400)
args = parse... | DeliverNASA/Function_bench | aws/cpu-memory/chameleon/lambda_function.py | lambda_function.py | py | 1,632 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "six.text_type",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "chameleon.PageTe... |
1713254701 | from snovault import (
AfterModified,
BeforeModified,
CONNECTION,
calculated_property,
collection,
load_schema,
)
from snovault.schema_utils import schema_validator
from .base import (
Item,
paths_filtered_by_status,
)
from pyramid.httpexceptions import (
HTTPForbidden,
HTTPTempo... | T2DREAM/t2dream-portal | src/encoded/types/file.py | file.py | py | 19,041 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "boto.connect_sts",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "snovault.CONNECTION",
"line_number": 71,
"usage_type": "name"
},
{
"api_name": "base.Item",
"line... |
74904032222 | """CRUD Operations"""
from model import (db, Book, Author, Genre, Language, User, Current_Read,
Bookshelf, Review, Author_book_map, Genre_book_map, Language_book_map,
Shelf_book_map, Faved_Book, connect_to_db)
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.orm import joinedload
import ... | LadkinsM/mylibrary | static/python/crud.py | crud.py | py | 18,130 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "model.Book.query.filter",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "model.Book.query",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "model.Book",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "model.Book.g... |
7651381429 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 18 09:40:14 2021
@author: tina
"""
import sys
import threading
import atexit
from s3_io.event_consumer import __main__ as Consume
from s3_io.s3io_api import __main__ as Api
from s3_io.s3io_tasks import app
from viaa.observability import logging
fro... | viaacode/s3-io | s3_io/s3io_input.py | s3io_input.py | py | 3,331 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "viaa.configuration.ConfigParser",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "viaa.observability.logging.get_logger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "viaa.observability.logging",
"line_number": 21,
"usage_type": "name... |
72863986782 | import torch
import torchvision
from models import basicblock as B
def show_kv(net):
for k, v in net.items():
print(k)
# should run train debug mode first to get an initial model
#crt_net = torch.load('../../experiments/debug_SRResNet_bicx4_in3nf64nb16/models/8_G.pth')
#
#for k, v in crt_net.items():
# ... | Ascend/ModelZoo-PyTorch | PyTorch/contrib/cv/others/SwinIR/utils/utils_params.py | utils_params.py | py | 4,039 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "torchvision.models.vgg19",
"line_number": 90,
"usage_type": "call"
},
{
"api_name": "torchvision.models",
"line_number": 90,
"usage_type": "attribute"
},
{
"api_name": "models.basicblock.conv",
"line_number": 104,
"usage_type": "call"
},
{
"api_name... |
15737217458 | import pytorch_lightning as pl
import torch
from torch import nn
from torchmetrics import Accuracy
import torch.nn.functional as F
###############################
# Multilayer Perceptron #
###############################
IMAGE_SIZE = 28
class ResNet(pl.LightningModule):
"""
Convolutional Neural Networ... | Cyber-Tracer/FedStellar-topo-manipulation | fedstellar/learning/pytorch/femnist/models/resnet.py | resnet.py | py | 5,410 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pytorch_lightning.LightningModule",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torchmetrics.Accuracy",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.manual_seed",
"line_number": 28,
"usage_type": "call"
},
{
"ap... |
35303007629 | from typing import Optional, List
from fastapi import FastAPI
import uvicorn
from pydantic import BaseModel, Field
from typing import Optional
app = FastAPI()
class ShopInfo(BaseModel):
name: str
location: str
class Item(BaseModel):
name: str = Field(min_length=4, max_length=12)
description: Optional[... | arizka85/FastApi-Japan | Section4/main.py | main.py | py | 1,154 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "pydantic.Field",... |
27000906361 | # -*- coding: utf-8 -*-
"""
@author: Wangyun Luo
email: samlwy@bu.edu
"""
import datetime as dt
import matplotlib.pyplot as plt
from matplotlib import style
import pandas as pd
import pandas_datareader.data as web
from datetime import timedelta
from datetime import date
# ---------------------------------------------... | WangyunLuo/etfs_analysis | analysis.py | analysis.py | py | 1,444 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.timedelta",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.date.today",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "datetime.date.to... |
24028120105 | import json
import re
class GameSummary:
number_of_players = 0
def __init__(self, file_name, map_name, map_size, duration, timestamp, diplomacy_type, members):
self.game_name = re.search("@.*[0-9] ", file_name).group(0)
self.game_version = re.search("v([^\s]+)", file_name).group(0)
se... | dogukanduman/AOE2RecordParser | tests/GameSummary.py | GameSummary.py | py | 668 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "re.search",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 20,
"usage_type": "call"
}
] |
73960493023 | import SimulationUtils
import simulate
import numpy
import logging
import csv
import time
import os
import Queue
import threading
import multiprocessing
import subprocess
import sys
import traceback
logger = logging.getLogger('Simulation')
# Set the log levels
logger.setLevel(logging.INFO)
queue = Queue.Queue()
def... | pobrienjhu/cens | Exploration.vs.Exploitation - Structural Design/src/SimulationMultiThreaded.py | SimulationMultiThreaded.py | py | 4,100 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "Queue.Queue",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.exc_info",
"l... |
42716529418 | import jax.numpy as jnp
import jax
from admm_iLQR import admm
from jax.config import config
import matplotlib.pyplot as plt
from utils import discretize_dynamics
# Enable 64 bit floating point precision
config.update("jax_enable_x64", True)
# We use the CPU instead of GPU und mute all warnings if no GPU/TPU is found.... | casiacob/admm_ilqr_constraints | bicycle_mpc.py | bicycle_mpc.py | py | 5,750 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "jax.config.config.update",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "jax.config.config",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "jax.config.config.update",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "jax... |
37236899885 | import tkinter as tk
import locale
from datetime import datetime
from datetime import timedelta
import csv
import gettext
from collections import defaultdict
def select_shoes():
# refresh variables
my_language = language.get()
my_choice = choice.get()
# set the locale
locale_functions[my_langu... | nicklambson/shoe-shop | shop.py | shop.py | py | 6,165 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "locale.setlocale",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "locale.LC_ALL",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "locale.currency",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "locale.currency",... |
36573836260 | import factory
from faker import Faker
faker = Faker()
from accounting.models import User
class UserFactory(factory.Factory):
"""
User factory
"""
class Meta:
model = User
username = factory.Sequence(lambda n: 'user{0}'.format(n))
current_sign_in_ip = factory.LazyAttribute(lambda o: ... | raebeb/bastet-accounting-django | accounting/tests/factories/models/user_factory.py | user_factory.py | py | 947 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "faker.Faker",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "factory.Factory",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "accounting.models.User",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "factory.Sequenc... |
22432436322 | #!/usr/bin/env python
# coding: utf-8
# # Example: comparing temperature in three regions
# In[1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy import stats
import statsmodels.formula.api as smf
import pingouin as pg
import PyCO2SYS as pyco2
# Load the data. Note: you may ne... | tompc35/data_marine_science | _build/jupyter_execute/week07e-example-comparing-wcoa-temperature.py | week07e-example-comparing-wcoa-temperature.py | py | 2,991 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "PyCO2SYS.sys",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 91,
"usage_type": "call"
},
{
"api_name": "matplotlib.pypl... |
9041586881 | import cv2
import mediapipe as mp
class HandDetector():
def __init__(self, mode=False, max_hands=2, detection_conf=.5, track_conf=.5):
self.mode = mode
self.max_hands = max_hands
self.detection_conf = detection_conf
self.track_conf = track_conf
self.mp_hands = mp.solutions... | rohit-krish/Hand_Volume_Controller | detector.py | detector.py | py | 1,729 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "mediapipe.solutions",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "cv2.cvtColor",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "cv2.CO... |
25154041125 | import argparse
from itertools import chain
from pathlib import Path
from typing import Dict, List, Optional, Union
import torch.fx as fx
import torch.nn as nn
from netspresso_trainer.models import build_model
from netspresso_trainer.utils.fx import convert_graphmodule
from omegaconf import OmegaConf
TEMP_NUM_CLASSES... | Nota-NetsPresso/netspresso-trainer | tools/fx_convert.py | fx_convert.py | py | 1,839 | python | en | code | 10 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "itertools.chain",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "typing.List",
... |
18225502332 | from flask import Flask,render_template,request, session
from datetime import datetime,timedelta
from sqlalchemy.sql.operators import exists
from werkzeug.utils import redirect
from flask_sqlalchemy import SQLAlchemy
import uuid
import random
import razorpay
import os
from werkzeug.wrappers import response
im... | manojkumaar-gowda/ecopark | app.py | app.py | py | 47,004 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numbe... |
22134083039 | import numpy
import torch
import torch.nn.functional as F
import json
from mendeleev.fetch import fetch_table
from sklearn.preprocessing import scale
from chemparse import parse_formula
atom_nums = {
'H': 1, 'He': 2, 'Li': 3, 'Be': 4, 'B': 5, 'C': 6, 'N': 7, 'O': 8, 'F': 9, 'Ne': 10,
'Na': 11, 'Mg'... | Namkyeong/PolySRL_AI4Science | util/chem.py | chem.py | py | 4,948 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "numpy.nan_to_num",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "mendeleev.fetch.fetch_table",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.array"... |
534832946 | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
# importing library
import matplotlib.pyplot as plt
import numpy as np
import math
# Matrix to plot ladder
matrix = np.matrix([[1,1,3,3,1,3,1,3,1,3,1,3,1,3,1,3],
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
... | bipulsimkhada/Prospective-Transformation | transformation.py | transformation.py | py | 3,451 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.matrix",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"li... |
5787956558 | # coding=utf-8
import itertools as it
import multiprocessing
import cv2
import numpy as np
from scipy import signal, misc
SRC_VIDEO = 'inputs/videos/fg_av_ger_seg{}.mkv'
DST = 'outputs/mean-luminance/run-{}.png'
RUNS = 1, 2, 3, 4, 5, 6, 7, 8
MAX_FRAME = np.inf
DOWNSAMPLE = 8
N_PROCESSES = 4
def process_video(run, ... | smathot/studyforrest-prf | code/create-average-luminance.py | create-average-luminance.py | py | 1,085 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.inf",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FRAME_COUNT",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "numpy.e... |
14196576445 | # from pudb import set_trace; set_trace()
from typing import List
from bisect import bisect_right
class Solution:
def atMostNGivenDigitSet(self, digits: List[str], n: int) -> int:
"""LeetCode 902
We have done this before, and it seems like it was not too big a
challenge back then. The ins... | FanchenBao/leetcode | 2021_12_challenge/12_18_2021.py | 12_18_2021.py | py | 2,466 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "bisect.bisect_right",
"line_number": 40,
"usage_type": "call"
}
] |
2696347630 | from functools import reduce
numbers = []
for i in range(1, 101):
numbers.append(i)
# 1到100累加求和
total = reduce(lambda x, y: x + y, numbers)
print(total)
# 复杂点的:对numbers中的大于等于60的数字求平均值
# 第一次:x是None,y是第一个数,最后一次:x是最后一个数,y是None
def up(x, y):
if not x:
if y >= 60:
return y
elif not y:
... | ccpwcn/PythonLesson | 008 进阶之路/009 reduce函数.py | 009 reduce函数.py | py | 644 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "functools.reduce",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 22,
"usage_type": "call"
}
] |
5453285440 | import torch
import torch.nn as nn
def mse_loss(x_, x, reduction='sum'):
mse = nn.MSELoss(reduction=reduction)(x_, x)
return mse
def nll_loss(x_, x, reduction='none', loss_type='mse'):
if loss_type == 'mse':
return nn.MSELoss(reduction=reduction)(x_, x)
elif loss_type == 'bce':
x = t... | john-x-jiang/meta_ssm | EP_model/model/loss.py | loss.py | py | 3,144 | python | en | code | 18 | github-code | 7 | [
{
"api_name": "torch.nn.MSELoss",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.MSELoss",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number"... |
4168186416 | """
homeassistant.components.sensor.vera
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for Vera sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.vera/
"""
import logging
from requests.exceptions import RequestException
import homeassistant.u... | hcchu/home-assistant-clone | homeassistant/components/sensor/vera.py | vera.py | py | 5,027 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pyvera.VeraController",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "requests.exceptions.RequestException",
"line_number": 45,
"usage_type": "name"
},
{
"api_... |
12985272141 | #!/usr/bin/env python3
import os
import re
import sys
from datetime import datetime
from optparse import OptionParser
# This block need for check uncatchable error from installed library. Don't touch it
try:
from N2G import yed_diagram
import openpyxl
except ModuleNotFoundError:
print(
"[!] Output... | isaev4lex/topology_drawer | main.py | main.py | py | 4,211 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.exit",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "optparse.OptionParser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_nu... |
28176484840 | from cycler import cycler
import sys
sys.path.append('..')
from lib import *
import palettable
plt.style.use('../custom.mplstyle')
datadir = 'data/'
fig, ax = plt.subplots(figsize=(3.0, 2.4))
def plot(files, colors=None, **kwargs):
lines = []
for i, f in enumerate(files):
print(f)
data = n... | andim/paper-tcellimprint | code/csd_mf_saturation/plot.py | plot.py | py | 1,419 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "palettable.colorbrewer",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "palettable.co... |
71614200222 | from utils import load_input, get_numbers, memoize
from collections import defaultdict
import z3
# Part 1
def compute_intersections(delay):
layers = defaultdict(int)
layer_state = {}
layer_down = {}
for line in load_input('puzzle_inputs/Day13.txt'):
depth, length = get_numbers(line)
... | dcchut/aoc2017 | Day13.py | Day13.py | py | 2,549 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.defaultdict",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "utils.load_input",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "utils.get_numbers",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "utils.load_... |
27856606177 | # utils.py -- meta stuff that gets used often
from flask import jsonify
import re
# The 'good' and 'bad' functions are just simple wrappers around
# 'jsonify' to return a fixed response. The 'bad' function's 'msg'
# parameter is mandatory. Can't have it just return 'status: error'.
# That would suck.
def good(msg=No... | MLH-Fellowship/CovidAid | backend/backend/utils.py | utils.py | py | 957 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "flask.jsonify",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_numb... |
14531061806 | import tkinter as tk
import sqlite3,os
import sys
def send():
new_tags = myEntryBox.get().split(";")
file_dir=" ".join(sys.argv[1:])
root.destroy()
cxn = sqlite3.connect('C:\\Python32\\PyQt_test\\tags.db')
cur = cxn.cursor()
for new_tag in new_tags:
cur.execute('INSERT INTO filetags VALUES("'+file_dir+'","'+n... | jeffhou/PyQt_test | tag_file_dialog.pyw | tag_file_dialog.pyw | pyw | 768 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.connect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tkinter.Tk",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tkinter.Entry",
"line_numb... |
15453992733 | # importing libraries
import tensorflow as tf
from tensorflow import keras
import cv2
import numpy as np
# load the saved model
model = keras.models.load_model('insert the path to the saved model')
# load and preprocess the image
image_path = 'insert a path to an image to test model'
image = cv2.imread(image_path)
im... | tanveerSadat/SmartBin | model/test.py | test.py | py | 881 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tensorflow.keras.models.load_model",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.models",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras",
"line_number": 8,
"usage_type": "name"
},
{
"api... |
14895502912 | from itertools import combinations
import sys
N, M = map(int, input().split())
# 전체 맵 입력 받기
city = [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
chicken, home = [], []
ans = []
for i in range(N):
for j in range(N):
# 치킨가게 좌표 저장
if city[i][j] == 2:
chicken.append((i, ... | JiyuChoi/Algorithm-Study | BOJ/[BT] 치킨 배달.py | [BT] 치킨 배달.py | py | 1,885 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.stdin.readline",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "itertools.combinations",
"line_number": 20,
"usage_type": "call"
}
] |
71486950624 | """
A script to select tb samples to use from Farhat et al 2019,
https://www.nature.com/articles/s41467-019-10110-6#Tab1
"""
import logging
import shutil
import urllib.request as request
from os import path
from contextlib import closing
from typing import List, Union
import numpy as np
import pandas as pd
logging.b... | bjeffrey92/unitig_AMR_prediction | scripts/filter_tb_metadata.py | filter_tb_metadata.py | py | 3,557 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "logging.basicConfig",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.root.setLevel",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "logging.root",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "logging.I... |
33589001648 | import concurrent.futures
import datetime
from typing import Dict, List
from concurrent.futures import Future, wait
import ydb
from ydb import TopicWriterMessage
def connect():
db = ydb.Driver(
connection_string="grpc://localhost:2135?database=/local",
credentials=ydb.credentials.AnonymousCredent... | ydb-platform/ydb-python-sdk | examples/topic/writer_example.py | writer_example.py | py | 3,729 | python | en | code | 68 | github-code | 7 | [
{
"api_name": "ydb.Driver",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "ydb.credentials.AnonymousCredentials",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "ydb.credentials",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "... |
35009429249 | '''Example of VAE on MNIST dataset using MLP
The VAE has a modular design. The encoder, decoder and VAE
are 3 models that share weights. After training the VAE model,
the encoder can be used to generate latent vectors.
The decoder can be used to generate MNIST digits by sampling the
latent vector from a Gaussian distr... | crvogt/functions_test | keras/autoencoder/pt1/auto_test_5.py | auto_test_5.py | py | 5,268 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "keras.backend.shape",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "keras.backend.int_shape",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "keras.backe... |
17424339640 | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 18 19:53:55 2019
@author: Mark
"""
import pandas as pd
import json
#from ast import literal_eval # uncomment if need to read column data as
# native python types
in_file = 'flexicon.csv'
with open('CharConversions.json', encoding='utf8') as f:
char_conversions = js... | markjosims/FLExEntry | AddIPAFlex.py | AddIPAFlex.py | py | 5,973 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
}
] |
34753486359 | from sklearn import svm
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, confusion_matrix
from imblearn.over_sampling import SMOTE
from sklearn.preprocessing import MinMaxScaler
import warnings
from collections import Counter
warning... | ashishmenkudale/django_poc | DjangoAPI/neural_net/dev.py | dev.py | py | 3,313 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.ge... |
72943772062 | # STAT 391 HW2
# Chongyi Xu, 1531273
# This file is the Python script for hw3 Problem 3
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(0,3,0.01)
# fx= np.zeros([len(x), 1])
# fy= np.zeros([len(x), 1])
# for xx in x:
# if xx >= 0.75 and xx <= 1.5:
# fy[x==xx] = 1/(1.5-0.75)
# if xx >=... | johnnyxcy/SchoolWorks | 2018Spring/STAT391/HW3/hw3p3.py | hw3p3.py | py | 1,306 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "numpy.arange",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number":... |
38680552857 | import math
import torch.optim as optim
import torch.nn as nn
from torch.nn.utils import clip_grad_norm
class Optim(object):
def set_parameters(self, params):
self.params = list(params) # careful: params may be a generator
if self.method == 'sgd':
self.optimizer = optim.SGD(self.param... | salesforce/cove | OpenNMT-py/onmt/Optim.py | Optim.py | py | 1,779 | python | en | code | 468 | github-code | 7 | [
{
"api_name": "torch.optim.SGD",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.optim",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.optim.Adagrad",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.optim",
"li... |
25829422119 | import xlrd
from pymongo import MongoClient
client = MongoClient(host='localhost', port=27017, connect=False)
# 去重
collection_md5 = client['new']['url_md5']
collection = client['new']['8590']
while True:
try:
excel = input('查找的excel文件名:\n')
# data = xlrd.open_workbook(excel)
data = xlrd... | zbuhui/anjuke | findqq_re/setting.py | setting.py | py | 613 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "xlrd.open_workbook",
"line_number": 16,
"usage_type": "call"
}
] |
28485415289 | import pymorphy2
def _is_functional_part_of_speech(part_of_speech):
if part_of_speech == 'PREP' or part_of_speech == 'CONJ' or part_of_speech == 'PRCL' or part_of_speech == 'INTJ':
return True
def stem_text(request_text):
"""
Стемироание - приведение слова к его изначальной форме. Например, слов... | Wenfort/concurent_site_release | main/tools/stemmer.py | stemmer.py | py | 1,203 | python | ru | code | 1 | github-code | 7 | [
{
"api_name": "pymorphy2.MorphAnalyzer",
"line_number": 15,
"usage_type": "call"
}
] |
12228545454 | import asyncio
import logging
import aioredis
import config
logger = logging.getLogger(__name__)
loop = asyncio.get_event_loop()
async def consume_output(stream_name: str, latest_id: str = '$'):
subscriber = await aioredis.create_redis(
f'redis://{config.REDIS_HOST}:{config.REDIS_PORT}/{config.REDIS_... | joseanpz/streameval | tasks/consumers.py | consumers.py | py | 953 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "asyncio.get_event_loop",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "aioredis.create_redis",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "config.... |
36818201297 | import torch
class Buffer:
def __init__(self):
# Stores one entry per time step
self.tstep = []
self.obs = []
self.act = []
self.logp = []
self.val = []
self.rew = []
self.entropy = []
self.disc_rtg_rews = []
# One entry per episode
... | kennethmitra/Reinforcement_Learning_Algorithms | A2C/Buffer.py | Buffer.py | py | 1,909 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.tensor",
"line_number": 30,
"usage_type": "call"
}
] |
10040555946 | import paho.mqtt.client as mqtt
from influxdb import InfluxDBClient
# MQTT settings
mqtt_broker = "test.mosquitto.org"
mqtt_topic = "SensorPolytech"
# InfluxDB settings
influxdb_host = "localhost"
influxdb_port = 8086
influxdb_database = "mydatabase"
# Create an InfluxDB client
influxdb_client = InfluxDBClient('loca... | Switcherag/Sensor-Monitoring | main.py | main.py | py | 1,260 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "influxdb.InfluxDBClient",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "paho.mqtt.client.Client",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "paho.mqtt.client",
"line_number": 41,
"usage_type": "name"
}
] |
32047389397 | import base64
import os
import string
from datetime import datetime
import numpy as np
import cv2
from PIL import Image
from flask import Flask, send_file, request, jsonify
from flask_restful import Resource, Api, reqparse
from werkzeug.datastructures import FileStorage
from SRSI import SRSI, DEFAULT_STATUS_FILEPATH,... | lnekhv/ImageResizer | SRSI_server/Web_service/Web-service.py | Web-service.py | py | 4,427 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask_restful.reqparse.RequestParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "fl... |
8973201694 | from element import Element
from graphics.space.SwartAxis import SwartAxis
from interpreter.viedgets.service.element_array_based.element_array_based_viedget import ElementArrayBasedViedget
class RowViedget(ElementArrayBasedViedget):
keyword = "row"
swift_boilerplate = """HStack({swift_alignment}) ~{content}
... | DEMIDOB/Swart | interpreter/viedgets/layout/row_viedget.py | row_viedget.py | py | 564 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "interpreter.viedgets.service.element_array_based.element_array_based_viedget.ElementArrayBasedViedget",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "element.Element",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "graphics.space.SwartAxis.Swa... |
13805528369 | from django.test import TestCase, Client
from bs4 import BeautifulSoup
from .models import Post, Category, Tag
from django.contrib.auth.models import User
# Create your tests here.
class TestView(TestCase):
def setUp(self):
self.client = Client()
self.user_jieun = User.objects.create_user(username... | JieunKim4578/django_project | blog/tests.py | tests.py | py | 11,391 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.test.TestCase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.test.Client",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects.create_user",
"line_number": 11,
"usage_type": "call"
},... |
71570601823 | """
Revision ID: 0185
Revises: 0184_alter_primary_key_1
Create Date: 2018-05-14 12:27:41.127488
"""
from alembic import op
import sqlalchemy as sa
import datetime
import uuid
revision = '0185'
down_revision = '0184_alter_primary_key_1'
user_id= '6af522d0-2915-4e52-83a3-3690455a5fe6'
service_id = 'd6aa2c68-a2d9-4437... | govau/notify | api/migrations/versions/0185_change_account_owner_to_dta.py | 0185_change_account_owner_to_dta.py | py | 1,553 | python | en | code | 17 | github-code | 7 | [
{
"api_name": "alembic.op.execute",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "alembic.op.execute",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"li... |
16325318616 | #######################################################################################################################
# Multivariate modeling example
# This example takes data from dataset presented in [1]. It is a much simpler version of what is done in [2], the
# example has on... | supsi-dacd-isaac/mbtr | examples/multivariate_forecast.py | multivariate_forecast.py | py | 4,906 | python | en | code | 62 | github-code | 7 | [
{
"api_name": "mbtr.utils.load_dataset",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "mbtr.utils",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "numpy.mean",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "scipy.linalg.hankel",
... |
4446168331 | '''
Copyright (C) 2021-2023 Orange Turbine
https://orangeturbine.com
orangeturbine@cgcookie.com
This file is part of UV Flow.
The code for UV Flow is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either ... | V-Sekai/vsekai-blender-game-tools | addons/uvflow/operators/op_unwrap.py | op_unwrap.py | py | 7,619 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "uvflow.addon_utils.Property.BOOL",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "uvflow.addon_utils.Property",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "bpy.types.Context",
"line_number": 42,
"usage_type": "name"
},
{
"ap... |
6840795656 | """
Calculate the size of the longest common substring
"""
import argparse
import difflib
parser = argparse.ArgumentParser()
parser.add_argument("seq1", help="The first string")
parser.add_argument("seq2", help="The second string")
args = parser.parse_args()
s = difflib.SequenceMatcher(None, args.seq1, args.seq2)... | metaganal/scripts | commonsubstr.py | commonsubstr.py | py | 407 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "difflib.SequenceMatcher",
"line_number": 16,
"usage_type": "call"
}
] |
9041366301 | '''There is also QDA'''
import numpy as np
from sklearn.datasets import load_iris
import matplotlib.pyplot as plt
import seaborn as sb
data = load_iris()
X = data.data
y = data.target
def lda(X, y, n_components):
n_features = X.shape[1]
class_labels = np.unique(y)
mean_overall = np.mean(X, axis=0)
... | rohit-krish/MLAlgosFromScratch | Dimentionality Reduction/LDA/mine.py | mine.py | py | 1,755 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"... |
2774731448 | from django.contrib.auth import get_user_model
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.core.mail import send_mail
from django.db.models import Avg
from django.shortcuts import get_object_or_404
from rest_framework import filters, mixins, status, viewsets
from rest_framework.decora... | alidzen/yamdb_final | api/views.py | views.py | py | 5,624 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.tokens.PasswordResetTokenGenerator",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "serializers.ObtainCodeSerializer",
"line_number": 3... |
71745100064 | from .Maker import MakerMatrixBooks, MakerMatrixEvents, MakerMatrixPreprocessingBooks, \
MakerMatrixPreprocessingEvents, MakerMatrixPreprocessingEvents
import pandas as pd
from .paths import *
from .names import *
from sklearn.metrics.pairwise import linear_kernel
from tqdm import tqdm
from polls.models import *
... | Hvids/HumanInside | Django/recommendation_system/RequestModels.py | RequestModels.py | py | 3,943 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.pairwise.linear_kernel",
"line_number": 32,
"usage_type": "call"
},
{
"api_name"... |
74864954464 | import json
import os
from mindvision.dataset.meta import ParseDataset
from mindvision.engine.class_factory import ClassFactory, ModuleType
from mindvision.mindvideo.dataset.video_dataset import VideoDataset
__all__ = ["Activitynet", "ParseActivitynet"]
@ClassFactory.register(ModuleType.DATASET)
class Activitynet(Vi... | ZJUT-ERCISS/zjut_mindvideo | mindvideo/data/activitynet.py | activitynet.py | py | 6,045 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "mindvision.mindvideo.dataset.video_dataset.VideoDataset",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 65,
"usage_type": "attribute"
},
{
... |
19310621434 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cv2
import torch
'''
utils
author: Liuhao Ge
'''
import torch.nn as nn
from torch.autograd import Variable
import pdb
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import A... | zijinxuxu/PDFNet | lib/utils/utils.py | utils.py | py | 14,030 | python | en | code | 17 | github-code | 7 | [
{
"api_name": "torch.load",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 102,
"usage_type": "attribute"
},
{
"api_name": "torch.save",
"line_number": 119,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number":... |
8313551738 | # coding: utf-8
from __future__ import absolute_import
from flask import json
from six import BytesIO
from swagger_server.models.partner_response import PartnerResponse # noqa: E501
from swagger_server.models.sign_up_response import SignUpResponse # noqa: E501
from swagger_server.models.user_id import UserId # no... | HippoChat/hippo_backend | swagger_server/test/test_user_controller.py | test_user_controller.py | py | 1,804 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "swagger_server.test.BaseTestCase",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "swagger_server.models.user_id.UserId",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "swagger_server.models.user_info.UserInfo",
"line_number": 35,
"usag... |
33052330417 | """
from https://github.com/AghdamAmir/3D-UNet/blob/main/unet3d.py
"""
from torch import nn
import torch
import time
class Conv3DBlock(nn.Module):
"""
The basic block for double 3x3x3 convolutions in the analysis path
-- __init__()
:param in_channels -> number of input channels
:param out_channe... | maxencewynen/PRLSegmentation | model.py | model.py | py | 6,515 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv3d",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
11418729025 | import os
import requests
from pprint import pprint
"""
API Apple
Скачиваем картинки для альбомов и сохраняем их в папку covers
"""
URL = 'https://itunes.apple.com/search'
params = {
'term': 'coldplay'
}
res = requests.get(URL, params)
print('status_code', res.status_code)
print('raise_for_status', res.raise_fo... | Severes/Netology_python_prof_2019 | HW_3.1_ requests_http_query/API_apple.py | API_apple.py | py | 1,135 | python | ru | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_numbe... |
26272177433 | from robotpy_toolkit_7407 import Subsystem
from robotpy_toolkit_7407.motors import SparkMax
from robotpy_toolkit_7407.pneumatics.pistons import DoubleSolenoidPiston
import config
class Intake(Subsystem):
def __init__(self):
super().__init__()
self.intake_motor = SparkMax(config.intake_motor_id)
... | Choate-Robotics/7407-DriveCode-ChargedUp | subsystem/intake.py | intake.py | py | 1,455 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "robotpy_toolkit_7407.Subsystem",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "robotpy_toolkit_7407.motors.SparkMax",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "config.intake_motor_id",
"line_number": 11,
"usage_type": "attribute"
... |
32512867052 | # -*- encoding: utf-8 -*-
import pygame
pygame.mixer.pre_init()
pygame.mixer.init()
# DATA PATHS
#
# Images: data / image / type / id
# Sounds: data / audio / id
#
# REAL PATHS
#
# Images: ./data/assets/sound/id.png
# Sounds: ./data/audio/id.wav
# Fonts: ./data/fonts
def init(data: dict, on_step=None):
def _ste... | tt-thoma/Thirty-Dollar-Midi-Like-Python-Extension | thirty_dollar_ui_pygame/loader.py | loader.py | py | 1,101 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pygame.mixer.pre_init",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pygame.mixer.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",... |
14199793685 | # from pudb import set_trace; set_trace()
from typing import List
import math
from collections import Counter
class Solution:
def isNStraightHand(self, hand: List[int], groupSize: int) -> bool:
"""This is an easy problem, but I wrongly assumed that my initial idea
was not O(N). But it was. We use ... | FanchenBao/leetcode | LeetCode_846.py | LeetCode_846.py | py | 2,045 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "collections.Counter",
"line_number": 22,
"usage_type": "call"
}
] |
69976588702 | import argparse
import time
import pickle
import os
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow_probability as tfp
from utils import Make_Video_batch, make_checkpoint_folder, pandas_res_saver, \
build_video_batch_graph, plot_latents, MSE_rotation
from... | ratschlab/SVGP-VAE | BALL_experiment.py | BALL_experiment.py | py | 15,966 | python | en | code | 17 | github-code | 7 | [
{
"api_name": "tensorflow_probability.distributions",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "tensorflow_probability.math",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "utils.make_checkpoint_folder",
"line_number": 32,
"usage_type"... |
74501224544 | # -*- coding: cp1252 -*-
from finefun import *
import subprocess
import os, sys, re, time, gzip
import csv
from tempfile import NamedTemporaryFile
import shutil
import logging
import subprocess
from io import StringIO
#import material_file
#from db import *
from datetime import datetime
import unidecode
import urllib
... | saiswarup/listofwebsiteforscraping | farsettiarte.py | farsettiarte.py | py | 32,601 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "re.compile",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "re.MULTILINE",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "re.DOTALL",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_nu... |
71309541982 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | openstack/openstacksdk | openstack/tests/functional/dns/v2/test_zone_share.py | test_zone_share.py | py | 5,986 | python | en | code | 245 | github-code | 7 | [
{
"api_name": "openstack.tests.functional.base.BaseFunctionalTest",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "openstack.tests.functional.base",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "uuid.uuid4",
"line_number": 31,
"usage_type": "ca... |
73911021342 | from typing import List
class Solution:
def merge(self, intervals: List[List[int]]) -> List[List[int]]:
if not intervals:
return []
result = []
sorted_intervals = sorted(intervals)
low, high = sorted_intervals[0]
for interval_low, interval_high in sorted_interv... | cs-cordero/interview-prep | leetcode/0056_merge_intervals.py | 0056_merge_intervals.py | py | 1,037 | python | en | code | 9 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.