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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
28667896465 | import datetime
import logging
import time
import copy
import geohash
import hashlib
from peewee import fn, JOIN_LEFT_OUTER
from tornado import gen
from yiyun import tasks
from yiyun.exceptions import ArgumentError
from yiyun.ext.mixins import AMapMixin
from yiyun.libs.peewee_filter import (Filter, Filtering, StringF... | haoweiking/image_tesseract_private | PaiDuiGuanJia/yiyun/handlers/rest/activity.py | activity.py | py | 24,746 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "yiyun.libs.peewee_filter.Filter",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "yiyun.libs.peewee_filter.ForeignKeyFiltering",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "yiyun.libs.peewee_filter.StringFiltering",
"line_number": 39,
... |
8564350821 | from request_api import ApiOpenFoodFact
from sql import SqlInject
from newgui import GuiFood
# Food we're going to work on
foods = ["chocolat", "purée", "biscuit","brioche"]
# Check if the database exist
# try:
# test = SqlInject([], 'chocolat')
#
# except mysql.connector.errors.ProgrammingError:
# print("cre... | Bainard/activite5 | main.py | main.py | py | 749 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "request_api.ApiOpenFoodFact",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sql.SqlInject",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "newgui.GuiFood",
"line_number": 28,
"usage_type": "call"
}
] |
73491936828 | from itertools import zip_longest
class Solution:
def get_bin(self, num):
bin_list = []
while num:
bin_list.append(num % 2)
num //= 2
return bin_list
def hammingDistance(self, x: int, y: int) -> int:
bigger = max(x, y)
smaller = min(x, y)
... | ishmam-hossain/problem-solving | leetcode/461_hamming_distance.py | 461_hamming_distance.py | py | 1,122 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "itertools.zip_longest",
"line_number": 38,
"usage_type": "call"
}
] |
35544165878 | from datetime import datetime, timedelta
from django.db import models
from django.contrib.auth.models import User
from .calendar import Util
def ensure_is_datetime(date):
if isinstance(date, str):
date = datetime.strptime(date, Util.DATE_FORMAT)
return date
class Room(models.Model):
number = m... | bluepostit/di-python-2019 | daily-exercises/week9/visitors/models.py | models.py | py | 2,394 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "calendar.Util.DATE_FORMAT",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_n... |
10419999013 | from __future__ import annotations
import copy
import dataclasses
from typing import TYPE_CHECKING
from caver import patcher as caver_patcher
from randovania.exporter.game_exporter import GameExporter, GameExportParams
from randovania.games.game import RandovaniaGame
from randovania.lib import json_lib, status_updat... | randovania/randovania | randovania/games/cave_story/exporter/game_exporter.py | game_exporter.py | py | 1,645 | python | en | code | 165 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "randovania.exporter.game_exporter.GameExportParams",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 19,
"usage_type": "name"
},
{
... |
29476922034 | #! /usr/bin/env python
# -*- coding: utf-8 -*
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import scipy.io.wavfile
from python_speech_features import mfcc, fbank
def wav2feature(wav_paths, feature_type='logfbank', feature_dim=40,
... | hirofumi0810/tensorflow_end2end_speech_recognition | utils/io/inputs/feature_extraction.py | feature_extraction.py | py | 4,056 | python | en | code | 312 | github-code | 6 | [
{
"api_name": "scipy.io.wavfile.io.wavfile.read",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "scipy.io.wavfile.io",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "scipy.io.wavfile",
"line_number": 40,
"usage_type": "name"
},
{
"api_na... |
9790633118 | import json
import logging
from collections import OrderedDict
from json import JSONDecodeError
from pathlib import Path
from typing import Dict
import click
from journeys.errors import CoreWatcherFailed
from journeys.errors import JourneysError
from journeys.errors import ValidationRuntimeError
from journeys.utils.d... | wiksla/f5-bigip-journeys-app | journeys/validators/checks_for_cli.py | checks_for_cli.py | py | 9,993 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "journeys.errors.JourneysError",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "journeys.utils.device.Device",
"line_number": 51,
"usage_type": "name"
},
{
"api_... |
9008666300 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0007_auto_20151214_1429'),
]
operations = [
migrations.AlterModelOptions(
name='facture',
op... | Rampaul770/possum | possum/base/migrations/0008_auto_20151221_1827.py | 0008_auto_20151221_1827.py | py | 408 | python | en | code | null | github-code | 6 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterModelOptions",
"line_number": 14,
"usage_type": "call"
... |
16663276462 | #import plaidml.keras
#plaidml.keras.install_backend()
from keras.models import load_model, Model
from keras.layers import UpSampling2D, MaxPool2D, Conv2D, Conv2DTranspose, Input
from keras.preprocessing.image import img_to_array, array_to_img
from PIL import Image
import numpy as np
import glob
img_shape = (256, 25... | ojus1/StyleTransfer | test_autoencoder.py | test_autoencoder.py | py | 2,329 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "PIL.Image.open",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "keras.preprocessing.image.img_to_array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy... |
26320002593 | import torch as t
import torch.nn as nn
import torchvision as tv
from utils.config import opt
def load_vgg16(pretrained=True):
model = tv.models.vgg16(pretrained=pretrained)
# drop the last max-pooling layer
features = list(model.features)[:-1]
for layer in features[:10]:
for p in layer.parame... | stnamjef/feature_pyramid_network | models/utils/backbone_loader.py | backbone_loader.py | py | 2,758 | python | en | code | 11 | github-code | 6 | [
{
"api_name": "torchvision.models.vgg16",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torchvision.models",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "to... |
26041130176 | from __future__ import annotations
from collections import defaultdict
from typing import Tuple
from pants.backend.python.lint.flake8.subsystem import (
Flake8,
Flake8FieldSet,
Flake8FirstPartyPlugins,
)
from pants.backend.python.subsystems.setup import PythonSetup
from pants.backend.python.util_rules imp... | pantsbuild/pants | src/python/pants/backend/python/lint/flake8/rules.py | rules.py | py | 4,874 | python | en | code | 2,896 | github-code | 6 | [
{
"api_name": "pants.core.goals.lint.LintTargetsRequest",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "pants.backend.python.lint.flake8.subsystem.Flake8FieldSet",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "pants.backend.python.lint.flake8.subsystem.Fla... |
8177754845 | import asyncio
import os
import platform
if platform.system() == 'Windows':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
TOKEN = os.environ.get('AUTH_TOKEN', 'local')
TWO_FA = os.environ.get('TWO_FA', 'local_2fa')
URL = os.environ.get('URL', 'http://localhost:8080')
RABBIT_MQ ... | norkos/account-management | src/integration_tests/env.py | env.py | py | 419 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "platform.system",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "asyncio.set_event_loop_policy",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "asyncio.WindowsSelectorEventLoopPolicy",
"line_number": 6,
"usage_type": "call"
},
{
... |
20001905446 | import sys
import matplotlib.pyplot as plt
import common as cm
import time
import torch
is_train = True
if is_train:
from hyperparameters import *
# a list of losses
losses = []
# current loss
loss = 0
# sum of losses for an epoch
total_loss = 0
# now!
start = time.time()
... | jkjan/NLP | biGRU/trainer.py | trainer.py | py | 991 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "common.train",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "common.random_training_example",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sys.stdout.writ... |
26922923054 | """Compute quantum chemistry using Mainz-Austin-Budapest-Gainesville's CFOUR executable."""
import copy
import pprint
from decimal import Decimal
from pathlib import Path
from typing import Any, Dict, Optional, Tuple
import numpy as np
import qcelemental as qcel
from qcelemental.models import Provenance, Result
from... | ChemRacer/QCEngine | qcengine/programs/cfour/runner.py | runner.py | py | 5,927 | python | en | code | null | github-code | 6 | [
{
"api_name": "pprint.PrettyPrinter",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "model.ProgramHarness",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "model.ProgramHa... |
19757844319 | # shop.productsUrlsDao.py
import pathlib as pl
from typing import Optional, ClassVar, List
import debug.logger as clog
from config.base import APP_USERDATA_DIR
from shop.product import DictProductsUrlsConverter, Product
from storage.fileDao import TextFileDao
logger = clog.getLogger(__name__)
class ProductsUrlsDao... | dbyte/WebtomatorPublicEdition | webtomator/shop/productsUrlsDao.py | productsUrlsDao.py | py | 2,698 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "debug.logger.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "debug.logger",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "storage.fileDao.TextFileDao",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typin... |
72013215549 | import os, json
from selenium import webdriver
import logging.handlers
from config import DIR_PATH, HOST
class GetDriver:
__web_driver = None
# 获取Web Driver
@classmethod
def get_web_driver(cls):
if cls.__web_driver is None:
cls.driver = webdriver.Chrome()
cls.driver.ge... | linnahan/tpshopwebTest | util.py | util.py | py | 1,946 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "config.HOST",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "logging.... |
39553530108 | from django.shortcuts import render
# Create your views here.
from django.http import HttpResponse
import datetime
from django.db.models.functions import Trunc
from .models import ScrumyUser
from adesokanscrumy.models import ScrumyGoals, GoalStatus
from .models import ScrumyGoalsQueryset, ScrumyGoalsManager, GoalSt... | adesokanayo/adesokanscrumy | adesokanscrumy/views.py | views.py | py | 1,513 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "adesokanscrumy.models.ScrumyGoals.objects.all",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "adesokanscrumy.models.ScrumyGoals.objects",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "adesokanscrumy.models.ScrumyGoals",
"line_number... |
25869744902 | #6/26/18
#Creating a class for simple data visualization using numpy arrays
import matplotlib.pyplot as plotlib
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib.pyplot import *
import matplotlib.pyplot as plt
frank_rides.info()
sample_data=frank_rides
sample_data1=sample_data.values
c... | Fremont28/movie_recommender- | viz_tests.py | viz_tests.py | py | 1,248 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.DataFrame",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.xlabel",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pypl... |
22668725666 | from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from lxml import etree
import pickle
import time
city_list = ['Nuriootpa', 'Perth', 'Bendigo', 'Albury', 'CoffsHarbour',
... | hurrywish/Hurrywish_Warehouse | Australia_forecast/City_crawel.py | City_crawel.py | py | 3,283 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 25,
"usage_type": "call"
},
{
"api... |
34588199055 | from flask import Flask, render_template, request, redirect, session
import random
from datetime import datetime
app = Flask(__name__)
app.secret_key = "someSecretKeysdfasdf"
@app.route('/')
def index():
# start with 0 gold
if 'gold' not in session:
session['gold'] = 0
return render_template('i... | kleoworks/brians | FLASK/ninja_gold/server.py | server.py | py | 2,326 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "flask.session",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "flask.render_template",
"l... |
13479002456 | import pandas as pd
import numpy as np
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler
import matplotlib.pyplot as plt
df = pd.read_csv("iris.csv")
print(df.describe(include='all'))
features = ['sepallength', 'sepalwidth', 'petallength', 'petalwidth']
# Separating out the featu... | mwiecaszekUG/Inteligencja_Obliczeniowa_INF_Marek_Wiecaszek_274993 | Zadania/src/lab_06/zad02.py | zad02.py | py | 2,028 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.decomposition.PCA",
"line_number": 19,
"usage_type": "call"
},
{
"api... |
42163750157 | #%% IMPORTING LIBRARIES
import os
import glob
import shutil
import json
import keras
import itertools
import numpy as np
import pandas as pd
import seaborn as sns
import tensorflow as tf
from PIL import Image
import matplotlib.pyplot as plt
from collections import Counter
from tensorflow.keras.models imp... | jpnwagwu/SEECROP | index2-vgg.py | index2-vgg.py | py | 7,784 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_... |
16898207542 | import traceback
import boto3
import json
import base64
from botocore.exceptions import ClientError
# ***********************************************************************
# Class Definition
# ***********************************************************************
class SECRETREADER:
# **************************... | rajeshmadaye/aws-secret-manager-data | app/app.py | app.py | py | 5,920 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "boto3.session.Session",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "boto3.session",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "botocore.exceptions.ClientError",
"line_number": 47,
"usage_type": "name"
},
{
"api_name... |
71184190269 | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Script to automate something
'''
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from urllib2 import urlopen
import lxml.etree
if __name__ == '__main__':
urlout = ... | ddboline/programming_tests | python/liveblogging_list.py | liveblogging_list.py | py | 880 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "urllib2.urlopen",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "lxml.etree.etree.parse",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "lxml.etree.etree",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "lxml.etr... |
29669025580 | """"
There are 8 prison cells in a row, and each cell is either occupied or vacant.
Each day, whether the cell is occupied or vacant changes according to the following rules:
If a cell has two adjacent neighbors that are both occupied or both vacant, then the cell becomes occupied.
Otherwise, it becomes vacant.
(Note... | smakireddy/python-playground | ArraysAndStrings/PrisonCellAfterNDays.py | PrisonCellAfterNDays.py | py | 2,265 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 58,
"usage_type": "name"
}
] |
72167761149 | import os
from collections.abc import Iterable
import torch
from torch.optim import *
from torch.optim.lr_scheduler import *
from ._rm import RecordManager
from .. import RobModel
r"""
Base class for all trainers.
"""
class Trainer():
def __init__(self, name, model):
assert isinstance(model, RobMo... | Harry24k/adversarial-defenses-pytorch | torchdefenses/trainer/_trainer.py | _trainer.py | py | 8,639 | python | en | code | 33 | github-code | 6 | [
{
"api_name": "collections.abc.Iterable",
"line_number": 88,
"usage_type": "argument"
},
{
"api_name": "torch.save",
"line_number": 133,
"usage_type": "call"
},
{
"api_name": "_rm.RecordManager",
"line_number": 169,
"usage_type": "call"
},
{
"api_name": "torch.sav... |
31285581147 | #! /usr/bin/env python3
import sys
import os
import stat
import argparse
import nacl.utils
import nacl.public
import nacl.signing
def get_name(suffix):
filename = args.name + suffix
return os.path.join(args.output_directory, filename)
parser = argparse.ArgumentParser(description="Generate keys to encrypt O... | geofabrik/sendfile_osm_oauth_protector | generate_nacl_keys.py | generate_nacl_keys.py | py | 1,061 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "stat.S_ISDIR",
... |
16644761119 | # -*- coding: utf-8 -*-
# @Time:2021/4/1620:52
# @File:Fig7_spec_bar.py
import pandas as pd
import matplotlib.pyplot as plt
def LoadDict(path):
fr = open(path, encoding='utf-8')
dic = eval(fr.read()) # 将str转化成dict
fr.close()
return dic
def get_spec_ratio(lst):
dic_spec={}
n=len(lst)
for i... | QingqingSun-Bao/GitResp2 | nested/Fig7_spec_bar.py | Fig7_spec_bar.py | py | 2,285 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 31,
"usage_type": "attribute"
},
{
... |
6801948968 | # OrderedDict() remembers the order of key addition and returns them in the same
# order from an iterator
from collections import OrderedDict
from pprint import pprint
quotes = OrderedDict([
('Moe', 'A wise guy, huh?'),
('Larry', 'Ow!'),
('Curly', 'Nyuk nyuk!'),
])
for stooge in quotes:
print(stooge)
... | andrasfeher/Python | 12_standard-library-functions/main.py | main.py | py | 336 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.OrderedDict",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"line_number": 15,
"usage_type": "call"
}
] |
73698482429 | import sys
from PyQt5.QtWidgets import *
from PyQt5.QtCore import QCoreApplication
from PyQt5.QtGui import *
from PyQt5.QtCore import Qt
import xml.etree.ElementTree as ET
import csv
import os
from os import listdir
from os.path import isfile,join
import datetime
class MyApp(QWidget):
def parser(self):
... | yerim2/XmlParser | xmlParser.py | xmlParser.py | py | 4,650 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.parse",
... |
8566605152 | import pytest
from unidown.main import main
def test_run(tmp_path):
with pytest.raises(SystemExit) as se:
main(['--root', str(tmp_path), '--plugin', 'test', '-o', 'username=NasuaNasua', '-o', 'username=Nasua', 'Nasua', '--log', 'CRITICAL'])
assert se.value.code == 0
assert tmp_path.joinpath('sav... | IceflowRE/unidown | tests/main_test.py | main_test.py | py | 552 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pytest.raises",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "unidown.main.main",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "unidown.main.main",
"... |
42162109255 | import json
import os
import rdflib as rdf
import requests
from tqdm import tqdm
def get_compounds_ids_with_annotation_level():
endpoint = "https://dev.coconut.naturalproducts.net/api/v1/search/?limit=1000&page={}"
base_compound_id = "CNP0{}"
last_page = 407
compounds = dict()
for page in tqdm(... | ppalagi/biohackathon-projects-2023 | 7/dumps/scrape_coconut.py | scrape_coconut.py | py | 2,659 | python | en | code | null | github-code | 6 | [
{
"api_name": "tqdm.tqdm",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 4... |
31449749087 | import pandas as pd
import json
import re
dataset="SST2"
dataset_size_wanted=500
split=1
num_var=15
file=json.load(open(f'{dataset}/{dataset_size_wanted}/Output.json', 'r'))
# print(file['answer'])
# print(len(file['answer']))
if split>1:
#In this case each answer is for one entry
#We have 10 data points per entry... | smolPixel/DataAugmentationEMNLP2023 | AugmentStrat/ChatGPTData/Process.py | Process.py | py | 1,126 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"li... |
40687354353 | from bisect import bisect_right
from typing import NamedTuple, Optional
from lte.protos.mconfig.mconfigs_pb2 import EnodebD
from magma.enodebd.device_config.cbrs_consts import (
BAND48_LOW_FREQ_MHZ,
BAND48_NOFFS_DL,
SAS_BANDWIDTHS,
)
from magma.enodebd.exceptions import ConfigurationError
class EnodebCon... | magma/magma | lte/gateway/python/magma/enodebd/device_config/configuration_util.py | configuration_util.py | py | 3,975 | python | en | code | 1,605 | github-code | 6 | [
{
"api_name": "typing.NamedTuple",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "lte.protos.mconfig.mconfigs_pb2.EnodebD.EnodebConfig",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "lte.protos.mconfig.mconfigs_pb2.EnodebD",
"line_number": 15,
... |
31569981330 | # normal libraries
import math
import matplotlib.pyplot as plt
import numpy as np
# priv libraries
from corai_error import Error_not_allowed_input, Error_type_setter
from corai_plot import APlot
from corai_util.tools import function_iterable
# other files
from src.utilities.general import multi_list_genera... | Code-Cornelius/ITiDeEP | src/hawkes/hawkes_process.py | hawkes_process.py | py | 20,341 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.random.seed",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.log",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_n... |
71611702589 | import h5py as h5
import json
import numpy as np
import torch
import math
import sys
import open3d as o3d
import matplotlib.pyplot as plt
def bar(message, now: int, total: int):
"""
:param message: string to print.
:param now: the i-th iteration.
:param total: total iteration num.
:... | GengxinLiu/SWMP | Predict/utils.py | utils.py | py | 12,350 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "math.ceil",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.stdout.write",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout.flush",
"li... |
6175657836 | from os import listdir
import xml.etree.ElementTree as ET
from os.path import isfile, join
def read_i2b2_data(path):
"""
Function that reads i2b2 files from path and returns a list of documents with text and tags
:param path: Path where the files are located
:return: list of documents containing dicti... | icescentral/MASK_public | utils/readers.py | readers.py | py | 1,220 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.parse",
... |
39181072707 | import argparse
import cv2
import os
import sys
#где хранится исходник
file_path = os.path.dirname(sys.argv[0])
#аргумент командной строки с изображением
parser = argparse.ArgumentParser()
parser.add_argument("--source", type=str)
args = parser.parse_args()
src = args.source
#разбиваем по точке названи... | lofitechno/CigaretteDetector | detector.py | detector.py | py | 1,273 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
... |
16132684763 | '''
api commands from python to gain information about android avds
'''
import xml.etree.ElementTree as ET
import subprocess
import shlex
from typing import List, Union
import config_reader as config
import util
from emulator import Emulator
from apk import Apk
ADB = config.adb
PRINT_FLAG = True
def decode_apk(apk: ... | LordAmit/mobile-monkey | api_commands.py | api_commands.py | py | 11,690 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "config_reader.adb",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "apk.Apk",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "util.check_file_directory_exists",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "apk.a... |
40932335338 | import streamlit as st
import folium
from streamlit_folium import st_folium
import sg_map as sg
import sensor
import pandas as pd
import config
import chatbot
import geopy.distance
def my_display_text_box():
postal_code = st.sidebar.text_input('Postal Code',value='119077')
return postal_code
def calculate_... | JiongQ/flood_prediction_app | function.py | function.py | py | 1,774 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "streamlit.sidebar.text_input",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "streamlit.sidebar",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "folium.FeatureGroup",
"line_number": 19,
"usage_type": "call"
},
{
"api_name"... |
9000943272 | """
- This code uses a small package called Pynut to handle keydown/keyup events.
Credits to Moses Palmer (https://github.com/moses-palmer/) for the underlying code.
- This code uses a clipboard module called Pyperclip for under-the-hood clipboard read/write
Credits to Al Sweigart (https://github.com/asweigart/py... | CoxT9/ClipboardExtender | clipboard_main.py | clipboard_main.py | py | 3,933 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pynput.keyboard.Controller",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pynput.keyboard.Key.ctrl",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "pynput.keyboard.Key",
"line_number": 46,
"usage_type": "name"
},
{
"api_... |
27873458651 | import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
a=0.43
b=0.57
x0=0.342780#0.342781
y0=0.543980#0.543981
x_list=[]
y_list=[]
i_list=[]
U_dict={}
fun_list=np.array([[1,9,9,5,5,5,5,9,9,0],[2,2,2,2,1,0,3,3,3,3],[6,6,9,9,5,5,9,9,0,8],
[6,6,1,9,5,5,9,0,8,8],[2,6,6... | WangyfCO/two-dimensional-tentmap | tentmap.py | tentmap.py | py | 4,214 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyp... |
10837602568 | import logging
import time
import numpy as np
import pybullet
import pybullet as p
import pybullet_data
from pybullet_sim.assets.path import get_asset_root_folder
from pybullet_sim.pybullet_utils import HideOutput
asset_path = get_asset_root_folder()
from pybullet_sim.hardware.robotiq2F85 import Gripper
from ur_ikfas... | tlpss/robot-learning-workspace | pybullet-sim/pybullet_sim/hardware/ur3e.py | ur3e.py | py | 10,306 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pybullet_sim.assets.path.get_asset_root_folder",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pybullet_sim.hardware.robotiq2F85.Gripper",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 24,
"usage_type": "... |
71732540668 | import logging
from dataclasses import dataclass
from typing import Any, Dict, List, Optional, Union
from generator import geometry, materials
from generator.scene import Scene
from .choosers import choose_counts, choose_random
from .components import ILEComponent
from .decorators import ile_config_setter
from .defs ... | NextCenturyCorporation/mcs-scene-generator | ideal_learning_env/structural_objects_component.py | structural_objects_component.py | py | 38,637 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "defs.RandomizableString",
"line_number": 102,
"usage_type": "name"
},
{
"api_name": "numerics.RandomizableInt",
"line_number": 103,
"usage_type": "name"
},
{
"api_name": "... |
72568408187 | import argparse
import json
import requests
import time
import warnings
from n_tokens import estimate_price
import pickle
import numpy as np
import torch
from pathlib import Path
# from utils.babyai_utils.baby_agent import load_agent
from utils import *
from textworld_utils.utils import generate_text_obs
from models ... | flowersteam/social-ai | scripts/LLM_test.py | LLM_test.py | py | 34,136 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "warnings.warn",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "numpy.allclose",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number": 68,
"usage_type": "attribute"
},
{
"api_name": "numpy.allclose",
"lin... |
42618053540 | from django.shortcuts import render
from django.http import HttpResponse,HttpResponseRedirect
# Create your views here.
from django.shortcuts import redirect
from .models import *
from django.template.defaultfilters import date as _date
from datetime import datetime
import json
from django.core.mail import send_mail
fr... | sgpro1991/main_compose | build/app/CFM/pages/views.py | views.py | py | 23,240 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "collections.OrderedDict.fromkeys",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "collections.OrderedDict.fromkeys",
"line_number": 34,
"usage_type": "call"
},
... |
20588497603 | import os.path
from tempfile import TemporaryDirectory
import pystac
# from pystac.stac_io import StacIO
from stactools.testing import CliTestCase
from stactools.worldclim.commands import create_worldclim_command
class CommandsTest(CliTestCase):
def create_subcommand_functions(self):
return [create_worl... | stactools-packages/worldclim | tests/test_commands.py | test_commands.py | py | 2,275 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "stactools.testing.CliTestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "stactools.worldclim.commands.create_worldclim_command",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "tempfile.TemporaryDirectory",
"line_number": 16,
"usa... |
36245951836 | from num2words import num2words
def lerArquivo(path):
arquivo = open(path, 'r')
criaArray = []
for linha in arquivo:
criaArray.append(linha.replace('\n', ''))
arquivo.close()
return criaArray
def criaArquivo(path, arrayExtenso):
arquivo = open(path, 'w')
for line in arrayExtenso:
... | RobsonCrLira/teste-qiup | teste-python/index.py | index.py | py | 1,058 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "num2words.num2words",
"line_number": 18,
"usage_type": "call"
}
] |
26215167863 | # region imports
import os
import sys
import logging
import pytest
import io
import math
from unittest.mock import patch
''' Notes
1. Modified code to eliminate \r\n and \n so that character counts is consistent between Python, Java and CSharp
The num_char therefore do not match what "wc" thinks is the number of cha... | khtan/FoundationsOfPythonProgramming1 | python/tests/test_ch10.py | test_ch10.py | py | 9,425 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "math.isclose",
"line_number": 236,
"usage_type": "call"
},
{
"api_name": "math.isclose",
"line_number": 237,
"usage_type": "call"
}
] |
3525590838 | from django.http import response
from django.shortcuts import render
from rest_framework.decorators import api_view
from rest_framework.response import Response
import json
from . import execution
from UserHandler.execution import verifyToken
# Create your views here.
@api_view(['GET'])
def getAllDepartments(request... | Sadat-Shahriyar/Panacea | Panacea/Appointment/views.py | views.py | py | 4,770 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.http.response",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "rest_framework.response.Response",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.http.response",
"line_number": 15,
"usage_type": "argument"
},
{
"ap... |
3513886693 | import cv2
import numpy as np
from marker_detector import ShapeDetector
##################################
# 1.wykrywanie ruchu #
# 2.wykrywanie zajezdni #
# 3.wykrywanie peronu #
# 4.wykrywanie przeszkod #
# 5.wykrywanie reki #
# 6.wykrzwanie twarzy ... | Medioxx/PKM2.2 | PKM2/rest_api_pkm2/Detection.py | Detection.py | py | 10,236 | python | pl | code | 0 | github-code | 6 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "cv2.createBackgroundSubtractorMOG2",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "c... |
28176473772 | from datetime import datetime
from django.test import TestCase
from django.test import Client
from mysite.polls.models import Poll, Choice
class PollTest(TestCase):
def setUp(self):
question="What is your favourite colour?"
now = datetime.now()
self.poll = Poll.objects.create(questio... | pgiitu/django_tutorial | mysite/polls/tests.py | tests.py | py | 1,804 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "django.test.TestCase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "mysite.po... |
21095532901 | import torch
import time
import numpy as np
import scipy.io as sio
from Spa_downs import *
from LoadDataset_Batch import *
from torch.utils.data import DataLoader
from torch.autograd import Variable
import time
import os
import matplotlib.pyplot as plt
from torch.nn.functional import upsample
from torch.nn.... | pyguan88/MDA-Net | Train_FusionModel.py | Train_FusionModel.py | py | 9,120 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "torch.no_grad",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.randint",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
41543920358 | from fastapi import Request
from models.user import *
def get_current_user(request: Request) -> User | None:
try:
user_id = request.session["user_id"]
return read_user_by_id(user_id)
except:
return None
| Devansh3712/nasake | internal/session.py | session.py | py | 238 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.Request",
"line_number": 6,
"usage_type": "name"
}
] |
40317065206 | from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render, get_object_or_404, redirect
from django.views.decorators.cache import never_cache
from django.contrib.auth.decorators import login_required
from django.conf import settings
from django.core.urlresolvers import reverse
from ... | dpford/hackathon | dashboard/views.py | views.py | py | 6,825 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "models.ExcelloUser.objects.filter",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "models.ExcelloUser.objects",
"line_number": 92,
"usage_type": "attribute"
},
{
"api_name": "models.ExcelloUser",
"line_number": 92,
"usage_type": "name"
},
{
... |
30168332686 | # %%
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import ks_2samp
import pandas as pd
import random
from scipy.stats import ks_2samp, wasserstein_distance
from doubt import Boot
from nobias import ExplanationShiftDetector
random.seed(0)
# Scikit Learn
from sklearn.model_selection import train_te... | cmougan/ExplanationShift | synthetic.py | synthetic.py | py | 5,072 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "random.seed",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "... |
16595098453 | import logging
import numpy as np
from scipy.interpolate import interp1d
from frank.constants import deg_to_rad, sterad_to_arcsec, rad_to_arcsec
from frank.geometry import FixedGeometry
from frank.hankel import DiscreteHankelTransform
from frank.statistical_models import VisibilityMapping
def arcsec_baseline(x):
... | discsim/frank | frank/utilities.py | utilities.py | py | 35,064 | python | en | code | 15 | github-code | 6 | [
{
"api_name": "numpy.pi",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_number": 97,
"usage_type": "attribute"
},
{
"api_name": "numpy.log",
"line_number": 97,
"usage_type": "call"
},
{
"api_name": "frank.constants.sterad_to_arcse... |
25876830470 | #!/usr/bin/env python
from beamforming_xy import BF_Noise_Threshold_Relative_XY
from shift_stack import shift_traces
import obspy
import matplotlib.pyplot as plt
import numpy as np
import scipy
from Parameters_Bootstrap import *
import random
import sys
import os
from obspy.taup import TauPyModel
import time
from arra... | eejwa/Array_Seis_Circle | scripts/Bootstrap_Peak_Recover_XY.py | Bootstrap_Peak_Recover_XY.py | py | 7,042 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "obspy.taup.TauPyModel",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "mpi4py.MPI.COMM_WORLD",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "mpi4py.MPI",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "os.path.e... |
75114095226 | from config import *
from Utilities import filehandler
from Application import rating
from lxml import etree
from io import StringIO
class Match:
def __init__(self, file):
self.file = file # file path
self.id = None # Practiscore match ID
self.date = None ... | kmcken/EloRating | Utilities/practiscore.py | practiscore.py | py | 17,806 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "Utilities.filehandler.read_json",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "Utilities.filehandler",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "Utilities.filehandler.read_json",
"line_number": 53,
"usage_type": "call"
},
{
... |
43957654670 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import requests
# In[2]:
import bs4
from bs4 import BeautifulSoup
# In[3]:
import pandas as pd
# In[4]:
HOSTRBC = 'https://www.rbc.ru/'
URLRBC = 'https://www.rbc.ru/story/5e2881539a794724ab627caa'
HOSTRIA = 'https://ria.ru/'
URLRIA = 'https://ria.ru/category... | AsianMiracle/MIEThack | GG.py | GG.py | py | 5,015 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 119,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",... |
44848733356 | import configparser
import zmq
import time
import json
config = configparser.ConfigParser()
config.read("config.ini")
def connect():
global context
context = zmq.Context()
global socket
socket = context.socket(zmq.PUB)
connection_string = "tcp://" + config['TRACKING']['address'] + ":" + config['TR... | raedhamam/eon-lab-tracking-service | tracking_service.py | tracking_service.py | py | 1,700 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "zmq.Context",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "zmq.PUB",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"li... |
14905571210 | import logging
import pandas as pd
import numpy as np
import os
import wandb
from tqdm import tqdm
from othello.OthelloInteractiveBoard import InteractiveBoard
from othello.keras.NNet import NNetWrapper as nn
from othello.OthelloInteractiveBoard import InteractiveBoard
from othello.OthelloLogic import Board
from othel... | NetasDev/bachelor | Arena.py | Arena.py | py | 8,728 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "othello.OthelloInteractiveBoard.InteractiveBoard",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 57,
"usage_type": "call"
},
{
... |
43085040121 | """Renames a set of variables in an output file for use in cases where
variable names change but we still need to run regression tests.
2
"""
import h5py
aliases = dict(ponded_depth="surface-ponded_depth")
def rename(datin, datout):
for var in datin.keys():
try:
varout = aliases[var]
... | amanzi/ats | tools/utils/alias_output_variables.py | alias_output_variables.py | py | 874 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "h5py.File",
"line_number": 29,
"usage_type": "call"
}
] |
24013604621 | # Problem: https://www.hackerrank.com/challenges/py-collections-deque/problem
# Score: 20
from collections import deque
d = deque()
for _ in range(int(input())):
line = input().split()
if line[0] == 'append':
d.append(line[1])
elif line[0] == 'pop':
d.pop()
elif line[0] == 'popleft':... | marinskiy/HackerrankPractice | Python/07. Collections/006. Collections deque().py | 006. Collections deque().py | py | 415 | python | en | code | 954 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 8,
"usage_type": "call"
}
] |
38334032172 | #!/usr/bin/python
from websocket import create_connection
import unittest
from common import read_info
from common import read_message
from common import check_action as c
from common import Base_64
from common import WR_file
import time
import json
class websocket_request(unittest.TestCase):
"""文件管理/1. 控制器发送文... | leen0910/websocket_api_2.0.1 | test_case/test04_FileSend.py | test04_FileSend.py | py | 6,116 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "common.read_info.ReadInfo",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "common.read_info",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "web... |
38006102298 | from flask import Flask,render_template,request,json,jsonify,session
import sqlite3
import numpy as np
import random
links = {"Data science":["https://www.datacamp.com/courses/data-science-for-everyone","https://www.udacity.com/courses/all?skill=Data+Science"],
"full-stack development":["https://www.lynda... | abhay-j/student-performance-analysis | main.py | main.py | py | 5,651 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "joblib.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"... |
43703923110 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
import logging
from errors import DatabaseError
from food.database_service import DatabaseService
from food.models import Product, Category, Store
# Get an instance of a logger
logger = logging.getLogger(_... | Githb-usr/purbeurre-deployment | food/management/commands/import_data.py | import_data.py | py | 2,180 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 15,
"usage_type": "name"
},
{
"api_n... |
32259759315 | import os
from flask import Flask, make_response, render_template, request, redirect, url_for, send_from_directory
from flask.json import jsonify
from werkzeug.utils import secure_filename
import tempfile
import sys
import struct
import base64
import numpy as np
import zmq
import io
from scipy import misc
import hashli... | tanc-ahrc/deep-discoveries-backend | webapp/server.py | server.py | py | 6,240 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "zmq.Context",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "zmq.REQ",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "struct.unpack_from",
"line_n... |
12196017710 | from agora_analysis.field_setup.metal_functions import calculate_inflow_outflow
from agora_analysis.analysis_scripts.defaults import default_radii
from unyt import unyt_array,unyt_quantity
import numpy as np
import yt
yt.set_log_level(50)
import os
def snap_flux_analysis(snap,overwrite = False,radii = 'default',... | claytonstrawn/agora_analysis | agora_analysis/analysis_scripts/snap_flux_analysis.py | snap_flux_analysis.py | py | 2,375 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "yt.set_log_level",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "agora_analysis.analysis_scripts.defaults.default_radii",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
"line_number": 18,
"usage_type": "call"
},
{
... |
3027327566 | from __future__ import absolute_import, print_function
import os
import numpy as np
# import gradio as gr
import torch
import torch.nn as nn
import pandas as pd
from PIL import Image
from torchvision import models
from tqdm import tqdm
from Visualization_with_Gradio import image_classes, transformations
from Visualiz... | Perrigatoni/Feature-Visualization | deprecated/render_mk2_extract_scaler.py | render_mk2_extract_scaler.py | py | 6,150 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torch.device",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "torchvision.mode... |
35644328074 | import numpy as np
import gym
import time
import json
import os
from datetime import datetime
import matplotlib.pyplot as plt
from keras.layers import Dense
from keras.models import Sequential
from keras.models import load_model
from keras.models import model_from_json
from keras.callbacks import TensorBoard
from keras... | Maplesotrys/Williams-REINFORCE-Research | AE/AE_keras_RL.py | AE_keras_RL.py | py | 7,103 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.float",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.zeros_like",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_... |
31837808493 |
# coding: utf-8
# In[1]:
# Clair De Lune Feature Extraction
import essentia
import essentia.standard as es
# compute all features, aggregate only 'mean' and 'stdev' statistics for all low-level, rhythm and tonal frame features
features, features_frames = es.MusicExtractor(lowlevelStats=['mean', 'stdev'],
... | marcjones-io/mir-tasks | clairdelune-analysis/cdl_feature_extraction.py | cdl_feature_extraction.py | py | 3,314 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "essentia.standard.MusicExtractor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "essentia.standard",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "essentia.streaming.MonoLoader",
"line_number": 37,
"usage_type": "call"
},
{
"... |
71967736188 | from common import utils
import re
import collections
import sys
import json
import csv
import math
import ipaddress
from datetime import datetime
class RulesParser:
"""
This class is usead to read and parse the output of the command
vsipioctl getrules -f <filter_name>
"""
# Class Variables
R... | dcoghlan/dfwoptimzer | dfwoptimizer/parsers/ruleset.py | ruleset.py | py | 46,365 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 229,
"usage_type": "call"
},
{
"api_name": "re.VERBOSE",
"line_number": 229,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_number": 231,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
... |
70944972668 | import scipy.stats as stats
import random
# [two-sample t 검정 : 문제1]
# 다음 데이터는 동일한 상품의 포장지 색상에 따른 매출액에 대한 자료이다.
# 포장지 색상에 따른 제품의 매출액에 차이가 존재하는지 검정하시오.
# 귀무 : 포장지 색상에 따른 제품의 매출액에 차이가 존재하지 않다.
# 대립 : 포장지 색상에 따른 제품의 매출액에 차이가 존재한다.
blue = [70, 68, 82, 78, 72, 68, 67, 68, 88, 60, 80]
red = [60, 65, 55, 58, 67, ... | kangmihee/EX_python | py_hypo/pack2/ttest2_exam.py | ttest2_exam.py | py | 1,813 | python | ko | code | 0 | github-code | 6 | [
{
"api_name": "scipy.stats.ttest_ind",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "scipy.stats",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "random.sample",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "random.sample",
"... |
9023240680 | import pytest
from selenium import webdriver
def pytest_addoption(parser):
parser.addoption('--browser_name', action='store', default=None,
help="Choose browser: chrome or firefox")
@pytest.fixture(scope="function")
def browser(request):
browser_name = request.config.getoption("browser_n... | Bulgakoff/auto-tests-course | less_3/pytestes_param/sec_3_1/conftest.py | conftest.py | py | 1,487 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 18,
"usage_type": "call"
},
{
"api_name"... |
35628171815 | from setuptools import setup
package_name = 'object_pose_estimation'
setup(
name=package_name,
version='1.0.0',
packages=[package_name],
data_files=[],
install_requires=['setuptools', 'numpy', 'open3d', 'opencv-python', 'matplotlib'],
zip_safe=True,
maintainer='fabio-amadio',
maintaine... | IASRobolab/object_pose_estimation | setup.py | setup.py | py | 535 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "setuptools.setup",
"line_number": 5,
"usage_type": "call"
}
] |
3653486890 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import sys
from difflib import get_close_matches
import math
#adapter from https://stackoverflow.com/questions/27928/calculate-distance-between-two-latitude-longitude-points-haversine-formula/21623206
#but changed
def haversine(lat1, lon1, lat2, l... | injoon2019/SFU_CMPT353 | Exercise/e4/temperature_correlation.py | temperature_correlation.py | py | 2,228 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.deg2rad",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.deg2rad",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "math.sin",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 17... |
36101361714 | import torch
from torch.autograd import Variable
def maxpool4d(corr4d_hres, k_size=4):
slices = []
for i in range(k_size):
for j in range(k_size):
for k in range(k_size):
for l in range(k_size):
sl = corr4d_hres[:, 0, i::k_size, j::k_size, k::k_size, l::... | KAIST-ITC/fall_detection | fall_detecction/maxpool4d.py | maxpool4d.py | py | 1,032 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torch.cat",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.max",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.fmod",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.fmod",
"line_number": 17,
... |
6427885686 | #!/usr/bin/python3
from pynput.keyboard import Key, Listener
import matplotlib.pyplot as plt
import concurrent.futures
import numpy as np
import subprocess
from datetime import datetime, time, timedelta
import pyaudio
import wave
import sys
import os
import configparser
config = configparser.ConfigParser()
config.re... | ArtIntlabs/soft_raspberry | create_data.py | create_data.py | py | 6,528 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pynput.keyboard.Key.esc",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "pynput.keyboard.Key",
"line_number": 25,
"usage_type": "name"
},
{
"api_na... |
7708559603 | from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
import time
import pandas as pd
import numpy as np
chrome_options = Options()
chrome_options.add_experimental_option("detach", True)
chrome_options.add_argument('--headless')
chrome_options.... | shaikhahmad179/House_Price_Prediction | main.py | main.py | py | 1,490 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 27,
"usage_type": "name"
},
{
... |
18959057004 |
import os
import configparser
from datetime import datetime,timedelta
from airflow import DAG
from airflow.operators.dummy import DummyOperator
from airflow.providers.amazon.aws.operators.s3 import S3CreateBucketOperator
from airflow.operators.bash import BashOperator
raw_datalake_bucket_name = 'hieu-raw-datalake'
d... | hieutdle/bachelor-thesis | airflow/dags/extract_datalake_dag.py | extract_datalake_dag.py | py | 1,305 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "airflow.DA... |
74921878586 | #豆瓣爬虫
import urllib.request
from bs4 import BeautifulSoup
import sqlite3
import re
import xlwt
#分析自己要获取数据的字段,在这里,分别是电影中文名称,电影英文名称,电影图片,评论,评价人数,电影链接,一句话概述,基本信息
Link = re.compile(r'<a href="(.*?)">')
def main():
baseurl = "https://movie.douban.com/top250?start="
datalist = getData(baseurl)
# urlAsk("")#首先是爬... | git123hub121/Python-analysis | 数据化分析-豆瓣/豆瓣爬虫/douban.py | douban.py | py | 2,670 | python | zh | code | 4 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "urllib.request.request.Request",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "... |
7162260954 | """
Given the root of a binary tree, calculate the vertical order traversal of the binary tree.
For each node at position (row, col), its left and right children will be at positions (row + 1, col - 1) and (row + 1, col + 1) respectively. The root of the tree is at (0, 0).
The vertical order traversal of a binary tre... | CompetitiveCodingLeetcode/LeetcodeEasy | Trees/BinaryTree/VerticalOrderTraversalOfBinaryTree_Q987.py | VerticalOrderTraversalOfBinaryTree_Q987.py | py | 3,215 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 54,
"usage_type": "name"
}
] |
31653790967 | #!/usr/bin/env python3
""" Implementation of Depth First Search to find a route between nodes
"""
from collections import deque
def find_route(graph, start, end):
visited = set()
Q = deque()
Q.append(start)
while Q:
node = Q.popleft()
if node not in visited:
visited.add(node)
... | ilee38/practice-python | coding_problems/CTCI_2021/trees_graphs/4_1_route_between_nodes.py | 4_1_route_between_nodes.py | py | 691 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 9,
"usage_type": "call"
}
] |
258029055 | import pytest
from apps.items.models import Item
from django.db.utils import IntegrityError
@pytest.mark.django_db
def test_item_without_quantity():
item = Item(
code="ocarina",
name="Ocarina of Time",
item_group="ocarina",
item_type="item",
)
assert item.code == "ocarina"... | nconnel4/mmr-tracker | backend/tests/apps/items/test_models.py | test_models.py | py | 1,618 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "apps.items.models.Item",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "apps.items.models.Item",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pytest.m... |
20832588093 | from django.test import TestCase
from assignment_system.models import Assignment, Assignee
from datetime import datetime
import pytz
class AssignmentTestCase(TestCase):
assignee = None
def setUp(self):
self.assignee = Assignee(
name="John",
last_name="Doe",
email="... | Nazar910/assignment-system-diploma | assignment_system/tests/models/assignment/test_props.py | test_props.py | py | 1,264 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.test.TestCase",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "assignment_system.models.Assignee",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 22,
"usage_type": "call"
},
{
"api_n... |
36230212716 | # 这部分用来生成展示迷宫
from random import randint # random()方法用来随机生成0到1范围内的实数,但是不能进行直接访问,所以导入randint模块
from enum import Enum # enum模块是系统内置模块,使用import进行导入
class MAP_ENTRY_TYPE(Enum):
MAP_EMPTY = 0, # 空标记为0
MAP_BLOCK = 1, # 障碍物标记为1
MAP_TARGET = 2, # 目标标记为2
MAP_PATH = 3, # 可走路径标记为3
class WALL_DIRECTION(Enum): # 使用... | jiujiu1012/Maze | GameMap.py | GameMap.py | py | 2,509 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "random.randint",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number":... |
73076327227 | from __future__ import annotations
import os
from typing import TYPE_CHECKING, List
from urllib.parse import urlparse
from bot import errors
from bot.player.enums import TrackType
from bot.player.track import Track
if TYPE_CHECKING:
from bot import Bot
class Streamer:
def __init__(self, bot: B... | gumerov-amir/TTMediaBot | bot/modules/streamer.py | streamer.py | py | 2,733 | python | en | code | 52 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "bot.Bot",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "bot.config",
"line_numbe... |
426673180 | import easyocr
import os
def scan_image(img_path: str, lang: str):
reader = easyocr.Reader([lang])
result = reader.readtext(os.path.abspath(os.curdir) + img_path,
detail=0, paragraph=True)
result = ' '.join(i for i in result)
return result
| zTMXz/OCR_Scanner | scanner/text_recognition.py | text_recognition.py | py | 287 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "easyocr.Reader",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.curdir",
"line_number... |
15786812591 |
from utils.constants import MAX_SEQUENCE_LENGTH_LIST, NB_CLASSES_LIST, TRAIN_FILES
from utils.generic_utils import load_dataset_at
import os
import numpy as np
import joblib
from sklearn.svm import SVC
from sklearn.metrics import accuracy_score
if __name__ == '__main__':
# COMMON PARAMETERS
DATASET_ID = lis... | titu1994/LSTM-FCN-Ablation | train_all_svm_features.py | train_all_svm_features.py | py | 4,163 | python | en | code | 52 | github-code | 6 | [
{
"api_name": "utils.constants.MAX_SEQUENCE_LENGTH_LIST",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "utils.constants.NB_CLASSES_LIST",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "utils.constants.TRAIN_FILES",
"line_number": 33,
"usage_type": "... |
5608764434 | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
from future.utils import with_metaclass
standard_library.install_aliases() # NOQA
from abc import ABCM... | pfnet-research/piekd | custom_chainerrl/chainerrl/replay_buffer.py | replay_buffer.py | py | 23,393 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "future.standard_library.install_aliases",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "future.standard_library",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "future.utils.with_metaclass",
"line_number": 24,
"usage_type": "call"
},
... |
6960129042 |
import numpy as np
import matplotlib.pyplot as plt
#import tensorflow as tf
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
# 텐서플로우 2.0 환경에서 1.x 코드 실행하기
print(tf.__version__)
def Data_Genearion(num_points):
#num_points = 50
vectors_set = []
for i in np.arange(num_points):
x = np.rand... | SCKIMOSU/Numerical-Analysis | tensor_w.py | tensor_w.py | py | 2,644 | python | en | code | 17 | github-code | 6 | [
{
"api_name": "tensorflow.compat.v1.disable_v2_behavior",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat.v1",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "tensorflow.compat.v1.__version__",
"line_number": 10,
"usage_type": "attribut... |
22108156614 | #!/usr/bin/env python
"""A wrapper for Django's manage.py that sets up App Engine's paths."""
import os
import sys
gae = '/usr/local/google_appengine'
def main():
sys.path.insert(0, gae)
import dev_appserver
dev_appserver.fix_sys_path()
# Fix Django version (1.4 -> 1.5).
for i in xrange(len(sy... | jeffreyc/rerss | rerss/m.py | m.py | py | 662 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.path.insert",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "dev_appserver.fix_sys_path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.path",
... |
33624923511 | import numpy as np
from sklearn.base import BaseEstimator
from utils.utils import fnorm, l2norm, nuclear_prox, l1shrink
class rpca2(BaseEstimator):
"""
Parameters
----------
lambda_:
penalty for the sparsity error
mu_:
initial lagrangian penalty
max_i... | giobiba/anomalydetection | src/anomalydetection/rpca2.py | rpca2.py | py | 4,339 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.base.BaseEstimator",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "numpy.linalg.svd",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "numpy.ab... |
16995112164 | from django.shortcuts import render, get_object_or_404, redirect
from Shoes.models import Shoes
from .models import Buyer
from .forms import OrderForm
def post_order(request, order_pk):
shoes = get_object_or_404(Shoes, pk=order_pk)
if request.method == 'POST':
form = OrderForm(request.POST)
... | yeehdavid/bazha | Order/views.py | views.py | py | 615 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "Shoes.models.Shoes",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "forms.OrderForm",
"line_number": 9,
"usage_type": "call"
},
{
"api_name":... |
71552445948 | from typing import List
from sqlalchemy.orm import Session
import models.address
import models.user
import schemas.address
def create(
db: Session, address: schemas.address.AddressCreate, user: dict
) -> models.address.Address:
new_address = models.address.Address(
address1=address.addr... | hsmtkk/reimagined-robot | cruds/address.py | address.py | py | 763 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "schemas.address.address",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "schemas.address",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "m... |
39218614413 | import psycopg2
from psycopg2 import pool
try:
postgreSQL_pool = psycopg2.pool.SimpleConnectionPool(1, 20,user = "postgres",
password = "tdtk1538",
host = "127.0.0.1",
port = "54... | Tadataka-Matsumoto/retrogame | PycharmProjects/connectdb.py | connectdb.py | py | 1,632 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "psycopg2.pool.SimpleConnectionPool",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "psycopg2.pool",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "psycopg2.DatabaseError",
"line_number": 31,
"usage_type": "attribute"
}
] |
71851129148 | from binance.client import Client
import utils
BOT_TOKEN = "6587549219:AAF2uGQJyYjs7IoYUIDK6Keco877wkqZNSc"
CHANNEL_ID = -1001929072843
RSI_PERIODS = [6,14,21]
RSI_LOW = 23
RSI_HIGH = 77
interval = Client.KLINE_INTERVAL_15MINUTE
TRADING_PAIRS = utils.get_trading_pairs() | NavesSapnis/Binance-bot | CONFIG.py | CONFIG.py | py | 275 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "binance.client.Client.KLINE_INTERVAL_15MINUTE",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "binance.client.Client",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "utils.get_trading_pairs",
"line_number": 14,
"usage_type": "call... |
72470164668 | from famacha import Famacha
import cv2
import numpy as np
f = Famacha()
dados = f.predict_image('1,1.jpg')
xy = dados["masks"]
print(f'\nMascara-> {xy}\n')
img = cv2.imread("1,1.jpg")
img = cv2.cvtColor(img,cv2.COLOR_BGR2RGB)
segment = np.zeros(img.shape, np.uint8)
posicoes = [tuple(map(int, ponto)) for array in... | mauriciobenjamin700/IC_V2 | YOLO/testes/test7.py | test7.py | py | 529 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "famacha.Famacha",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2RGB",
"line_... |
1564416747 | from pymongo import MongoClient
import sys
import datetime
client = MongoClient('mongodb://localhost:27017/')
# data base name : 'test-database-1'
mydb = client['web-server-db']
myrecord = {
"sender": sys.argv[1],
"receiver": sys.argv[2],
"timestamp" : sys.argv[3],
"sum" : sys.argv[4]
}
record_id = mydb.transac... | catalinjitea/transactions-web-server | insert_some_data.py | insert_some_data.py | py | 348 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.