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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
35196259562 | import logging
import random as rand
from enum import Enum
import numpy as np
from numpy import array as arr
from numpy import concatenate as cat
import scipy.io as sio
from scipy.misc import imread, imresize
class Batch(Enum):
inputs = 0
part_score_targets = 1
part_score_weights = 2
locref_targets ... | eldar/pose-tensorflow | dataset/pose_dataset.py | pose_dataset.py | py | 14,519 | python | en | code | 1,127 | github-code | 36 | [
{
"api_name": "enum.Enum",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "numpy.arange",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.expand_dims",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.asscalar",
"line_n... |
23600896108 | import sqlite3
import qrcode
import wx
import wx.aui
import wx.lib.agw.aui as aui
import wx.adv
from datetime import datetime
from dateutil.relativedelta import relativedelta
import bcrypt
import cv2
import phonenumbers
from phonenumbers import carrier
from phonenumbers.phonenumberutil import number_type
i... | najiar/Python-Fitness-App | Fitness_Project.py | Fitness_Project.py | py | 79,776 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlite3.connect",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "wx.Panel",
"line_number": 67,
"usage_type": "attribute"
},
{
"api_name": "wx.Panel.__init__",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "wx.Panel",
"line_... |
8596463464 | from django.urls import path
from .views import HomePageView, SearchResultsView
from phones import views
urlpatterns = [
path('', HomePageView.as_view(), name='home'),
path('search/', SearchResultsView.as_view(), name='search_results'),
path('create/', views.create),
path('edit/<int:id>... | Avalardiss/phonebook | phones/urls.py | urls.py | py | 438 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "views.HomePageView.as_view",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "views.HomePageView",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django... |
72265753383 | """covert_dataset.py
- demo: '../../demo/to-hf/convert_dataset.demo.ipynb'
"""
import os
import re
import json
import pandas as pd
def remove_java_comments(codedata: str) -> str:
"""remove comments in the java source code"""
codedata = re.sub(r"/\*(.*?)\*/", "", codedata, flags=re.MULTILINE | re.DOTALL)
c... | jalaxy33/PROMISE-dataset | preprocessed/src/to-hf/convert_dataset.py | convert_dataset.py | py | 7,027 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "re.sub",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "re.MULTILINE",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "re.DOTALL",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "re.sub",
"line_number": 1... |
41834816410 | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 15 15:09:57 2021
@author: ko-ko
"""
import os
import sys
import numpy as np
import openpyxl as pyxl
from scipy import interpolate as interp
import math
"""------------------------------------------------------------"""
""" ... | FlyingSheeps/airfoilplotter | airfoilplotter.py | airfoilplotter.py | py | 8,793 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.argv",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number... |
12126429354 | from email import message
from email.mime import text
from typing import Text
from cv2 import data
import pyttsx3
from requests.api import head, request #pip install pyttsx3
import speech_recognition as sr #pip install speechRecognition
import datetime
import wikipedia #pip install wikipedia
import webbrowse... | Lavya-Gohil/Jarvis | jarvis.py | jarvis.py | py | 27,563 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pyttsx3.init",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "speech_reco... |
21154413667 | #!/usr/bin/env python3
from bs4 import BeautifulSoup
import sys
import urllib.request
import os.path
import os
import smtplib
import time
class IPCheck:
def __init__(self):
self.oldIP = None
self.currentIP = None
self.logFile = os.getenv('HOME') + '/.ipcheck/log'
self.logDirectoryC... | optiseth/ipcheck | ipcheck.py | ipcheck.py | py | 2,708 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.getenv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 2... |
35102278935 | import csv
from itertools import chain
from typing import Optional
from src import PrioritizedCountryTokensList
def fix_tokens_list(tokens_list: PrioritizedCountryTokensList):
handmade_aliases = {
'united kingdom': ['uk'],
'united states': ['usa', 'new york', 'us', 'new jersey', 'denver, co', 'oh... | sergey-s-null/10s-BigDataEntrance | PythonScripts/util/location_mappings/3_merge.py | 3_merge.py | py | 3,036 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "src.PrioritizedCountryTokensList",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "itertools.chain",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "src.PrioritizedCountryTokensList",
"line_number": 31,
"usage_type": "name"
},
{
"... |
7060223293 | import tkinter as tk
from tkinter import ttk
from tkinter import filedialog as fd
from tkinter import simpledialog as sd
from tkinter import messagebox as mb
from tkinter import scrolledtext as st
from unittest import mock
from functools import reduce
from os import path
import textwrap as tw
import glob
import io
impo... | ceucomputing/automarker | automarker.py | automarker.py | py | 46,918 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "functools.reduce",
"line_number": 262,
"usage_type": "call"
},
{
"api_name": "textwrap.wrap",
"line_number": 622,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 624,
"usage_type": "call"
},
{
"api_name": "io.StringIO",
... |
24248570033 | import os
import sys
import datetime as dt
import numpy as np
G_WeekDays = ('MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN')
def dmy2Weekday(dmy):
return dt.datetime.strptime(str(dmy, encoding='utf-8'),
'%d-%m-%Y').date().weekday()
def ReadData(filename):
WeekDays, ClosingPr... | shtyi037/Python_practice | DATASCIENCE/weekdays.py | weekdays.py | py | 1,871 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.loadtxt",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy... |
74431933545 | # from the graphs, output metrics of dependency analysis.
# INPUT:
# folder_analysis (global variable, folder for analysis)
# folder_analysis/graph_set_per_domain.bin (output of 2_build_dependency.py)
# folder_analysis/graph_set_global.bin (output of 2_build_dependency.py)
# folder_analysis/domain_list.txt (use... | cess-pro/Domain_Relation | src/sf/3_analyze_dependency.py | 3_analyze_dependency.py | py | 7,500 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pickle.load",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "networkx.transitive_closure",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot... |
26287011843 | from unittest.mock import patch
import pytest
from deboiler import Deboiler
from deboiler.dataset import ListDataset
from deboiler.models.page import ParsedPage, RawPage
@pytest.mark.parametrize("operation_mode", ["memory", "performance"])
def test_pipeline_end_to_end(operation_mode):
# `parse_counter` defined ... | globality-corp/deboiler | deboiler/tests/test_operation_modes.py | test_operation_modes.py | py | 2,080 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "deboiler.models.page.ParsedPage",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "unittest.mock.patch.object",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "deboiler.models.page.RawPage",
"line_number": 26,
"usage_type": "argument"
}... |
34970482318 | import dbus
import os
import re
import time
import unittest
import six
import sys
import glob
from packaging.version import Version
import udiskstestcase
class UDisksLVMTestBase(udiskstestcase.UdisksTestCase):
@classmethod
def setUpClass(cls):
udiskstestcase.UdisksTestCase.setUpClass()
if n... | storaged-project/udisks | src/tests/dbus-tests/test_20_LVM.py | test_20_LVM.py | py | 42,717 | python | en | code | 302 | github-code | 36 | [
{
"api_name": "udiskstestcase.UdisksTestCase",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "udiskstestcase.UdisksTestCase.setUpClass",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "udiskstestcase.UdisksTestCase",
"line_number": 19,
"usage_typ... |
5559929525 | import requests
import json
import time
from pygame import mixer
#Enter your url here and enjoy your free offer!!
url = 'https://www.cricbuzz.com/match-api/21859/commentary.json'
f = 0
c = time.time()
while True:
try:
current_scorecard = requests.get(url).json()['score']['prev_overs']
except:
mixer.init()
mixe... | smit2k14/SWIGGY6 | SWIGGY6.py | SWIGGY6.py | py | 561 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "time.time",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.mixer.init",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_numb... |
42926700856 | from django.shortcuts import render
from patient.models import Patient
from .models import Need, Appointment
from .forms import AddNeedForm
def add_need(request, patient_number):
form = AddNeedForm(request.POST or None)
current_patient = Patient.objects.get(id=patient_number)
if form.is_valid():
n... | guillaume-guerdoux/tournee_infirmiers | tournee_infirmiers/event/views.py | views.py | py | 1,057 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "forms.AddNeedForm",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "patient.models.Patient.objects.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "patient.models.Patient.objects",
"line_number": 9,
"usage_type": "attribute"
},
{
... |
6689998525 | #!/usr/bin/env python3
import argparse
import os
import unittest
import testtools
import sys
PROJECT_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), os.path.pardir)
sys.path.append(PROJECT_DIR)
parser = argparse.ArgumentParser(description="Run tests.")
parser.add_argument("--deployment", choices=["aw... | spcl/serverless-benchmarks | tests/test_runner.py | test_runner.py | py | 1,892 | python | en | code | 97 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.realpath",
"line_n... |
15827619242 | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import *
import logging
import pymongo
import pickle
import numpy as np
import bson
im... | e-mission/e-mission-server | emission/storage/decorations/common_trip_queries.py | common_trip_queries.py | py | 4,875 | python | en | code | 22 | github-code | 36 | [
{
"api_name": "future.standard_library.install_aliases",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "future.standard_library",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "geojson.geometry",
"line_number": 17,
"usage_type": "attribute"
},
{
... |
16128993395 | import time
import asyncio
import tornado.web
import tornado.ioloop
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Hello, world\n")
class NonBlocking(tornado.web.RequestHandler):
async def get(self):
await asyncio.sleep(10)
class Blocking(tornado.web.RequestHandl... | czasg/ScrapyLearning | czaSpider/dump/tornado学习/test.py | test.py | py | 647 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "tornado.web.web",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "tornado.web",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "tornado.web.web",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "tornado.web",
... |
11316618459 | import pandas as pd
import datetime
import json
def date_to_week(d):
split_date = d.split('/')
return int(datetime.date(int(split_date[2]), int(split_date[0]), int(split_date[1])).strftime('%U'))
# Historical deaths data (and 2020, which will be overwritten where possible)
deaths = pd.read_csv('deaths_2020-06... | AdamHickerson/covid-19-deaths | corona2.py | corona2.py | py | 3,769 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.date",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"lin... |
17454665839 | import getpass
import os
import subprocess
from paramiko.client import SSHClient, AutoAddPolicy
from paramiko.config import SSHConfig
from .transfer import Transfer
class Connection(object):
host = None
original_host = None
user = None
port = None
ssh_config = None
connect_timeout = None
... | Yeolar/bunder | bunder/connection.py | connection.py | py | 5,335 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "getpass.getuser",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "paramiko.client.SSHClient",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "paramiko.client.AutoAddPolicy",
"line_number": 72,
"usage_type": "call"
},
{
"api_name"... |
30180533882 | #!/bin/env python3
import sys
import re
from functools import cache
def readfile(filename):
with open(filename) as f:
inp = f.read()
return inp
def step1(inp):
return recurse(inp, findwire(inp, 'a'))
def step2(inp, override):
inp = re.sub('.*-> b\n', f'{override} -> b\n', inp)
return step1(inp)
de... | reyemxela/adventofcode | 2015/07/main.py | main.py | py | 1,530 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "re.sub",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "functools.cache",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "sys.argv",
"line_number": 40,
... |
13050560084 | from __future__ import unicode_literals
"""Benchmark for SQLAlchemy.
An adaptation of Robert Brewers' ZooMark speed tests. """
import datetime
from sqlalchemy import Table, Column, Integer, Unicode, Date, \
DateTime, Time, Float, Sequence, ForeignKey, \
select, join, and_, outerjoin, func
from sqlalchemy.t... | lameiro/cx_oracle_on_ctypes | test/integration/3rdparty/SQLAlchemy-1.0.8/test/aaa_profiling/test_zoomark.py | test_zoomark.py | py | 15,649 | python | en | code | 20 | github-code | 36 | [
{
"api_name": "sqlalchemy.testing.replay_fixture.ReplayFixtureTest",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "sqlalchemy.testing.replay_fixture",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Table",
"line_number": 47,
"usage_t... |
14696985443 | from datasets import load_dataset
import matplotlib.pyplot as plt
rated_KoRAE = load_dataset("Cartinoe5930/KoRAE_rated", split="train")
score_result = {}
x_label = []
for i in range(0, 21):
score_result[i * 0.5] = 0
x_label.append(i * 0.5)
for data in rated_KoRAE:
score_result[float(data["score"])] += 1
... | gauss5930/KoRAE | rating/score_plot.py | score_plot.py | py | 630 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datasets.load_dataset",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "matpl... |
44008094218 | # Basic idea:
# Physicsy sandy sand (pixel-perfect collisions, run simulation to keep up with real time)
# Character moving around
# Tap direction (WASD) to choose stuff to pick up, tap next to throw
# Hold direction to choose stuff to morph, press other keys to morph it
import pygame
from pygame.locals import *
impo... | ninjafrostpn/PythonProjects | Bending/Bending 3.py | Bending 3.py | py | 5,219 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.init",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.int32",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pygame.Surface",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
... |
42088370430 | from src.depth_transform import *
from src.audio_transform import *
from PIL import Image
import matplotlib.pyplot as plt
import numpy as np
from src.dataset_utils import _load_audio_file
MAX_DEPTH = 10000
MIN_DEPTH = 0.0
def test_depth_arr(depth):
params = {"max_depth": 10000}
depth = transform_depth(depth, ... | Hadiaz1/Batvision-tf | tests/data_tests.py | data_tests.py | py | 1,376 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "PIL.Image.open",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "numpy.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "PIL.Image.fromarray",
"line_n... |
14547146966 | import os
from pprint import pprint
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
from app_ml.functionalities.constants import SPARK_WINDOW, MONGO_URL, WINDOW, SAVED_MODEL_PATH, POSTGRES_URL
from app_ml.functionalities.preprocessing import create_test_set
from app_ml.models.RNN import RNN
from sqlalchemy import create_eng... | serapan/DrEYEve | app_ml/data/insert_data_to_postgres.py | insert_data_to_postgres.py | py | 3,331 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.environ",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "app_ml.functiona... |
3125630169 | from sklearn.ensemble import GradientBoostingRegressor
from sklearn.model_selection import GridSearchCV
import catboost as cb
import xgboost as xgb
import pandas as pd
def gradientBoost(X,y):
gboost=GradientBoostingRegressor(random_state=11)
params={'max_depth':[1,2,3],'n_estimators':[100,300,500,1000]}
se... | aamir09/DS2Project | PartB/models/boosting.py | boosting.py | py | 1,456 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "sklearn.ensemble.GradientBoostingRegressor",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.GridSearchCV",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "catboost.CatBoostRegressor",
"line_number": 16,
"usage_typ... |
29376670360 | import time
import unittest
from datetime import datetime
from typing import Tuple
from flask.testing import FlaskClient
from flask_socketio import SocketIOTestClient
from sqlalchemy import select
from app import db
from app import make_app
from app import socket_io
from app.authentication.models import chats, User
f... | dmytro-afanasiev/flask-simple-chats | tests/test_socketio_events.py | test_socketio_events.py | py | 15,296 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "app.make_app",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "app.config.TestConfig",
"line_number": 21,
"usage_type": "argument"
},
{
"api_name": "app.aut... |
43165056383 | #from osgeo import gdal, osr, ogr # Python bindings for GDAL
import numpy as np
import matplotlib.pyplot as plt
import sys
import os
import pickle
import json
from rlxutils import subplots
from .utils import pimshow
class Chipset:
def __init__(self, chipset_folder=None, data=None, metadata=None):
sel... | VMBoehm/SAR-landslide-detection-pretraining | src/datamodules/components/chips.py | chips.py | py | 13,357 | python | en | code | 25 | github-code | 36 | [
{
"api_name": "os.listdir",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random.randint",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "numpy.load",
"l... |
23099937336 | import os
import sys
import urllib.request
import urllib.parse
import datetime
import time
import json
client_id ='GWWUHPgV0uguJWvgsMFu'
client_secret = 'slKycSCDf4'
# url 접속 요청 후 응답리턴함수
def getRequestUrl(url):
req = urllib.request.Request(url)
req.add_header("X-Naver-Client-Id", client_id)
req.add_hea... | omago123/StudyBigData | day01/naverCrawler.py | naverCrawler.py | py | 2,636 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "urllib.request.request.Request",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 17,
"usage_type": "name"
},
{
"api_nam... |
21683733200 | #!/usr/bin/env python3
import numpy as np
import networkx as nx
import logging
import collections
import os
import math
try:
from PySide2 import QtGui, QtCore
except ImportError:
from PySide6 import QtGui, QtCore
from functools import lru_cache
from origami.core.predict import PredictorType
from origami.core.neig... | poke1024/origami | origami/batch/annotate/utils.py | utils.py | py | 11,088 | python | en | code | 69 | github-code | 36 | [
{
"api_name": "PySide6.QtGui.QColor.fromHsv",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "PySide6.QtGui.QColor",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "PySide6.QtGui",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "... |
5187515239 | from django.urls import path
from.import views
app_name ="hospital"
urlpatterns = [
path('',views.index,name="index"),
path('about',views.about,name="about"),
path('contact',views.contact,name="contact"),
path('appointment',views.appointment,name="appointment"),
path('doctorprofile',views.doctorpr... | pythonhere/web | hospital/urls.py | urls.py | py | 1,823 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
26763695977 | import logging
import pandas as pd
import numpy as np
from .mapping import big_map, pivot_result_to_one_map
from .group_columns import full_id_vars, lateralisation_vars
from .melt_then_pivot_query import melt_then_pivot_query
# main function is QUERY_LATERALISATION
def gifs_lat(gif_lat_file):
"""
factor fu... | thenineteen/Semiology-Visualisation-Tool | mega_analysis/crosstab/mega_analysis/QUERY_LATERALISATION_GLOBAL.py | QUERY_LATERALISATION_GLOBAL.py | py | 19,998 | python | en | code | 9 | github-code | 36 | [
{
"api_name": "pandas.options",
"line_number": 102,
"usage_type": "attribute"
},
{
"api_name": "logging.debug",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "logging.debug",
"line_number": 118,
"usage_type": "call"
},
{
"api_name": "group_columns.late... |
12991191723 | import os
from telegram.ext import Updater
from telegram.error import BadRequest, Unauthorized
TOKEN = os.environ.get('TELEGRAM_TOKEN')
updater = Updater(token=TOKEN)
bot = updater.dispatcher.bot
def send_message(chat_id: int, text: str):
try:
bot.send_message(chat_id=chat_id, text=text)
return T... | OpenSUTD/evs-notifications | apis/telemsg/src/bot.py | bot.py | py | 456 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.environ.get",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "telegram.ext.Updater",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "telegram.error.BadRe... |
20298727355 | from flask import Flask, render_template, request, redirect, url_for, flash
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///weight.db'
db = SQLAlchemy(app)
class WeightEntry(db.Model):
id = db.Column(db.Integer, primary_key=True)
weight = db.Col... | kozhydlo/Weight-tracking | main.py | main.py | py | 1,176 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.req... |
19415250824 | import azureml.core
from azureml.core import Workspace, Experiment
from azureml.core.authentication import ServicePrincipalAuthentication
from azureml.core.compute import ComputeTarget, DatabricksCompute
from azureml.exceptions import ComputeTargetException
from azureml.pipeline.steps import PythonScriptStep
from azure... | jomit/SecureAzureMLWorkshop | aml_pipeline/build_pipeline.py | build_pipeline.py | py | 4,596 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "azureml.core.authentication.AzureCliAuthentication",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "azureml.core.Workspace",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "azureml.core.runconfig.RunConfiguration",
"line_number": 34,
"u... |
72502764263 | import itertools
import math
import pickle
from collections import defaultdict,Counter
import collections
import copy
import spacy
from spacy.lang.en.stop_words import STOP_WORDS
Q = 'Los The Angeles Boston Times Globe Washington Post'
DoE = {'Los Angeles Times':0, 'The Boston Globe':1,'The Washington Post':2, 'Star Tr... | Xin1896/COMP6714 | proj1-partA/test3.py | test3.py | py | 1,707 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "collections.Counter",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "col... |
18362653657 | """
Class containing the display of the Chip8 emulator.
"""
import pygame
class Chip8Display:
def __init__(self, width, height, scale=10):
###########################
# CONSTANTS
###########################
self.BG_COLOR = (0, 0, 0)
self.MAIN_COLOR = (255, 255, 255)
... | trd-db/PyChip8 | chip8/Chip8Display.py | Chip8Display.py | py | 4,194 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.display.set_mode",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.update",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "pyg... |
5536685399 | import json
import os
import pathlib
import sys
from PyQt5 import QtCore, QtGui
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtGui import QFontDatabase
from PyQt5.QtWidgets import *
import Globals
def Log(*args):
# 0 Non Issue
# 1 Minor Issue
# 2 Non Essential issue
# 3 Essential ... | AntCDev/Another-Chance | main.py | main.py | py | 21,012 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtGui.QFontDatabase.addApplicationFont",
"line_number": 40,
"usage_type": "call"
},
{
... |
74424262825 | import pandas as pd
import urllib.request
import bs4 as bs
import re
class Movie_Titles:
def __init__(self, movie_df, refresh_on_start, engine):
self.df = movie_df
self.refresh_on_start = refresh_on_start
self.engine = engine
def get_titles(self):
"""Obtain the titles of the mo... | chiaracapuano/WhatToWatch | docker_files/update-database/Movies_Titles.py | Movies_Titles.py | py | 1,707 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.DataFrame",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "urllib.request.request.urlopen",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_n... |
31471841488 | from typing import Optional
import pytest
from robotoff.insights.ocr.label import LABELS_REGEX
XX_BIO_XX_OCR_REGEX = LABELS_REGEX["xx-bio-xx"][0]
ES_BIO_OCR_REGEX = LABELS_REGEX["xx-bio-xx"][1]
@pytest.mark.parametrize(
"input_str,is_match,output",
[
("ES-ECO-001-AN", True, "en:es-eco-001-an"),
... | alexouille123/robotoff | tests/insights/ocr/test_label.py | test_label.py | py | 727 | python | en | code | null | github-code | 36 | [
{
"api_name": "robotoff.insights.ocr.label.LABELS_REGEX",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "robotoff.insights.ocr.label.LABELS_REGEX",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 20,
"usage_type": "name"... |
73313411305 | # -*- coding: utf-8 -*-
# @Time : 2022 09
# @Author : yicao
import csv
import os
import time
import numpy as np
import torch
import math
from utils import log_util
class RecordTest:
def __init__(self, log_file, test_file):
self.log_file = log_file
self.test_file = test_file + ' test.csv'
... | zhengLabs/FedLSC | utils/record_util.py | record_util.py | py | 10,384 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "csv.writer",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.max",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "utils.log_util.log",
"line_number... |
16636179375 | from torch.nn import BCEWithLogitsLoss
from pytorch_toolbelt import losses as L
import numpy as np
import torch
import matplotlib.pyplot as plt
def main():
losses = {
"bce": BCEWithLogitsLoss(),
# "focal": L.BinaryFocalLoss(),
# "jaccard": L.BinaryJaccardLoss(),
# "jaccard_log": L... | BloodAxe/pytorch-toolbelt | demo/demo_losses.py | demo_losses.py | py | 1,750 | python | en | code | 1,447 | github-code | 36 | [
{
"api_name": "torch.nn.BCEWithLogitsLoss",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pytorch_toolbelt.losses.JointLoss",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pytorch_toolbelt.losses",
"line_number": 19,
"usage_type": "name"
},
{
... |
34678033656 | import logging
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.stream import HLSStream
log = logging.getLogger(__name__)
@pluginmatcher(
re.compile(r"https?://(?:www\.)?auftanken\.tv/livestream/?")
)
class AuftankenTV(Plugin):
_hls_url_re = re.compile(r"(https://.+?/http_adapti... | oe-mirrors/streamlink-plugins | auftanken.py | auftanken.py | py | 753 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "streamlink.plugin.Plugin",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "re.compile",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "streamlink.strea... |
10476978002 | # main_before.py
# 강화학습 전에 실행하는 모듈
# 주식 데이터를 읽고, 차트 데이터와 학습 데이터를 준비하고, 주식투자 강화학습을 실행하는 모듈
import os
import logging
import settings
import datetime
from data import data_management, save_csv
from learner import Learner
def main_before_run(before_start_date, before_end_date, before_min_unit,
before_... | 100th/AjouStock | main_before.py | main_before.py | py | 3,938 | python | ko | code | 23 | github-code | 36 | [
{
"api_name": "data.save_csv.load_skyrocket_list",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "data.save_csv",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path"... |
15443990274 | #!/usr/bin/python3.1
# anti-docx, a .docx-to-text converter written by Albin Stjerna
#
# Please, feel free to do what you want with this code. It is way too short
# for a proper license. :)
import zipfile, sys, textwrap
from xml.sax import parse, ContentHandler
from optparse import OptionParser
def extract_document(fn... | amandasystems/anti-docx | anti-docx.py | anti-docx.py | py | 2,244 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "zipfile.ZipFile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "xml.sax.ContentHandler",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "xml.sax.parse",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "optparse.OptionP... |
73609824105 | import os
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import shutil
import tikzplotlib
from cued.plotting.colormap import whitedarkjet
from cued.plotting import contourf_remove_white_lines, label_inner, init_matplotlib_config, unit... | ccmt-regensburg/CUED | cued/plotting/latex_output_pdf.py | latex_output_pdf.py | py | 32,799 | python | en | code | 11 | github-code | 36 | [
{
"api_name": "cued.plotting.init_matplotlib_config",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "shutil.which",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.system... |
5127076250 | # coding:utf-8
import numpy as np
from chainer import cuda, Function, gradient_check, report, training, utils, Variable
from chainer import datasets, iterators, optimizers, serializers
import chainer.functions as F
import chainer.links as L
import sys
import argparse
import _pickle as pickle
import MeCab
from LSTM imp... | SPJ-AI/lesson | text_generator/generate.py | generate.py | py | 2,202 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "chainer.cuda.cupy",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "chainer.cuda",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "MeCab.Tag... |
16930492443 | import aiosqlite
from datetime import datetime
DB = 'db.sqlite'
async def search_db_entry(user_id, type, kind, location, distance):
curdate = str(datetime.now().strftime('%Y%m%d'))
query = f"SELECT * FROM geteilt where expires_at > {curdate}"
query += f" AND user_id <> {user_id}"
if type != 'all':
... | subkultur/teilwas_bot | tw_db.py | tw_db.py | py | 6,545 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "aiosqlite.connect",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "aiosqlite.con... |
6848009196 | from django.shortcuts import render, redirect
from users.forms import CustomUserCreationForm, CustomUserChangeForm
from django.contrib.auth.decorators import login_required
from users.models import CustomUser
# Create your views here.
@login_required(login_url='/login/')
def home(request):
"""show users view"""
... | sistematizaref/lecesse | lecesse/users/views.py | views.py | py | 1,771 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "users.forms",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "users.models.CustomUser.objects.all",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "users.models.CustomUser.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
... |
13880556989 | #!/usr/bin/python3
# -*- coding:utf-8 -*-
import sys
import os
from configparser import ConfigParser
import time
from ctypes import *
import logging
import time
from PIL import Image,ImageDraw,ImageFont
import traceback
import calendar
import datetime
from datetime import date
from dateutil.parser import parse
from dat... | f1ynng8/omnifocus-eink | raspberrypi/daemon.py | daemon.py | py | 10,089 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "calendar.setfirstweekday",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.pa... |
33161621406 | import csv
from scipy.interpolate import interp1d
from typing import Dict
def app() -> None:
# Separated govt bonds and c bonds because calculating benchmark yield spread
# checks 1 corporate bond against all govt bonds
f_name = input("csv name (with.csv): ")
g_bonds, c_bonds = load_csv(f_name)
p... | shermansjliu/overbond-dev-test-submission | app.py | app.py | py | 3,333 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "csv.DictReader",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "scipy.interpolate.interp1d",
"line_number": 97,
"usage_type": "call"
}
] |
9817545855 | from PyQt5 import QtGui
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QWidget
import ResourceNavigator
from back.css.style import cssLoader
from back.osuLoader.AppBackend import AppBackendInit
from view.window.osuLoader.layout.OsuLoaderWindowLayout import OsuLoaderWindowLayout
class OsuLoaderWindow(QWidg... | animousen4/osuLoader-2.0 | view/window/osuLoader/OsuLoaderWindow.py | OsuLoaderWindow.py | py | 1,590 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "view.window.osuLoader.layout.OsuLoaderWindowLayout.OsuLoaderWindowLayout",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "back.osuLoader.AppBackend.AppBackendInit",
"... |
20255004169 | from blog_api import api
from flask import json
def test_blog_post():
# Post method test for blog posting
# It includes data and check response out
response = api.test_client().post(
'/api/post',
data=json.dumps({'title': '1', 'body': '2', 'author': '3'}),
content_type='appl... | hebertsonm/blog-assignment | pytest.py | pytest.py | py | 1,650 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "blog_api.api.test_client",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "blog_api.api",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "flask.json.dumps",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.json",
... |
11920060681 | import random, hashlib
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
from cryptography.x509.oid import NameOID
from playground.common import CipherUtil
from ..contants import PATH_PREFIX
class CertFactory(object):
... | Pandafriendd/peep | src/factory/CertFactory.py | CertFactory.py | py | 1,996 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "contants.PATH_PREFIX",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "cryptography.hazmat.primitives.serialization.load_pem_private_key",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cryptography.hazmat.primitives.serialization",
"line_n... |
36531588851 | # The Purpose of the app: track what movies the user has watched and the order
# in which the user has watched them.
import sys
import os
home = os.path.expanduser("~")
desktop_rel_path = '/Desktop/MOOC_work/udemy/complete_python_and_postgres_dev_course/section6_movie_system'
if home + desktop_rel_path not in sys.path... | BrandonHoeft/mooc-work | udemy/complete_python_and_postgres_dev_course/section6_movie_system/app.py | app.py | py | 2,405 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.expanduser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.path.insert",
"lin... |
17164740168 | from sqlite3 import Error as sqliteError
from sqlite3 import OperationalError as sqliteOperationalError
from loggingSystem import LoggingSystem
import sqlite3,sys,os,time
from typing import Union
class ProcessamentoSqlite:
def __init__(self,sqlite_db="./initial_db.db",sql_file_pattern="scripts/sqlitePattern.sql", ... | mzramna/algoritimo-de-testes-de-benchmark-de-bancos-de-dados | scripts/processamentoSqlite.py | processamentoSqlite.py | py | 7,284 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "loggingSystem.LoggingSystem",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.i... |
5234262149 | from .models import User
from django.conf import settings
from django.templatetags import static
from rest_framework import serializers
class UserSerializer(serializers.ModelSerializer):
avatar = serializers.SerializerMethodField()
class Meta:
model = User
fields = (
'username',
... | Zomba4okk/MyMovies | backend/apps/users/serializers.py | serializers.py | py | 930 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.SerializerMethodField",
"line_number": 9,... |
33214014538 | import torch
import torch.nn.functional as F
from torch.autograd import Variable
import torch.nn as nn
# Credict: https://github.com/kefirski/pytorch_Highway
class Highway(nn.Module):
def __init__(self, size, num_layers, f):
super(Highway, self).__init__()
self.num_layers = num_layers
se... | dwaydwaydway/KKStream-Deep-Learning-Workshop | Model.py | Model.py | py | 3,619 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.nn.ModuleList",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
15974646573 | # *-* coding: utf-8 *-*
"""
Created on dim 07 fév 2021 09:27:34 UTC
@author: vekemans
"""
import time
import math as mt
import numpy as np
import scipy.sparse as spr
import matplotlib.pyplot as plt
nfig = 1
pi = mt.pi
# -----------------------------------------------
# Orginal Signal
N = np.power(2,12)
h = 2*pi / ... | abbarn/lmeca2300 | homeworks/p1.py | p1.py | py | 1,733 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "math.pi",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "numpy.power",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": ... |
12522230634 | from hmac import new
import streamlit as st
import pandas as pd
from google.cloud import bigquery
import pandas_gbq
from datetime import datetime, timedelta
import yagmail
import os
st.set_page_config(layout="wide")
days_mapping = {
'Monday': 'lunedì',
'Tuesday': 'martedì',
'Wednesday': 'mercoledì',
'... | davins90/editable_table | prod/app.py | app.py | py | 3,761 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "streamlit.markdown",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pandas_g... |
19090035035 | from datetime import datetime
from ueaglider.data.db_session import create_session
from ueaglider.data.db_classes import Pins, Audit, Missions, Targets, Gliders, Dives, ArgosTags
from ueaglider.services.argos_service import tag_info
from ueaglider.services.glider_service import glider_info
from ueaglider.services.user... | ueaglider/ueaglider-web | ueaglider/services/db_edits.py | db_edits.py | py | 4,822 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "ueaglider.data.db_session.create_session",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "ueaglider.data.db_classes.Pins",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "ueaglider.data.db_classes.Pins.WaypointsID",
"line_number": 14,
... |
8000518173 | import numpy as np
from numpy import linalg
from scipy import sparse
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
def read_dataset(path: str):
with open(path, 'r') as f:
lines = f.readlines()
x = np.zeros([len(lines), 123])
y = np.zeros([len(lines)])
fo... | LyricZhao/IRLS | main.py | main.py | py | 2,358 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.zeros",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 26,
... |
39366464180 | import numpy as np
import tensorflow as tf
import datetime
n = 10
A = np.random.rand(10000, 10000).astype('float32')
B = np.random.rand(10000, 10000).astype('float32')
c1 = []
c2 = []
def matpow(M, n):
if n == 1:
return M
else:
return tf.matmul(M, matpow(M, n-1))
with t... | PacktPublishing/Deep-Learning-with-TensorFlow-Second-Edition | Chapter07/gpu/gpu_example.py | gpu_example.py | py | 1,141 | python | en | code | 48 | github-code | 36 | [
{
"api_name": "numpy.random.rand",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.rand",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
73049130343 | from collections import UserDict
from datetime import datetime
from datetime import timedelta
class CacheDict(UserDict):
times = {}
def __init__(self, dict={}, keytime=60, **kwargs):
super().__init__(dict, **kwargs)
self.keytime = keytime
def __getitem__(self, key):
if not sel... | desk467/moto | moto/cache.py | cache.py | py | 718 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "collections.UserDict",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "datetime.... |
33520209237 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
' hipnuc protocol module '
import threading
import struct
import datetime
import time
class HipnucFrame_Exception(Exception):
def __init__(self,err='HI221GW Frame Error'):
Exception.__init__(self,err)
class HipnucFrame_NoValid_Exception(HipnucFrame_Exceptio... | hipnuc/products | examples/Python/hipnuc_protocol.py | hipnuc_protocol.py | py | 21,962 | python | en | code | 56 | github-code | 36 | [
{
"api_name": "struct.unpack",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "struct.unpack",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "struct.unpack",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "struct.unpack",
"line_n... |
17751518002 | from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
import copy
import json
import os
SPLITS = ["train", "dev", "devtest", "teststd"]
def get_image_name(scene_ids, turn_ind):
"""Given scene ids and turn index, get the image name.
"""
sorted_scene_ids = sor... | facebookresearch/simmc2 | model/ambiguous_candidates/format_ambiguous_candidates_data.py | format_ambiguous_candidates_data.py | py | 4,414 | python | en | code | 98 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 48... |
23280705402 | '''
Description:
Author: weihuang
Date: 2021-11-18 15:47:44
LastEditors: weihuang
LastEditTime: 2021-11-22 22:38:26
'''
import torch
import torch.nn.functional as F
import torch.nn as nn
from torch.autograd import Variable
class CrossEntropy2d(nn.Module):
def __init__(self, reduction="mean", ignore_label=255):
... | weih527/DA-ISC | scripts/loss/loss.py | loss.py | py | 3,347 | python | en | code | 14 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torch.autograd.Variable",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "torch.zeros",
... |
13421938791 | import os
import io
import re
import sys
import pandas as pd
import ujson as json
from argparse import ArgumentParser, FileType
from rasm import rasm
RULE_GROUPS = {
'ASSIM-M': ['M1', 'M2'],
'ASSIM-N': ['N2.1.1.A', 'N2.1.1.B', 'N2.1.1.C', 'N2.1.1.D', 'N2.1.2.A', 'N2.1.2.B', 'N2.1.2.C', 'N2.1.2.D', 'N2.2.A', ... | kabikaj/tajweed | src/tajweed2df.py | tajweed2df.py | py | 5,564 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "argparse.FileType",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "ujson.load",... |
24222891293 | import numpy as np
from collections import namedtuple
from abc import ABCMeta, abstractmethod, abstractstaticmethod
# 决策树结点
# Parameters
# ----------
# feature : 特征,需要进行比对的特征名
# val : 特征值,当特征为离散值时,如果对应的特征值等于val,将其放入左子树,否则放入右子树
# left : 左子树
# right : 右子树
# label : 所属的类
TreeNode = namedtuple("TreeNode", 'feature val lef... | samzzyy/RootCauseAnalysisOfProductionLineFailure | PathAna/DT_IV2.py | DT_IV2.py | py | 5,356 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "collections.namedtuple",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"l... |
25099906773 | import ast
import re
import tokenize
import unicodedata
from sympy.parsing import sympy_parser
from sympy.core.basic import Basic
#####
# Process Unicode characters into equivalent allowed characters:
#####
# Unicode number and fraction name information:
_NUMBERS = {"ZERO": 0, "ONE": 1, "TWO": 2, "THREE": 3, "FOUR"... | isaacphysics/equality-checker | checker/parsing/utils.py | utils.py | py | 18,953 | python | en | code | 7 | github-code | 36 | [
{
"api_name": "unicodedata.name",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "ast.Lt",
"line_number": 91,
"usage_type": "attribute"
},
{
"api_name": "ast.LtE",
"line_number": 91... |
41076588706 | import os
import zipfile
def unzip(filename: str, extract_to: str) -> None:
"""
This method run unzip a file to specified path
:param filename: Path/filename of zip file
:param extract_to: Path with name of output folder
:return: None
"""
this_folder = os.path.dirname(os.path.abspath(... | samuelterra22/Analysis-of-antenna-coverage | src/main/python/support/extract_zip_file.py | extract_zip_file.py | py | 466 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
15478667002 | import numpy as np
import glog
import pandas as pd
import os
import gzip
def export_roi_gene(file_path: str, roi: list):
"""
Args:
file_path: path of gene file
roi: [x0, y0, w, h]
Returns: None
"""
if file_path.endswith('.gz'):
f = gzip.open(file_path, 'rb')
else: f = ... | BGIResearch/StereoCell | scripts/utils.py | utils.py | py | 2,150 | python | en | code | 18 | github-code | 36 | [
{
"api_name": "gzip.open",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "glog.info",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.uint32",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "numpy.uint32",
"line_number... |
7661874071 | from django.template import Library
from hx_lti_initializer.models import LTIProfile
register = Library()
@register.filter_function
def list_of_possible_admins(already_in_course):
list_of_usernames_already_in_course = []
list_of_unique_names = []
result = []
for profile in LTIProfile.objects.all():
... | lduarte1991/hxat | hx_lti_initializer/templatetags/possible_admins.py | possible_admins.py | py | 780 | python | en | code | 11 | github-code | 36 | [
{
"api_name": "django.template.Library",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "hx_lti_initializer.models.LTIProfile.objects.all",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "hx_lti_initializer.models.LTIProfile.objects",
"line_number": 13,
... |
15943063220 | import numpy as np
from scipy.special import factorial
ident = 'dick6D'
d = 6
title_plot = r'$f_6(u)=\left(\prod_{i=2}^6 u_i^{i-1} \right) \exp\left\{\prod_{i=1}^6 u_i\right\}$'
mat_folder = 'simuDick/d6'
true_val = np.exp(1.) - np.sum(1. / factorial(np.arange(6)))
orders = [1, 2, 4, 6, 8]
min_neval = 100
max_neval = ... | nchopin/cubic_strat | nonvanish_xp/dick6D.py | dick6D.py | py | 475 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.exp",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "scipy.special.factorial",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_num... |
1889257914 | '''
Created on 08.02.2016.
@author: Lazar
'''
from concepts.row import Row
from textx.exceptions import TextXSemanticError
class View(object):
basic_type_names = ['text', 'number', 'checkbox', 'link',
'email', 'password', 'menuitem', 'menu',
'button', 'radio', 'for... | lazer-nikolic/GenAn | src/concepts/view.py | view.py | py | 2,115 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "concepts.row.Row",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "textx.exceptions.TextXSemanticError",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "concepts.row.Row",
"line_number": 46,
"usage_type": "call"
}
] |
4107020337 | import sys
from collections import deque
input = sys.stdin.readline
def check(a, b, size):
return 0 == psa[a + size - 1][b + size - 1] - psa[a - 1][b + size - 1] - psa[a + size - 1][b - 1] + psa[a - 1][b - 1]
moves = ((1, 0), (0, 1), (-1, 0), (0, -1))
n, m = [int(x) for x in input().split()]
psa = [[0] * (m + 1... | AAZZAZRON/DMOJ-Solutions | aac2p3.py | aac2p3.py | py | 1,238 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 25,
"usage_type": "call"
}
] |
73360145384 | # django imports
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth.decorators import permission_required
from django.core.urlresolvers import reverse
from django.db import IntegrityError
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.... | django-lfs/lfs | manage/views/product/properties.py | properties.py | py | 5,016 | python | en | code | 23 | github-code | 36 | [
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "lfs.catalog.models.Product",
"line_number": 22,
"usage_type": "argument"
},
{
"api_name": "lfs.catalog.models.ProductPropertyValue.objects.get",
"line_number": 31,
... |
370424566 | from selenium import webdriver
from amazon_pages.home_page import HomePage
def test__amazon():
""" Go to book_page categorie, add first item to cart, change quantity to 2"""
driver = webdriver.Chrome()
home = HomePage(driver)
cart_page = home.accept_cookie()\
.open_all_book()\
.select... | ClemiDouce/TP-pageobject | test_amazon.py | test_amazon.py | py | 450 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "amazon_pages.home_page.HomePage",
"line_number": 9,
"usage_type": "call"
}
] |
32879521112 | from matplotlib import pyplot as plt
def visualize(flight):
altitude = [t.position.y for t in flight]
velocity = [t.velocity.y for t in flight]
time = list(range(len(flight)))
plt.figure()
plt.subplot(211)
plt.xlabel("Time (secs)")
plt.ylabel("Altitude(m)")
plt.plot(time, altitude)
... | mirman-school/hoc-rocketflight | visualizer.py | visualizer.py | py | 442 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.subplot",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "mat... |
6791731710 | """
Class for acting as a server inside of a simpy simulation. This server is nothing
more than a resource with some additional patches.
@author Tycho Atsma <tycho.atsma@gmail.com>
@file lib/Server.py
"""
# dependencies
from simpy import PreemptiveResource
from numpy.random import exponential, uniform
class Serve... | miloshdrago/discrete-event-simulation-ing | app/lib/Server.py | Server.py | py | 4,703 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "simpy.PreemptiveResource",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "numpy.random.exponential",
"line_number": 139,
"usage_type": "call"
}
] |
37005905790 | from pathlib import Path
import pytest
from helpers.regression import verify_output
RINOH_PATH = Path(__file__).parent / 'rinoh'
OUTPUT_PATH = Path(__file__).parent / 'output'
def test_version(script_runner):
ret = script_runner.run('rinoh', '--version')
assert ret.success
assert ret.stderr == ''
de... | Chris-Jr-Williams/rinohtype | tests_regression/test_rinoh.py | test_rinoh.py | py | 1,189 | python | en | code | null | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "helpers.regression.verify_output... |
27662925156 | """"
MeGaNeKo 2022 - https://github.com/MeGaNeKoS/Discord-Bot-Template
Description:
This is a template to create your own discord bot in python.
Version: 1.0
"""
import logging
class STDERRLogger:
def __init__(self):
self.logger = logging.getLogger("STDERR")
formatter = logging.Formatter('%(leveln... | MeGaNeKoS/Discord-Bot-Template | utils/sys_logger.py | sys_logger.py | py | 933 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.FileHandler",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.Strea... |
30502653408 | from collections import defaultdict
f = open('/Users/moishe/src/aoc-21/day-10/input/input.txt')
xlat_closer = {
'>': '<',
']': '[',
'}': '{',
')': '('
}
score_lookup = {
')': 3,
']': 57,
'}': 1197,
'>': 25137
}
counters = defaultdict(int)
score = 0
for l in f:
l = l.rstrip()
current_open = []
... | Moishe/aoc-21 | day-10/part-1.py | part-1.py | py | 640 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.defaultdict",
"line_number": 19,
"usage_type": "call"
}
] |
72178607465 |
import falcon
from math import sqrt
from wsgiref.simple_server import make_server
class Calc():
def on_get(self, req, resp):
qs = req.params
resp.body = "Waiting for input\n"
resp.status = falcon.HTTP_200
def on_post(self, req, resp):
chunk = req.stream.read(4096)
val... | Lovelykira/Microservices | DBServer/db_server.py | db_server.py | py | 1,388 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "falcon.HTTP_200",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "falcon.HTTP_200",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "math.sqrt",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"... |
32752187332 | from multiprocessing import Pool
from argparse import ArgumentParser
from tbselenium.tbdriver import TorBrowserDriver
from tbselenium.utils import launch_tbb_tor_with_stem
from tbselenium.common import STEM_SOCKS_PORT, USE_RUNNING_TOR,\
STEM_CONTROL_PORT
JOBS_IN_PARALLEL = 3
def run_in_parallel(inputs, worker, n... | webfp/tor-browser-selenium | examples/parallel.py | parallel.py | py | 1,379 | python | en | code | 483 | github-code | 36 | [
{
"api_name": "multiprocessing.Pool",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tbselenium.tbdriver.TorBrowserDriver",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tbselenium.common.STEM_SOCKS_PORT",
"line_number": 19,
"usage_type": "name"
}... |
18913990683 | from collections import deque
def neighbors(position: tuple[int, int, int]) -> list[tuple[int, int, int]]:
x, y, step = position
return [
(x + 1, y, step + 1),
(x - 1, y, step + 1),
(x, y + 1, step + 1),
(x, y - 1, step + 1),
]
class Solution:
def nearestExit(self, ma... | lancelote/leetcode | src/nearest_exit_from_entrance_in_maze.py | nearest_exit_from_entrance_in_maze.py | py | 1,325 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 28,
"usage_type": "name"
}
] |
35866822598 | import sys,os
import gmsh
import numpy as np
from mpi4py import MPI
import dolfinx
dir = os.path.dirname(__file__)
gmsh.initialize()
lc = 0.2
num_airfoil_refinement = 100
L = 4
H = 1
gdim = 2
"""
Defining the shape of the airfoil using Bézier Curves
Geometrical parameters of the airfoil according to ... | niravshah241/MDFEniCSx | demo/3_airfoil_displacement/mesh_data/mesh.py | mesh.py | py | 6,178 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "gmsh.initialize",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_n... |
11473308179 | from typing import Optional, Union
import numpy as np
import pandas as pd
from lightfm import LightFM
from lightfm.evaluation import precision_at_k
from scipy import sparse as sps
from .base import BaseRecommender
class FMRecommender(BaseRecommender):
"""FM recommender based on `LightFM`.
Args:
int... | smartnews/rsdiv | src/rsdiv/recommenders/fm.py | fm.py | py | 1,837 | python | en | code | 7 | github-code | 36 | [
{
"api_name": "base.BaseRecommender",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "typing.Optional",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "pandas.Dat... |
8670554139 | import logging
from cterasdk import CTERAException
def unsuspend_filer_sync(self=None, device_name=None, tenant_name=None):
"""Unsuspend sync on a device"""
logging.info("Starting unsuspend sync task.")
try:
device = self.devices.device(device_name, tenant_name)
device.sync.unsuspend()
... | ctera/ctools | unsuspend_sync.py | unsuspend_sync.py | py | 480 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "logging.info",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.warning",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.error",
"line_nu... |
32860540539 | from django.http import HttpResponse
from django.shortcuts import render,redirect
from django.contrib.sites.shortcuts import get_current_site
from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode
from django.utils.encoding import force_bytes, force_text
from django.template.loader import render_to_... | chandrika-gavireddy/Django-Email_Verfication_while_RegisteringUser | accounts/views.py | views.py | py | 2,581 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "forms.SignUpForm",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.contrib.sites.shortcuts.get_current_site",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.template.loader.render_to_string",
"line_number": 22,
"usage_type... |
35022463878 | # -*- coding: utf-8 -*-
"""
Authors: Ioanna Kandi & Konstantinos Mavrogiorgos
"""
# code
import numpy as np
import pandas as pd
import sklearn
import matplotlib.pyplot as plt
import seaborn as sns
import json
from flask import *
from flask_cors import CORS, cross_origin
import warnings
warnings.simplefilter(action='ig... | ioannakandi/recSys | main.py | main.py | py | 6,875 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "warnings.simplefilter",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "flask_cors.cross_origin",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pandas.... |
24495985471 | from __future__ import print_function, unicode_literals
from ._util import compact_json_dumps, TERMINALS, NONTERMINALS
from ._util import follow_path, in_array, in_object, range, compat_kwargs
import copy
import bisect
import sys
import json
def diff(left_struc, right_struc,
array_align=True, compare_length... | opensvc/igw_envoy | src/json_delta/_diff.py | _diff.py | py | 16,258 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "_util.compact_json_dumps",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "copy.copy",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "_util.compact_json_dumps",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "copy.copy... |
39095371429 |
# coding: utf-8
# In[1]:
#define a listener which listens to tweets in real time
import tweepy
# to install tweepy, use: pip install tweepy
# import twitter authentication module
from tweepy import OAuthHandler
# import tweepy steam module
from tweepy import Stream
# import stream listener
from tweepy.streaming... | vigneshsriram/Python-Tutorials | WebScrapping2/WebScraping2.py | WebScraping2.py | py | 5,546 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tweepy.OAuthHandler",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "tweepy.streaming.StreamListener",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 44,
"usage_type": "call"
},
{
"api_nam... |
1386058348 | import random
from typing import Set
import numpy as np
def random_rotate(x: np.ndarray,
rotation_directions: Set[int],
mirror_directions: Set[int] = None,
mirror_first=True) -> np.ndarray:
if mirror_directions is None:
mirror_directions = rotation_di... | veeramallirajesh/CT-Vertebrae-Detection | load_data/random_rotate.py | random_rotate.py | py | 1,232 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.ndarray",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "typing.Set",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Set",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_numbe... |
1734227672 | # Mongodb 测试
from pymongo import MongoClient
# 连接 mongodb,得到一个客户端对象
client = MongoClient('mongodb://localhost:27017')
# 获取名为 scrapy_db 的数据库对象
db = client.scrapy_db
# 获取名为 person 的集合对象
collection = db.person
doc = {
'name':'刘硕',
'age':34,
'sex':'M'
}
# 将文件插入集合
collection.insert_one(do... | zkzhang1986/-Scrapy- | practise/scrapyMongodbTest.py | scrapyMongodbTest.py | py | 443 | python | zh | code | 11 | github-code | 36 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 5,
"usage_type": "call"
}
] |
9037012840 | import os
import math
import json
import asyncio
from operator import itemgetter
import aiohttp
from aiohttp import ClientConnectorError, ServerTimeoutError, TooManyRedirects
from aiolimiter import AsyncLimiter
from fastapi import FastAPI, Path
app = FastAPI()
# allow for 10 concurrent entries within a 2 second wind... | treybrooks/TopCryptosAPI | ranking/app/main.py | main.py | py | 2,688 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "aiolimiter.AsyncLimiter",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"li... |
29284640142 | import boto3
import json
def create_aws_resource(name, region, KEY, SECRET):
"""
Creates an AWS resource, e.g., ec2, s3.
:param str name - the name of the resource
:param str region - the name of the AWS region that will contain the resource.
:param str KEY - the aws access key
:param str ... | Hyacinth-Ali/data-warehouse-S3-to-Redshift-ETL | provision_resource_helper.py | provision_resource_helper.py | py | 2,716 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "boto3.resource",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 69,
"usage_type": "call"
}
] |
70619296105 | import gym
import numpy as np
import random
#from gym_minigrid.wrappers import *
#import gym_minigrid
#from gym_minigrid import Window
import matplotlib
#env = gym.make('MiniGrid-Empty-6x6-v0',render_mode='human')
env = gym.make('MiniGrid-Empty-8x8-v0')
#env = gym.make('MiniGrid-Empty-8x8-v0')
#window = Wind... | VaibhavMishra02001/Implementation-of-RL-algorithms | sarsa1.py | sarsa1.py | py | 2,633 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "gym.make",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random.uniform",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 58,
"usage_type": "attribute"
},
{
"api_name": "random.choice",
"l... |
25947248538 | # idea: do dfs, put current coordinate and node,
# but put left node first and pop most left element firts from stack
# than add coordinate and node to dict
# than sort dict and return values
from collections import defaultdict
from typing import List, Optional
class TreeNode:
def __init__(self, val=0, left=Non... | dzaytsev91/leetcode-algorithms | medium/314_binary_tree_vertical_order_traversal.py | 314_binary_tree_vertical_order_traversal.py | py | 857 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "typing.Optional",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 19,
"usage_type": "name"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.