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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
42432458928 | from django.shortcuts import get_object_or_404
from django.contrib.auth import authenticate
from django.core.validators import validate_email
from django.core.exceptions import ValidationError
from django.db.models import Q
from uuid import uuid4
from rest_framework import serializers, exceptions, validators
from rest... | IslombekOrifov/olx | src/api/v1/accounts/serializers.py | serializers.py | py | 3,579 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "rest_framework.serializers.Serializer",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.CharField",
"line_number": 16,
"usage_ty... |
6319273494 | import theano
import theano.tensor as T
from .utils import floatX
from .layers import l2norm
# ------------------------
# Regularization
# ------------------------
def clip_norm(grad, clip, norm):
if clip > 0:
grad = T.switch(T.ge(norm, clip), grad * clip / norm, grad)
return grad
def clip_norms(grads... | maym2104/ift6266-h17-project | lib/updates.py | updates.py | py | 8,249 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "theano.tensor.switch",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "theano.tensor",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "theano.tensor.ge",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "theano.tensor.sqr... |
72718749224 | import numpy as np
#from pyGITR.math_helper import *
from typing import Callable
import matplotlib.pyplot as plt
import pydoc
import netCDF4
import os
class Sputtering_and_reflection():
def ShowAvailableProjectiles(self):
for D in ['H', 'D', 'T', 'He4', 'Si', 'C', 'W']:
print(D)
... | audide12/DIIIDsurface_pyGITR | pyGITR/Physical_Sputtering.py | Physical_Sputtering.py | py | 15,097 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "numpy.array",
"line_number": 282,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 283,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 284,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number... |
3207056630 | import datetime as dt
import platform
from pathlib import Path
from unittest import mock
import pdf2gtfs.user_input.cli as cli
from pdf2gtfs.config import Config
from pdf2gtfs.datastructures.gtfs_output.agency import (
GTFSAgency, GTFSAgencyEntry)
from test import P2GTestCase
def get_path_with_insufficient_perm... | heijul/pdf2gtfs | test/test_user_input/test_cli.py | test_cli.py | py | 11,810 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "platform.system",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "pdf2gtfs.datastructures.gtfs_output.agency.GTFSAgencyEntry",
"line_number": 32,
"usage_type": "call"
},
... |
30977077952 | import numpy as np
from scipy.interpolate import lagrange
from numpy.polynomial.polynomial import Polynomial
import matplotlib as plt
size = int(input())
x = np.random.uniform(0, size, size)
y = np.random.uniform(0, size, size)
z = np.random.uniform(0, size, size - 1)
print("x:", x, "y:", y, "z:", z)
#x = np.array([0, ... | Mcken09/Numerical-methods1 | interpol_lagr.py | interpol_lagr.py | py | 646 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.random.uniform",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.uniform",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.random... |
22534157712 | import cv2
import argparse
import numpy as np
from cam import *
camback_src = np.float32([[328, 363], [433, 359], [447, 482], [314, 488]])
camback_dst = np.float32([[814, 1359], [947, 1359], [947, 1488], [814, 1488]])
camleft_src = np.float32([[340, 426], [446, 424], [470, 554], [333, 554]])
camleft_dst = np.float32(... | Hyper-Bullet/littleAnt | perspect_stiching/perspective.py | perspective.py | py | 1,660 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.float32",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_numb... |
23788787319 | from django.test import TestCase
from django.contrib.auth.models import User
from .models import Message, Thread
class ThreadTestCase(TestCase):
# prepara el entorno de pruebas
def setUp(self):
self.user1 = User.objects.create_user('user1', None, 'test1234')
self.user2 = User.objects.create_u... | mjmed/Django-Web-Playground | messenger/tests.py | tests.py | py | 3,080 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.test.TestCase",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.models.User.objects.create_user",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects",
"line_number": 10,
"usa... |
14303021398 | import cv2
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--model', type=str, default='data/haarcascade_frontalface_default.xml')
def main(args):
# Load the cascade
face_cascade = cv2.CascadeClassifier(args.model)
# To capture video from webcam.
cap = cv2.VideoCa... | sinantie/zumo-face-follower-rpi | test/test_detect_face_video.py | test_detect_face_video.py | py | 1,130 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.cvt... |
298698477 | # Write a web scraper that fetches the information from the Wikipedia page
# on Web scraping. Extract all the links on the page and filter them so the
# navigation links are excluded.
# Programmatically follow one of the links that lead to another Wikipedia article,
# extract the text content from that article, and sav... | symonkipkemei/cnd-labs | python-301/resources/04_web-scraping/04_05_wiki_scrape.py | 04_05_wiki_scrape.py | py | 1,751 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number... |
1914845096 | from joblib import parallel_backend
from tslearn.metrics import cdist_dtw, dtw
import pandas as pd
import numpy as np
def get_DTW_distance_matrix_w_mask(matrix1, matrix2, mask, window = 4, n_jobs = 1):
def calculate_distance(profiles):
profile1, profile2 = profiles
return dtw(matrix1.loc[profile1],... | jankrans/Conditional-Generative-Neural-Networks | repositories/profile-clustering/energyclustering/clustering/DTW.py | DTW.py | py | 1,570 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tslearn.metrics.dtw",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "joblib.parallel_backe... |
26987702949 | import pytest
from privatechats.models import PrivateChatRoom, PrivateChatRoomMessage
@pytest.mark.django_db
def test_private_chat_room_str_method():
"""Test PrivateChatRoom __str__ method"""
group_chat_room_obj = PrivateChatRoom.objects.create(name='user1user2')
assert str(group_chat_room_obj) == 'use... | mf210/LetsChat | tests/privatechats/privatechats_model_tests.py | privatechats_model_tests.py | py | 808 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "privatechats.models.PrivateChatRoom.objects.create",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "privatechats.models.PrivateChatRoom.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "privatechats.models.PrivateChatRoom",
"li... |
25287870424 | import threading
import json
import os
from astar_model import AStarModel
from tkinter.ttk import Progressbar
from tkinter import (Tk, Frame, Button, Label, Entry, Checkbutton, Scale, Canvas, messagebox, filedialog,
StringVar, IntVar,
DISABLED, NORMAL,
W, S... | Mackaronii/astar-search-visualizer | astar_gui.py | astar_gui.py | py | 31,617 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "tkinter.Tk",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "tkinter.Tk.__init__",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tkinter.Tk",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "astar_model.AStarModel",
... |
32542356510 | from google.cloud import storage
from configparser import ConfigParser
from google.oauth2 import service_account
from googleapiclient.discovery import build
from utils.demo_io import (
get_initial_slide_df_with_predictions_only,
get_fovs_df,
get_top_level_dirs,
populate_slide_rows,
get_histogram_df,... | alice-gottlieb/nautilus-dashboard | examples/zarr_example.py | zarr_example.py | py | 1,548 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "gcsfs.GCSFileSystem",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "google.oauth2.service_account.Credentials.from_service_account_file",
"line_number": 39,
"u... |
74157726824 | import psycopg2
import src.DBConfig as config
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
class Database:
def __init__(self, debugLogFile):
self.db_server_conn = None
self.database_params = None
self.db_cursor = None
self.db_name = None
self.bug_table_name =... | Danc2050/TheBugTracker | src/DatabaseScript.py | DatabaseScript.py | py | 6,480 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "src.DBConfig.config",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "src.DBConfig",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "psycopg2.connect",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "psycopg2.Error",
... |
16230419939 | import PyPDF2
import warnings
# Open the PDF file in read-binary mode
pdf_file = open('1.2.826.1.3680043.9.5282.150415.2352.16502352212057.pdf', 'rb')
pdf_reader = PyPDF2.PdfReader(pdf_file)
num_pages = len(pdf_reader.pages)
text = ""
for page_number in range(num_pages):
page = pdf_reader.pages[page... | Muthukumar4796/Text-recognition-in-radiology-report-using-NLP- | nlp_project.py | nlp_project.py | py | 1,325 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PyPDF2.PdfReader",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 31... |
38509693865 | import math
from django.shortcuts import render, get_object_or_404, redirect, reverse
from django.utils import timezone
from authentication.models import UserProfile
from issue_tracker.models import Issue, Comment
from django.contrib.auth.models import User
from issue_tracker.forms import IssueForm, CommentForm
from dj... | itoulou/unicorn-attractor | issue_tracker/views.py | views.py | py | 5,517 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "issue_tracker.models.Issue.objects.filter",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "issue_tracker.models.Issue.objects",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "issue_tracker.models.Issue",
"line_number": 21,
"usage_... |
18914571723 | import pytest
from src.can_place_flowers import Solution
@pytest.mark.parametrize(
"flowerbed,n,expected",
(
([1, 0, 0, 0, 1], 1, True),
([1, 0, 0, 0, 1], 2, False),
([1, 0, 0, 0, 0, 1], 2, False),
([0], 1, True),
),
)
def test_solution(flowerbed, n, expected):
assert ... | lancelote/leetcode | tests/test_can_place_flowers.py | test_can_place_flowers.py | py | 373 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "src.can_place_flowers.Solution",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 6,
"usage_type": "attribute"
}
] |
5100700802 | #!/bin/env python
import streamlit as st
import pandas as pd
import os
import yaml
################################################################
def _main():
_filenames = os.listdir()
_filenames = [e for e in _filenames if os.path.splitext(e)[1] == '.json']
_filenames = [os.path.splitext(e)[0] for e ... | anciaux/graph-tool-sgc-tc | plot_best_match.py | plot_best_match.py | py | 3,429 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.listdir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.splitext",
"line... |
34925500139 | import discord
from discord.ext import commands
from discord import Embed
from core.classes import *
class Global(CategoryExtension):
@commands.command()
@commands.has_permissions(manage_roles=True)
async def ping(self, ctx):
await ctx.send(f"Hey, it's me, HarTex! :eyes: Did you need something? ... | HTG-YT/hartex-discord.py | HarTex/cmds/global.py | global.py | py | 5,665 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "discord.ext.commands.command",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.has_permissions",
"line_number": 11,
"usage_type": "call"
},
{... |
40556512110 | import os
import time
import requests
import telegram
import logging
from dotenv import load_dotenv, find_dotenv
logger = logging.getLogger('__name__')
class TelegramBotHandler(logging.Handler):
def __init__(self, log_bot, chat_id):
super().__init__()
self.chat_id = chat_id
self.log_bo... | Kilsik/Check_Devman_lessons | main.py | main.py | py | 2,618 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.Handler",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "dotenv.find... |
20475078540 | import pytz
import json
import os
import mimetypes
import requests
import tempfile
from django import forms
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ValidationError
from django.core.files.images import ImageFile, get_image_dimensions
f... | theju/smp | scheduler/forms.py | forms.py | py | 3,604 | python | en | code | 18 | github-code | 36 | [
{
"api_name": "django.forms.SplitDateTimeWidget",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "django.forms.ModelForm",
"line_number": 27,
"usage_type": "attribute"
},
{
"ap... |
74328989543 | #!/usr/bin/env python3
import csv
from openpyxl import Workbook
from openpyxl.utils import get_column_letter
import requests
import sys
HEADERS = {'Authorization' : 'Bearer key1agtUnabRLb2LS', 'accept' : 'text/plain'}
BASE_URL = 'https://api.airtable.com/v0/appj3UWymNh6FgtGR/'
VIEW = 'view=Grid%20view'
# Values relat... | OpenEugene/little-help-book-web | table-of-contents-style-homepage/scripts/get_table.py | get_table.py | py | 8,591 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 139,
"usage_type": "call"
},
{
"api_name": "csv.DictWriter",
"line_number": 202,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 212,
"usage_type": "call"
},
{
"api_name": "openpyxl.Workbook",
"li... |
37166463882 | import math
import matplotlib.pyplot as plt
def integral(n):
val = [1 - math.exp(-1)]
if n < 1:
return val
for i in range(1,n+1):
val.append(1 - i*val[i-1])
return val
n = 20
x = range(0,n+1)
y = integral(n)
plt.plot(x, y, 'r')
plt.xlabel('k')
plt.ylabel('I(k)')
plt.show() | Aditi-Singla/Numerical-Algorithms | Homework 1/q7_integral.py | q7_integral.py | py | 300 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "math.exp",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.xl... |
26819728584 |
# import math
import requests
import re
def get_url():
return ''.join([
'http'+ ':' + '//',
'.'.join(['www', 'cyber'+'syndrome', 'net']),
'/'+'search.cgi'+'?' + '&'.join(['q=JP', 'a=A', 'f=d', 's=new', 'n=100'])
])
def read_page():
url = get_url()
ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)... | otsutomesan/proxy80 | proxy80/proxy80.py | proxy80.py | py | 2,426 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.Session",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 4... |
74286578664 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import math
import numpy as np
import pytest
from .. import ChainedNeqSys, ConditionalNeqSys, NeqSys
try:
import pynleq2 # noqa
except ImportError:
HAVE_PYNLEQ2 = False
else:
HAVE_PYNLEQ2 = True
def f(x, params):... | bjodah/pyneqsys | pyneqsys/tests/test_core.py | test_core.py | py | 8,592 | python | en | code | 38 | github-code | 36 | [
{
"api_name": "numpy.sqrt",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "numpy.square",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "numpy.allclose",
"line_number":... |
8841422938 | from __future__ import print_function
import logging
import re
from db_endpoint import DBEndpoint,TCPFrameClient
from utils import blockify
from thread_executor import ThreadExecutor, ThreadExecutorError
from ida_ts import get_func_length, get_func_data, get_func_comment,\
set_func_comment, Functions, first_func_a... | xorpd/fcatalog_client | fcatalog_client/ida_client.py | ida_client.py | py | 10,885 | python | en | code | 26 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "ida_ts.GetFunctionName",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "ida_ts.get_func_length",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "threa... |
5884209191 | # -*- coding: utf-8 -*-
"""
Created on Sat Jun 1 17:39:54 2019
@author: Akshay
"""
def is_number(s):
try:
float(s)
return True
except ValueError:
return False
def alpha(line):
temp=[]
for word in line.split():
if is_number(word):
for num in l... | gakshaygupta/Semi-Supervised-Cross-Lingual-Text-summarization | undreamt/preprocessing 2.py | preprocessing 2.py | py | 5,534 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 125,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 125,
"usage_type": "attribute"
},
{
"api_name": "indicnlp.common.set_resources_path",
"line_number": 127,
"usage_type": "call"
},
{
"api_name": "i... |
8984732684 | # pylint: disable=too-many-public-methods, too-many-arguments, fixme
"""
CVE-bin-tool tests
"""
import importlib
import os
import shutil
import sys
import tempfile
import unittest
import pytest
from cve_bin_tool.cvedb import CVEDB
from cve_bin_tool.version_scanner import VersionScanner
from .test_data import __all__ ... | chinvib66/cve-bin-tool | test/test_scanner.py | test_scanner.py | py | 7,556 | python | en | code | null | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line... |
17561063252 | # -*- coding: utf-8 -*-
import re
import os
import sys
import json
import time
import random
import urllib2
import win32gui
import win32con
import win32api
# Current path
ROOT = ""
# Log path
LOG_PATH = "log.txt"
# Replace special chars to this char in file name
NAME_FILL_CHAR = "-"
# Access random index separate
INDE... | AielloChan/pywallpaper | main.py | main.py | py | 9,893 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "sys.getfilesystemencoding",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "sys.path",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists"... |
32995011041 | """
Test executors logic.
"""
import yaml
from unittest import TestCase
from voluptuous import Schema
from six import StringIO
from mock import (
patch,
call,
MagicMock,
)
from plix.executors import (
BaseExecutor,
ShellExecutor,
)
from .common import MockDisplay
class ExecutorsTests(TestCase... | freelan-developers/plix | tests/test_executors.py | test_executors.py | py | 3,697 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "plix.executors.BaseExecutor",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "voluptuous.Schema",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "yaml.... |
34101450986 | #!/usr/bin/python3
import pandas as pd
import numpy as np
import seaborn as sns
import statsmodels.formula.api as sm
import pylab as plt
import argparse
import os
import matplotlib
from matplotlib.gridspec import GridSpec
from pathlib import Path
from tqdm import tqdm
plt.style.use('bmh')
HOME = str(Path.home())
PLO... | Airplaneless/presentationEAVM | createPlot.py | createPlot.py | py | 3,017 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pylab.style.use",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pylab.style",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path.home",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
... |
16538220342 | """
Functionality for working with plasma density data created by the
NURD algorithm
See Zhelavskaya et al., 2016, doi:10.1002/2015JA022132
"""
import os
import glob
import time
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from spacepy import pycdf
def read_cdf(filename, \
pathname='/User... | mariaspasojevic/PyRBSP | nurdpy.py | nurdpy.py | py | 5,014 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.isfile",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "spacepy.pycdf.CDF",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "spacepy.pycdf",
"li... |
15467387894 | from openpyxl.styles import Font, Border, Side, PatternFill, Alignment
from openpyxl import load_workbook
wb = load_workbook("/Users/gunju/Desktop/self study/python/deep/rpa_basic/1_excel/sample.xlsx")
ws = wb.active
a1 = ws["A1"]
b1 = ws["B1"]
c1 = ws["C1"]
ws.column_dimensions["A"].width = 5 # A열 너비 5로 설정
ws.row_di... | hss69017/self-study | deep/rpa_basic/1_excel/11_cell_style.py | 11_cell_style.py | py | 1,608 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "openpyxl.styles.Font",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "openpyxl.styles.Font",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "openp... |
72871607463 | import numpy as np
import os
import torch
from tqdm import tqdm
from PIL import Image
import wandb
from .evaluation import eval_llh, eval_translation_error, rotation_model_evaluation, translation_model_evaluation
# Global variables
DEVICE = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
def cos... | LDenninger/se3_pseudo_ipdf | se3_ipdf/training.py | training.py | py | 7,997 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.device",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.cos",
... |
263755309 | """
https://leetcode.com/problems/sum-of-all-odd-length-subarrays/
Given an array of positive integers arr, calculate the sum of all possible odd-length subarrays.
A subarray is a contiguous subsequence of the array.
Return the sum of all odd-length subarrays of arr.
"""
"""
For array of size x, start with x subarrays... | brandonaltermatt/leetcode-solutions | easy/array/sum_of_all_odd_length_subarrays.py | sum_of_all_odd_length_subarrays.py | py | 850 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 22,
"usage_type": "name"
}
] |
32948325933 | import sys
#sys.path.insert(0, "/home/tomohiro/workspace/web_scraping_venv/lib/python3.6/site-packages")
from flask import Flask, render_template, request
from flask_socketio import SocketIO, emit, send
from flask_pymongo import PyMongo
from bson.objectid import ObjectId
from bs4 import BeautifulSoup
import requests
im... | tomohiro3/scraping | work/flask_script.py | flask_script.py | py | 7,063 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask_socketio.SocketIO",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask_pymongo.PyMongo",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "flask.rende... |
25569986801 | from json import load
from tkinter.font import BOLD
from openpyxl import load_workbook
from openpyxl.styles import PatternFill, Font
def edm(filename):
wb = load_workbook(filename)
sheet = wb['Recipients']
sheet2 = wb['Link Clicks - Detail']
# Deleting empty rows
sheet.delete_rows(1,1)
... | iWantCry/eDM-Stats | edm.py | edm.py | py | 2,256 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "openpyxl.styles.Font",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "openpyxl.styles.PatternFill",
"line_number": 28,
"usage_type": "call"
}
] |
74362480745 | import scipy as sp
import numpy as np
import math
import input_checks
import ode_solver
def sparse_A(size, dm, do):
"""
Creates a sparse matrix used by the scipy spsolve function.
----------
Parameters
size : int
The square dimension value of the matrix.
dm : float OR int
Valu... | jack-parr/scientific_computing | pde_solver.py | pde_solver.py | py | 9,406 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.ones",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "scipy.sparse.diags",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "scipy.sparse",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "numpy.diag",
"lin... |
3458942753 | import collections
import pandas as pd
import re
import pdftotext
import requests
from static.constants import FILE_PATH
class DrugsFDA:
def __init__(self, fda_app_num):
self.FDA_Application_Number = None
drugs_fda_df = pd.read_csv(FILE_PATH.DRUGSFDA_ORIGIN_DOCS, encoding="ISO-8859-1", delimiter=... | Yiwen-Shi/drug-labeling-extraction | core/drugsfda.py | drugsfda.py | py | 13,945 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "static.constants.FILE_PATH.DRUGSFDA_ORIGIN_DOCS",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "static.constants.FILE_PATH",
"line_number": 13,
"usage_type": "name"... |
43045351216 | import time
import json
import os
import requests
class pokemon:
def __init__(self, number, energy):
self.number = number
self.energy = 50
self.hp = hp_from_id(number)
self.attack = attack_from_id(number)
self.defense = defense_from_id(number)
self.special_attack = s... | Hayden987/PokEggHunt | main.py | main.py | py | 2,832 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "time.time",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 66,... |
7005637816 | """Deleted_columns_in_city
Revision ID: 7b8f459a61b0
Revises: e280451841bb
Create Date: 2021-11-11 15:08:06.260280
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '7b8f459a61b0'
down_revision = 'e280451841bb'
branch_labels =... | nazarkohut/room_book | migrations/versions/7b8f459a61b0_deleted_columns_in_city.py | 7b8f459a61b0_deleted_columns_in_city.py | py | 1,089 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "alembic.op.drop_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "alembic.op.drop_column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "alembic.op",... |
569508846 | import sys,os
pathRacine=os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)),'..'))
if os.path.dirname(pathRacine) not in sys.path :
sys.path.insert(0,pathRacine)
from .dataBase import Base
if __name__ == "__main__":
from argparse import ArgumentParser
p=ArgumentParser()
p.ad... | luzpaz/occ-smesh | src/Tools/Verima/Base/exportToCSV.py | exportToCSV.py | py | 694 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "os.path.abspath",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_nu... |
72595178664 | # ! ! !
# ESSA points no working
# ! ! !
import re
import os
import sys
import Cython
import ctypes
from ctypes import cdll, CDLL
import random
import datetime
import asyncio
import json
from difflib import SequenceMatcher
import nextcord as discord
from nextcord import ActivityType, guild
fr... | Czuowuek-SOS/Bot | Main.py | Main.py | py | 14,480 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.loads",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "nextcord.ext.commands.Bot",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "nextcord.ext.commands"... |
10256190705 | import threading
import time
import pygame
import random
import socket
import pickle
"""
10 x 20 square grid
shapes: S, Z, I, O, J, L, T
represented in order by 0 - 6
"""
pygame.font.init()
# GLOBALS VARS
s_width = 1200
s_height = 750
play_width = 300 # meaning 300 // 10 = 30 width per block
play_height = 600 # m... | lewis0926/online-tetris-game | client.py | client.py | py | 13,057 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.font.init",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "random.choice",
"line_number": 203,
"usage_type": "call"
},
{
"api_name": "pygame.font.SysFont"... |
19830142972 | from datetime import datetime
from typing import List, Optional, Tuple
from api.models.booking_model import Booking
from api.models.room_model import Room
from api.models.user_model import User
from api.repository.rooms_repository import RoomsRepository
from api.repository.user_repository import UserRepository
from .... | Tomdango/Q4-2021-SoftEngDevOps | api/repository/booking_repository.py | booking_repository.py | py | 5,261 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "abstract_repository.AbstractRepository",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "api.models.booking_model.Booking",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 57,
"usage_type": "name"
},
... |
71570408423 | import time
import numpy as np
import math
from numba import cuda
from matrix_operations import matmul_packed32_shared, matmul_packed32, TPB
from matrix_convert import to_gpu, from_gpu, to_type, from_type
np.random.seed(1)
def run_uint32(size=10000, times=50, sparsity=0.7):
A, B = np.random.randint(0, 100, (size... | EgorNemchinov/formal-languages | test_multiplication.py | test_multiplication.py | py | 1,614 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.random.seed",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.randint",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.random",... |
29292987146 | import typer
from typing import Optional
import os
import sys
import json
from alternat.generation import Generator
from alternat.generation.exceptions import InvalidConfigFile, InvalidGeneratorDriver
from alternat.collection import Collector
import subprocess
import shutil
app = typer.Typer()
# This key determines ... | keplerlab/alternat | app.py | app.py | py | 5,217 | python | en | code | 18 | github-code | 36 | [
{
"api_name": "typer.Typer",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "alternat.collection.Collector",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "typer.echo",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "typer.echo",
... |
17704058430 | import os
import yaml
from behave import fixture, use_fixture
from selenium import webdriver
browser_type = os.environ.get("BROWSER", "chrome")
platform = os.environ.get("PLATFORM", "desktop")
def get_browser(name):
if name == "chrome":
return webdriver.Chrome()
else:
return None
def get_v... | ChaitanyaAdhav/SHORE_Capital | features/environment.py | environment.py | py | 1,566 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.environ.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_num... |
22912869355 | import argparse
import conf
from dfwrapper import HeinzWrapper, ResistanceWrapper
from plotting import Plotter
def main(args):
conf.configure_from_args(args)
curr_wrapper = HeinzWrapper(conf.curr_file_names, 'curr')
volt_wrapper = HeinzWrapper(conf.volt_file_names, 'volt')
comb_wrapper = ResistanceWra... | ligerlac/HVAnalysis | HVAnalysis/make_resistance_plot.py | make_resistance_plot.py | py | 839 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "conf.configure_from_args",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "dfwrapper.HeinzWrapper",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "conf.curr_file_names",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name":... |
13158886481 | from flask import Flask, render_template, jsonify
import serial
import sys
import threading
import openpyxl
from openpyxl import Workbook
from openpyxl.utils import get_column_letter
import datetime
app = Flask(__name__)
latest_tag = ''
tag_count = 0
tag_data = []
def convert_tag_from_bytes_to_hex(tag... | SudeepKulkarni3301/LI2-Internship | app_excel_file.py | app_excel_file.py | py | 3,692 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "serial.Serial",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "serial.serialutil",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "openpyxl.Workbook",
... |
34113477971 | import numpy as np
import matplotlib.pyplot as plt
import pystan
np.set_printoptions(precision=5, suppress=True)
import gzip
import os
import pdb
import pickle
seed = 1
np.random.seed(seed)
n_N = 500
n_F = 5
n_Y = 10
n_D = 2000
n_W = 1000
n_C = 4
AD = 0.95
Y = np.zeros((n_N, n_Y))
B = np.zeros((n_Y, n_F))
log_F_s... | atechnicolorskye/post_sum | infer/infer.py | infer.py | py | 2,408 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros... |
17444702079 | from mimetypes import init
from turtle import forward
from torch import conv2d
import torch
import torch.nn as nn
import common
#from model import common
import torch.nn.functional as F
import math
import cv2
import os
import datetime
import scipy.io as io
import numpy as np
def EzConv(in_channel,o... | HuQ1an/GELIN_TGRS | Ours.py | Ours.py | py | 8,839 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "torch.nn.Conv2d",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"lin... |
4944678267 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# encoding: utf-8
#客户端调用,用于查看API返回结果
import json
import os
import hashlib
import json
import platform
def getSysType():
sysSystem = platform.system()
if sysSystem == 'Windows': #mac系统
return 'win'
elif sysSystem == 'Darwin':
return 'mac'
elif... | fengmm521/okex_robot | util/signTool.py | signTool.py | py | 1,077 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "platform.system",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "hashlib.sha256",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "hashlib.sha256",
"line_... |
27541033350 | import re
from Bio import AlignIO, SeqIO
from Bio.Seq import Seq
import argparse
# This section defines the input options. You can copy and modify this section for future scripts, it's very handy! In that case don't forget to import the argparse package (import argparse)
# Get arguments
def add_arguments(parser):
... | tandermann/python_for_biologists | data/alignment_formatter.py | alignment_formatter.py | py | 2,210 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "Bio.AlignIO.read",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "Bio.AlignIO",
"line_number": 57,
"usage_type": "name"
},
{
"api_name": "Bio.SeqIO.write"... |
34412858770 | # -- coding: utf-8 --`
import os
import argparse
import json
import botocore
import boto3
def main(args):
cfg = botocore.config.Config(retries={'max_attempts': 0}, read_timeout=900, connect_timeout=900)
args = {k: v for k, v in args.items() if v is not None}
try:
lambda_client = boto3.client('lam... | densenkouji/stable_diffusion.openvino.lambda | demo.py | demo.py | py | 3,184 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "botocore.config.Config",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "botocore.config",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "boto3.client",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "boto3.resource... |
17895317270 | from typing import Any, Mapping, Optional, Union, Tuple
from flax.core import scope as flax_scope
import jax
import jax.numpy as jnp
import t5x.models as t5x_models
from models import gp_models # local file import from baselines.t5
from models import models as ub_models # local file import from baselines.t5
Array = ... | google/uncertainty-baselines | baselines/t5/models/be_models.py | be_models.py | py | 7,534 | python | en | code | 1,305 | github-code | 36 | [
{
"api_name": "t5x.models.Array",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "t5x.models",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "models.models.EncoderDecoderClassifierModel",
"line_number": 12,
"usage_type": "attribute"
},
{
"a... |
28438842371 | from aiohttp import web
import sys
import os
import argparse
import simplejson as json
import functools
import sqlite3
import threading
import requests
import datetime
import dateutil.parser
import simplejson as json
from collections import defaultdict
from routes import routes
from calculation.task import Task
from... | kuris996/ws | main.py | main.py | py | 3,882 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.post",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "simplejson.loads",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "dateutil.parser.parser... |
42164236500 | #!/usr/bin/env python
"""
Provide image saving service. The callback is function wait_for_message. The message is transferred to cv and then saved.
imageSave:
request has two attributes, path and number (sequence number)
response has a single bool type of whether image saving success.
When passing request to the servic... | wuyang3/workspace | catkin_ws/src/poke_gazebo/scripts/poke_image_saver.py | poke_image_saver.py | py | 3,559 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv_bridge.CvBridge",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "rospy.Service",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "poke_gazebo.srv.imageSave",
"line_number": 35,
"usage_type": "argument"
},
{
"api_name": "rospy.... |
38192341046 | import decimal
from django.conf import settings
from django.contrib import messages
from django.db.models import Sum
from django.shortcuts import render, redirect, get_object_or_404
from ..models import *
from ..forms import *
from ..models import *
from django.contrib.auth.decorators import login_require... | luggiestar/kahama | KCHS/views/student_views.py | student_views.py | py | 8,479 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.db.models.Sum",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 38,
"usage_type": "call"
},
{
"api_name":... |
21213270872 | import pandas as pd
from tqdm import tqdm
from Database_comparator.config_class import cfg
import os
from Bio.Blast.Applications import NcbiblastpCommandline
from Bio.Blast.Applications import NcbimakeblastdbCommandline
import Database_comparator.Fasta_maker as Fasta_maker
import Database_comparator.db_aligner as db_a... | preislet/Database_comparator | Database_comparator/db_blast.py | db_blast.py | py | 8,294 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "Database_comparator.config_class.cfg",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "Database_comparator.db_aligner.aligner",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "Database_comparator.db_aligner",
"line_number": 23,
"usa... |
74498162984 | import streamlit as st
from sklearn import datasets
from sklearn.ensemble import RandomForestClassifier
import pandas as pd
# Chargement du dataset Iris et Random Forest Classifier
iris = datasets.load_iris()
x = iris.data
y = iris.target
foret=RandomForestClassifier()
foret.fit(x,y)
# Creation de l'ap... | MamadouPNDIAYE/ML_App | iris.py | iris.py | py | 1,538 | python | fr | code | 0 | github-code | 36 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "sklearn.ensemble.RandomForestClassifier",
"line_number": 10,
"usage_type": "call"
},
{
... |
7152283168 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | Looking-Glass/blenderLKG | looking_glass_tools/looking_glass_settings.py | looking_glass_settings.py | py | 9,262 | python | en | code | 34 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "site.getusersitepackages",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "importlib.util... |
6353439339 | import json
import psycopg2
def lambda_handler(event, context):
db_host = "database-2.cjcukgskbtyu.ap-southeast-2.rds.amazonaws.com"
db_user = "postgres"
db_password = "sengpsql" # Please don't hack us
db_name = "database2"
db_port = 5432
conn = psycopg2.connect(
host=db_host,
... | SENG3011-megAPIxels/interactive-outbreak-predictor | PHASE_1/API_SourceCode/parser/report.py | report.py | py | 1,078 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "psycopg2.connect",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 46,
"usage_type": "call"
}
] |
18973862172 | #!d:/python/python.exe
# *********************************************************************
# Program to submit the interim and full export publishing job.
# ---------------------------------------------------------------------
# Created: 2007-04-03 Volker Englisch
# *********************************... | NCIOCPL/cdr-publishing | Publishing/SubmitPubJob.py | SubmitPubJob.py | py | 18,579 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cdr.APPC",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "cdr.Tier",
"line_number":... |
18735035904 | import scrapy
from Lab5_1.SeleniumRequest import SeleniumRequest
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from Lab5_1.items import Lab51Item
class AirbnbSpider(scrapy.Spider):
name = "airbnb"
allowed_domains = ["airbnb.com.ua"]
start_urls = ["h... | Ivan7281/Lab-Data-Scraping | Lab5_1/Lab5_1/spiders/airbnb.py | airbnb.py | py | 762 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "scrapy.Spider",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "Lab5_1.SeleniumRequest.SeleniumRequest",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "Lab5_1.items.Lab51Item",
"line_number": 24,
"usage_type": "call"
}
] |
37412163105 | from copy import deepcopy
import h5py
import numpy as np
import pytest
import six
from ...util.functions import virtual_file
from .. import (CartesianGrid,
CylindricalPolarGrid,
SphericalPolarGrid,
AMRGrid,
OctreeGrid)
ALL_GRID_TYPES = ['car', 'sph', 'c... | hyperion-rt/hyperion | hyperion/grid/tests/test_io.py | test_io.py | py | 6,744 | python | en | code | 51 | github-code | 36 | [
{
"api_name": "six.string_types",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"lin... |
38676635360 | # -*- coding: utf-8 -*-
"""
Created on Thu May 4 10:51:36 2017
@author: FunkyBlack
"""
import numpy as np
import matplotlib.pyplot as plt
def obj_fun(A, b, x):
#==============================================================================
# define the test function
# T T
# T... | FunkyBlack/CSMath-homeworks | Homework4/levenberg_marquardt.py | levenberg_marquardt.py | py | 2,756 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.dot",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 23,
... |
18431033624 | import copy
import random
import math
from fastapi import HTTPException
from nltk.tree import Tree
from schemas.paraphrasing_schemas import TreeParaphraseList, TreeParaphrase
class TreeParaphrasingService:
def __init__(self, tree_str: str):
self.tree = Tree.fromstring(tree_str)
def count_tree_permu... | Cerne13/paraphrasing-test-task | services/paraphrasing_service.py | paraphrasing_service.py | py | 2,400 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "nltk.tree.Tree.fromstring",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "nltk.tree.Tree",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "nltk.tree.Tree",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "math.factoria... |
39553984143 | import numpy as np
import cv2
import os
import time
from process_img import grab_screen
from direct_keys import PressKey, ReleaseKey, W, S, A, D
from getkeys import key_check
from tensorflow.keras.models import load_model
from global_var import *
def straight():
PressKey(W)
ReleaseKey(A)
ReleaseKey(D)
d... | MendelDamian/Using-AI-to-follow-path-in-minecraft | main.py | main.py | py | 2,254 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "direct_keys.PressKey",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "direct_keys.W",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "direct_keys.ReleaseKey",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "direct_... |
856491497 | #!/usr/bin/env python
from pyhesity import *
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-v', '--vip', type=str, default='helios.cohesity.com')
parser.add_argument('-u', '--username', type=str, default='helios')
parser.add_argument('-d', '--domain', type=str, default='local')
parser.add_ar... | bseltz-cohesity/scripts | python/protectMongoDB/protectMongoDB.py | protectMongoDB.py | py | 8,412 | python | en | code | 85 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
}
] |
41978343892 | from ja.common.job import JobStatus
from ja.server.config import ServerConfig
from ja.server.database.sql.database import SQLDatabase
from ja.server.database.types.work_machine import WorkMachineState
from ja.server.dispatcher.dispatcher import Dispatcher
from ja.server.dispatcher.proxy_factory import WorkerProxyFactor... | DistributedTaskScheduling/JobAdder | src/ja/server/main.py | main.py | py | 5,061 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "ja.server.scheduler.default_policies.DefaultCostFunction",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "ja.server.scheduler.default_policies",
"line_number": 29,
"usa... |
30071276942 | from datetime import datetime
from elasticsearch import Elasticsearch
DEBUG = True
def connect_elasticsearch():
_es = None
_es = Elasticsearch([{'host': 'localhost', 'port': 9200}])
if DEBUG:
if _es.ping():
print('[+] Connected to elasticsearch successfully')
else:
... | CUTLER-H2020/DataCrawlers | Economic/maps.me/elasticsearch_functions.py | elasticsearch_functions.py | py | 773 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 8,
"usage_type": "call"
}
] |
39689533340 | from atlas import Operation, Entity
from physics import Point3D
from rules import Location
from mind.goals.dynamic.DynamicGoal import DynamicGoal
class School(DynamicGoal):
"""Move in a shoal with other animals of the same type"""
def __init__(self, members=[], desc="mirror the movement of other animals lik... | worldforge/cyphesis | data/rulesets/basic/scripts/mind/goals/animal/herd.py | herd.py | py | 8,106 | python | en | code | 95 | github-code | 36 | [
{
"api_name": "mind.goals.dynamic.DynamicGoal.DynamicGoal",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "mind.goals.dynamic.DynamicGoal.DynamicGoal.__init__",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "mind.goals.dynamic.DynamicGoal.DynamicGoal",
"l... |
26543825982 | from setuptools import setup
with open('README.rst') as f:
long_description = f.read()
setup(
name = 'PorownywarkaOfert',
version = '0.1',
author = 'saraCzelusniak',
author_email = 'saraCzelusniak@bitbucket.org',
url = '',
description = 'Porownywanie ofert',
long_description = long_des... | czelsa/porownywarka-ofert | virt2/setup.py | setup.py | py | 683 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "setuptools.setup",
"line_number": 6,
"usage_type": "call"
}
] |
6395153010 | from typing import List
def add_value_to_rating(new_value: int, rating: List[int]):
insert_at = len(rating)
for i in range(len(rating)):
if rating[i] < new_value:
insert_at = i
break
rating.insert(insert_at, new_value)
rating = [7, 5, 3, 3, 2]
print('Текущий рейтинг:', ra... | vlp4/study-python | lesson2/task5.py | task5.py | py | 601 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 4,
"usage_type": "name"
}
] |
74967962022 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
get_ipython().run_line_magic('matplotlib', 'inline')
# (section:results_wagner)=
# # Identification of a dynamical system for the Wagner function
#
# ## Data generation
#
# As a first step, data for the analytical form of the Wagner function is generated. As seen in... | enricofoglia/SIA_RP_Report | _build/jupyter_execute/08WagnerSINDy.py | 08WagnerSINDy.py | py | 12,852 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "scipy.special.jv",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "scipy.special.yn",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "scipy.integrate.quad"... |
39885505055 | import pandas as pd
import re
from csv import reader
import altair as alt
import streamlit as st
from pandas.api.types import is_numeric_dtype
from urllib import request
# Page settings
st.set_page_config(
layout='wide',
initial_sidebar_state="expanded"
)
m = st.markdown("""
<style>
div.st... | ceghisolfi/tec-campaign-finance | analysis/campaign-finance-app.py | campaign-finance-app.py | py | 18,633 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "streamlit.markdown",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "streamlit.download_button",
"line_number": 69,
"usage_type": "call"
},
{
"api_name":... |
39240946152 | """
Writes MESS input for a monte carlo partition function calculation
"""
import os
from mako.template import Template
from mess_io.writer import util
# OBTAIN THE PATH TO THE DIRECTORY CONTAINING THE TEMPLATES #
SRC_PATH = os.path.dirname(os.path.realpath(__file__))
TEMPLATE_PATH = os.path.join(SRC_PATH, 'template... | sjklipp/interfaces_1219 | mess_io/writer/monte_carlo.py | monte_carlo.py | py | 2,141 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"lin... |
35026081994 | import warnings
warnings.filterwarnings('ignore')
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('seaborn-notebook')
import re
import string
from nltk.stem import WordNetLemmatizer
from sklearn.model_selection import train_test_split
import tensorflow as tf
from tensorflow.keras... | Ravi-Maurya/Natural_Language_Processing | TwitterClassification/TwitterClassification.py | TwitterClassification.py | py | 5,410 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 7,
"usage_type": "attribute"
},
{
"api... |
26540694817 | import math
from PyQt5.QtWidgets import QApplication, QLabel, QLineEdit, QPushButton, QVBoxLayout, QWidget, QCheckBox
class Quader():
def __init__(self, länge, breite, höhe):
self.A = int(länge)
self.B = int(breite)
self.C = int(höhe)
def __str__(self):
outputStr = "---------... | su595/MyPython | math programs/volumenRechner.py | volumenRechner.py | py | 4,416 | python | de | code | 2 | github-code | 36 | [
{
"api_name": "math.pi",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets.QApplication",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "PyQ... |
73742845865 | import logging
import json
import os
from common import utils
from table_order.table_order_item_list import TableOrderItemList
# 環境変数の取得
LOGGER_LEVEL = os.environ.get("LOGGER_LEVEL")
# ログ出力の設定
logger = logging.getLogger()
if LOGGER_LEVEL == 'DEBUG':
logger.setLevel(logging.DEBUG)
else:
logger.setLevel(logging.I... | line/line-api-use-case-table-order | backend/APP/category_get/category_get.py | category_get.py | py | 1,543 | python | ja | code | 13 | github-code | 36 | [
{
"api_name": "os.environ.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"li... |
38565479182 | from gluonts.dataset.util import to_pandas
import logging
import pandas as pd
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from gluonts.dataset.field_names import FieldName
import os
import numpy as np
from pandas.tseries import offsets
from pandas.tseries.frequencies import to_offs... | joelongLin/Shared_SSM | gluonts/lzl_shared_ssm/utils/tool_func.py | tool_func.py | py | 14,028 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.use",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.tseries.offsets.YearOffset",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "pandas.tseries.offsets",
"line_number": 50,
"usage_type": "name"
},
{
"api_n... |
8158101065 | """Parse the YAML configuration."""
import logging
from pathlib import Path
from typing import Optional, Dict, Callable, Tuple, Union
import yaml
import torch
from . import utils
logger = logging.getLogger("casanovo")
class Config:
"""The Casanovo configuration options.
If a parameter is missing from a us... | Noble-Lab/casanovo | casanovo/config.py | config.py | py | 4,091 | python | en | code | 75 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 74,
"usage_type": "name"
},
{
"api_name": "yaml.safe_load",
"... |
17260671113 | from scipy import stats
import numpy as np
import csv
sentiment_scores = np.random.random(52)
# input should be a numpy array of sentiment scores for the 50 states
def calculateRegressions(sentiment_scores):
white_ratios = []
male_ratios = []
educations = []
populations = []
incomes = []
criteria = ("white r... | yongzheng9405/-TwitterSentimentAnalysisProject | scripts/regression.py | regression.py | py | 1,673 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.random.random",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "csv.reader",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "scipy.stats.linregress... |
8473334100 | """To run this: $ python3 parse.py test.xml
The script will pase a XML file and print its node tags.
Compatible with Python 3; changing the print statements should make this
compatible with Python 2.
"""
import sys
# http://docs.python.org/library/xml.etree.elementtree.html
from xml.etree import ElementTree
def ope... | babywyrm/sysadmin | pyth3/xml/print_node_tags_.py | print_node_tags_.py | py | 1,104 | python | en | code | 10 | github-code | 36 | [
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "sys.exit",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "sys.argv",... |
1243606709 | import pygame as pg
from numpy import zeros
from constants import consts as c
from id_mapping import id_map, reverse_id_map
class World:
def __init__(self):
self.grid = zeros((c.num_cells, c.num_cells), dtype=int)
self.ore_locations = []
self.grid[10:13, 10:12] = id_map["coal"]
s... | chanrt/py-factory | world.py | world.py | py | 1,382 | python | en | code | 11 | github-code | 36 | [
{
"api_name": "numpy.zeros",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "constants.consts.num_cells",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "constants.consts",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "id_mappi... |
42147526124 | import copy
import logging
import traceback
from typing import Any, Dict, Optional, List
from .base_trigger import TriggerEvent, BaseTrigger
from .playbook_utils import merge_global_params
from .playbooks_event_handler import PlaybooksEventHandler
from ..model.events import ExecutionBaseEvent
from ..reporting.base imp... | m8e/robusta | src/robusta/core/playbooks/playbooks_event_handler_impl.py | playbooks_event_handler_impl.py | py | 8,001 | python | en | code | null | github-code | 36 | [
{
"api_name": "playbooks_event_handler.PlaybooksEventHandler",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "model.config.Registry",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "base_trigger.TriggerEvent",
"line_number": 20,
"usage_type": "name"
... |
25458093560 | """Analyze word-level LIWC scores between lucid and non-lucid dreams.
***Note this does not re-run LIWC, but loads in prior results.
IMPORTS
=======
- original post info, dreamviews-posts.tsv
- word-level LIWC scores, validate-liwc_wordscores.tsv
- LIWC dictionary, dictionaries/custom.dic
EXPORT... | remrama/dreamviews | validate-liwc_word_stats.py | validate-liwc_word_stats.py | py | 5,290 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "config.DATA_DIR",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "config.DATA_DIR",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "config.DATA_DIR",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "config... |
29344589576 | #!/usr/bin/python
# -*- encoding: utf-8 -*-
#Created by 'quanpower' on '15-4-4'
#Email:quanpower@gmail.com
#QQ:252527676
#Site:www.smartlinkcloud.com
__author__ = 'quanpower'
import numpy as np
import cv2
#获得视频的格式
videoCapture =cv2.VideoCapture('../files/video_test.rmvb')
#获得码率及尺寸
fps = videoCapture.get(cv2.cv.CV_... | SmartHomeRobot/OpenCV | src/cv_video_play_rmvb.py | cv_video_play_rmvb.py | py | 982 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.cv",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "cv2.cv",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "cv2.cv",
"line_number": ... |
74224406183 | import datetime
import logging
import numpy as np
import os
import skimage.io as io
from sklearn.cluster import KMeans
from skimage import img_as_float
from skimage.color import rgb2lab
from skimage.exposure import equalize_adapthist
from skimage.filters import gaussian
from skimage.transform import resize
from src.d... | AntoineRouland/ki67 | src/v3_Lab_separation/run_v3.py | run_v3.py | py | 6,283 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "src.data_loader.root_dir",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": ... |
43145801264 | # -*- encoding: utf-8 -*-
import os
import time
import pyautogui as auto
import PyHook3 as pyhook
import pythoncom
from PIL import Image
from pytesseract import image_to_string
from googletrans import Translator
import asyncio
import tkinter as tk
# 引入字体模块
import tkinter.font as tkFont
from concurrent.futures import ... | minskiter/capword | index.py | index.py | py | 2,564 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "googletrans.Translator",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tkinter.Tk",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "tkinter.font.Font",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "tkinter.font",
... |
72909209064 | # Объедините функции из прошлых задач.
# Функцию угадайку задекорируйте:
# ○ декораторами для сохранения параметров,
# ○ декоратором контроля значений и
# ○ декоратором для многократного запуска.
# Выберите верный порядок декораторов.
from typing import Callable
from random import randint
import os
import json
def ch... | TatSoz/Python_GB | Sem_9/task_05.py | task_05.py | py | 2,456 | python | ru | code | 0 | github-code | 36 | [
{
"api_name": "typing.Callable",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "random.randint",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "typing.Callable",
"... |
27102703139 | import os
import re
import logging
import json
from datetime import datetime, timedelta
from pathlib import Path
import requests
import spotipy
from spotipy import SpotifyOAuth
from spotipy.oauth2 import SpotifyClientCredentials
from dagster_cron import SystemCronScheduler
from dagster import (
RepositoryDefinitio... | ikedaosushi/ikedaosushi-dagster | spotify.py | spotify.py | py | 6,273 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "spotipy.SpotifyOAuth",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "env.SPOTIPY_CLIENT_ID",
"line_number": 59,
"usage_type": "argument"
},
{
"api_name": "env.SPOTI... |
5371067321 | from splinter import Browser
from bs4 import BeautifulSoup
import time
import pandas as pd
import pymongo
import requests
def init_browser():
executable_path = {"executable_path": "chromedriver.exe"}
return Browser("chrome", **executable_path, headless=False)
def scrape():
browser = init_browser()
# ... | omeza3547/web-scraping-challenge | Mission_to_Mars/scrape_mars.py | scrape_mars.py | py | 3,060 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "splinter.Browser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
... |
7775693352 | from torch.utils.data import Dataset
from torchvision import transforms
import numpy as np
import pandas as pd
import random
from src.dataset import get_load_data
import torch
from tqdm import tqdm
def generate_train_set(train):
train_set = []
classes = [i[1] for i in train]
classes = np.array(classes)
... | tappyness1/triplet-loss-revisit | src/dataloader.py | dataloader.py | py | 1,930 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.argwhere",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number... |
73036997545 | from data_handler import DataHandler
from scanner import Scanner
from datetime import datetime
from queue import Queue
from threading import Thread
import sys
def printStats(devices_count, sensor_type):
time = datetime.now().strftime("%H:%M:%S")
print("%s | %d {:>4} devices found.".format(
sensor_type... | AlexNaga/rpi-people-counter | scanner/main.py | main.py | py | 1,832 | python | en | code | 25 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "queue.Queue",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "threading.Thread"... |
22911051083 | # %%
from typing import Dict, List
from kfp import dsl
@dsl.component(base_image="zhuwq0/quakeflow:latest")
def cut_templates(
root_path: str,
region: str,
config: Dict,
index: int = 0,
model_path: str = "../PhaseNet/",
mseed_list: List = None,
protocol: str = "file",
bucket: str = ""... | YuancongGou/QuakeFlow | slurm_MON/cut_templates.py | cut_templates.py | py | 17,298 | python | en | code | null | github-code | 36 | [
{
"api_name": "typing.Dict",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "numpy.memmap",
"line_number":... |
20528028503 | import os
import re
import xlrd
import xlwt
from xlutils.copy import copy
class HandleExcel:
def __init__(self):
self.root = ''
self.dir = ''
self.files = ''
self.allFile_url = ''
self.final_file_name = '测试数据清洗版.xls'
self.title = ['条码内容', '故障通道', '测试时间']
self... | chenyaqiao0505/Code111 | HandleExcel/excel_method.py | excel_method.py | py | 3,916 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.walk",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "xlrd.open_workbook",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "xlwt.Workbook",
"line_number": ... |
33552308938 | #!/usr/bin/env python3
import os
import logging
import argparse
import csv
def process_result(result_folder):
status = "success"
summary = []
paths = []
tests = ["TLPWhere", "TLPGroupBy", "TLPHaving", "TLPWhereGroupBy", "TLPDistinct", "TLPAggregate"]
for test in tests:
err_path = '{}/{}.... | ByConity/ByConity | docker/test/sqlancer/process_sqlancer_result.py | process_sqlancer_result.py | py | 2,749 | python | en | code | 1,352 | github-code | 36 | [
{
"api_name": "os.path.exists",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_n... |
1436356058 | import pathlib
import math
import pygame as pg
# bd is short for board
bd_size = 900
grid_size = bd_size // 19
stone_radius = grid_size // 2
cross_half_len = stone_radius // 3
center_circle = [(3, 3), (3, 9), (3, 15), (9, 3), (9, 9), (9, 15),
(15, 3), (15, 9), (15, 15)]
circle_radius = stone_radius ... | XuanSmallProj/GoBang | src/params.py | params.py | py | 920 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.font.get_default_font",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "pygame.fon... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.