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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6811793818 | from random import random
import numpy as np
import time
from math import *
import os
import sys
sys.setrecursionlimit(10**6)
clusters = []
visible_cells = []
class Cluster:
def __init__(self,m,n):
# Get the dimensions of the grid
self.rows = m
self.cols = n
self.visited_map = np.z... | Luckykantnayak/uav-project-2 | performance_check.py | performance_check.py | py | 8,208 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.setrecursionlimit",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_... |
7595557598 | #!/usr/bin/env python3
import argparse
import sys
import os
from pathlib import Path
import json
import io
import re
import tempfile
import shutil
import copy
re_has_whitespace = re.compile(r"\s+")
re_has_indent = re.compile(r"\s{4}\s+")
re_empty_line = re.compile(r"^\s*$")
def parse_args(args):
parser = argparse... | padresmurfa/yapl | v1/2_modules_from_package/cli.py | cli.py | py | 15,896 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "re.compile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_... |
74446495144 | from typing import Dict, List
from aiplayground.api.bots import Bot
from aiplayground.api.tournaments.models import Participant, Tournament, Match, PlayerQueueEntry, MatchState
from collections import defaultdict
import operator
from aiplayground.exceptions import AlreadyInTournament
from aiplayground.logging import... | jackadamson/AI-Playground | aiplayground/api/tournaments/tournaments.py | tournaments.py | py | 2,268 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "aiplayground.api.bots.Bot",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "aiplayground.api.tournaments.models.Tournament",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "aiplayground.logging.logger.debug",
"line_number": 15,
"usage_ty... |
11602597643 | import streamlit as st
import time
import re
import chardet
import pandas as pd
import numpy as np
import geopandas as gpd
import matplotlib.pyplot as plt
from matplotlib.patches import ConnectionPatch
from functools import wraps
from shapely.geometry import Point
def main():
if 'run' not in st.session_state:
... | spiritdncyer/region-divsion-streamlit | demo-regionDiv.py | demo-regionDiv.py | py | 21,686 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "streamlit.session_state",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "streamlit.session_state",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "streamlit.session_state",
"line_number": 18,
"usage_type": "attribute"
},
{... |
74309241063 | import time, os, boto3, json, decimal
from boto3.dynamodb.conditions import Key
from helpers import send_to_datastream
from helpers import _get_body
from helpers import _get_response
from helpers import DecimalEncoder
try:
dynamodb = boto3.resource('dynamodb')
phase_status_table = dynamodb.Table(os.getenv('... | LCOGT/photonranch-status | phase_status.py | phase_status.py | py | 2,369 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "boto3.resource",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "helpers._get_body",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "helpers._get_response",
... |
18068483494 | # -*- coding:utf8 -*-
import tweepy
import os
import sys
import json
import time
import urllib2
import requests
"""
ref. http://kslee7746.tistory.com/entry/python-tweepy-%EC%82%AC%EC%9A%A9%ED%95%9C-%ED%8A%B8%EC%9C%84%ED%84%B0-%ED%81%AC%EB%A1%A4%EB%A7%81crawling
ref. https://proinlab.com/archives/1562
ref. http://kye... | songjein/polatics | twitter_client.py | twitter_client.py | py | 2,878 | python | en | code | 7 | github-code | 36 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "urllib2.urlopen",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tweepy.OAuthHandler... |
29398421861 | import setuptools
from setuptools import find_namespace_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="JarvisAI",
version="3.9",
author="Dipesh",
author_email="dipeshpal17@gmail.com",
description="JarvisAI is python library to build your own AI... | MrVanHendrix/Beth.Ai | BETH_Ai/BETH_Ai/setup.py | setup.py | py | 1,722 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "setuptools.setup",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "setuptools.find_namespace_packages",
"line_number": 17,
"usage_type": "call"
}
] |
31379873011 | __author__ = 'Vincent'
from scrapy.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors import LinkExtractor
from scrapy.selector import HtmlXPathSelector
from mediascrap.items import NewsItem
import datetime
from pymongo import MongoClient
class ChokomagSpider(CrawlSpider):
"""
A spider cr... | fisheatfish/mediascrap | mediascrap/spiders/chokomag.py | chokomag.py | py | 1,620 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "scrapy.spiders.CrawlSpider",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "scrapy.spiders.Rule",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "scrapy.contrib.linkextractors.LinkExtractor",
"line_number": 38,
"usage_type": "call"
},... |
5618318828 | import cv2
import os
import argparse
def image_folder_to_video(folder_path, output_path):
# Get the list of image filenames
filenames = [os.path.join(folder_path, f) for f in os.listdir(folder_path) if f.lower().endswith('.jpg')]
filenames.sort() # Sort the filenames
# Get the dimensions of the first... | danfinlay/face-lapse | src/picstitch.py | picstitch.py | py | 1,418 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 11,... |
8444325228 | # class s_(object):
import functools
import numbers
import operator
import numpy
import cupy
from cupy._creation import from_data
from cupy._manipulation import join
class AxisConcatenator(object):
"""Translates slice objects to concatenation along an axis.
For detailed documentation on usage, see :func:`... | cupy/cupy | cupy/_indexing/generate.py | generate.py | py | 18,125 | python | en | code | 7,341 | github-code | 36 | [
{
"api_name": "numpy.ScalarType",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "cupy._creation.from_data.array",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "cupy._creation.from_data",
"line_number": 58,
"usage_type": "name"
},
{
"api... |
30394243625 | """
FILES to YAML
"""
import argparse
import json
import json.decoder
import os
from pathlib import Path
import yaml
import yaml.scanner
def walk_thru(startdir: str) -> list:
p = Path(startdir)
a = [str(el).replace('\\', '/').replace(startdir, '') for el in p.rglob('*')]
return a
def read_file_content(... | MaksimPashkovsky/python-labs | week5/task1.py | task1.py | py | 1,452 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "yaml.safe_load",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "yaml.scanner",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_... |
38833898049 | from django.urls import path
from rest_framework.routers import DefaultRouter
from src.dates_api.views import DateViewSet, PopularMonthListView
app_name = "dates_api"
router = DefaultRouter()
router.register("dates", DateViewSet, basename="dates")
urlpatterns = [
path("popular/", PopularMonthListView.as_view(),... | danielkosytorz/dates-DRF-app | backend/src/dates_api/urls.py | urls.py | py | 373 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "src.dates_api.views.DateViewSet",
"line_number": 9,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 12,
"usage_type": "call"
},
... |
71673331943 | import pandas as pd
import datetime as dt
from kucoincli.client import Client
def test_lending_liquidity(quote='USDT'):
"""Obtain max point-in-time liquidity for lending markets in USDT terms"""
client = Client()
l = client.symbols(marginable=True).baseCurrency
liq = {}
for curr in l:
try... | jaythequant/VBToptimizers | research/utils.py | utils.py | py | 1,411 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "kucoincli.client.Client",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "kucoincli.client.Client",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "datetime... |
17952993717 | # -*- coding: utf-8 -*-
"""
Created on Fri Jun 14 13:57:29 2019
@author: Witold Klimczyk
# ICEM
foil = Airfoil(filein = r'E:\propeller\mh_airofils\mh117/mh117.txt', t = 0.001, chord = 0.2)
foil.runFluent(15,.2,1)#
# XFOIL
foil2 = Airfoil(ftype = 'XFOIL', filein = r'E:\AIRFOIL\airfoils/naca0012.txt', t = 0.001, chord ... | Witekklim/propellerDesign | airfoil.py | airfoil.py | py | 30,685 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "matplotlib.rc",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "gc.collect",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number... |
22317892633 | from django.urls import path
from django.conf.urls import include
from django.contrib import admin
from app.accounts.api.v1.views import (
UserCreatView,
UserUpdateView,
GetAuthToken,
AvatarAPIView,
ClubAPIView,
)
app_name = 'accounts'
urlpatterns = [
path('login/', GetAuthToken.as_view(), ... | AndresGomesIglesias/LanTool-Backend | app/accounts/api/v1/urls.py | urls.py | py | 664 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "app.accounts.api.v1.views.GetAuthToken.as_view",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "app.accounts.api.v1.views.GetAuthToken",
"line_number": 17,
"usage_type":... |
43051538216 | import numpy as np
import networkx as nx
import random as pr
import matplotlib.pyplot as pl
import pp
import time
import copy
import sys
import os
import PIL
from Tkinter import *
import tkFileDialog
import tkSimpleDialog
import tkMessageBox
from fomite_ABM import *
from math import *
from PIL import Image
from PIL imp... | malhayashi/childcarefomites | fomite_ABM_GUI.py | fomite_ABM_GUI.py | py | 23,870 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.remove",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "os.remove",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.remove",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.remove",
"line_number": 48,
... |
75096299625 | import requests
from bs4 import BeautifulSoup
import re
def loastone_login():
print('http://na.finalfantasyxiv.com/lodestone/account/login/')
#Get a page from the Loadstone
# returns a BeautifulSoup object
def get_loadstone_page(url,session_id):
#Time format used for cookies
#import time
#time.strftim... | EmperorArthur/Loadstone_Parser | parse_loadstone.py | parse_loadstone.py | py | 5,272 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_numb... |
21252216686 |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | extremenetworks/pybind | pybind/slxos/v17s_1_02/capabilities/bgp/__init__.py | __init__.py | py | 8,050 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pyangbind.lib.base.PybindBase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pyangbind.lib.xpathhelper.YANGPathHelper",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "pyangbind.lib.xpathhelper",
"line_number": 29,
"usage_type": ... |
16232453581 | from faker import Faker
from faker.providers import person, job, company, internet, phone_number
class BaseCard:
def __init__(self, name, family_name, e_mail, priv_phone):
self.name = name
self.family_name = family_name
self.e_mail = e_mail
self.priv_phone = priv_phone
self... | szczesnym/Kodilla-Python | Chapter7/AddressBook.py | AddressBook.py | py | 2,662 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "faker.providers.company",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "faker.Faker",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "faker.providers.person",
"line_number": 49,
"usage_type": "argument"
},
{
"api_name": "faker.... |
6994509380 | from lib.cuckoo.common.abstracts import Signature
class DropBox(Signature):
name = "cloud_dropbox"
description = "Looks up the Dropbox cloud service"
severity = 2
categories = ["cloud"]
authors = ["RedSocks"]
minimum = "2.0"
domains = [
"dropbox.com",
"www.dropbox.com",
... | cuckoosandbox/community | modules/signatures/windows/cloud_dropbox.py | cloud_dropbox.py | py | 689 | python | en | code | 312 | github-code | 36 | [
{
"api_name": "lib.cuckoo.common.abstracts.Signature",
"line_number": 3,
"usage_type": "name"
}
] |
74736328744 | import pyautogui
# Returns two integers, the width and height of the screen. (The primary monitor, in multi-monitor setups.)
screenWidth, screenHeight = pyautogui.size()
# Returns two integers, the x and y of the mouse cursor's current position.
currentMouseX, currentMouseY = pyautogui.position()
print(screenWidth, sc... | davidyu37/fruit-ninja-cv | mouse.py | mouse.py | py | 1,028 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pyautogui.size",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pyautogui.position",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pyautogui.mouseUp",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pyautogui.moveTo",
... |
72076380264 | # SPDX-License-Identifier: LGPL-3.0-only
"""Package for the doorstop.core tests."""
import logging
import os
from typing import List
from unittest.mock import MagicMock, Mock, patch
from doorstop.core.base import BaseFileObject
from doorstop.core.document import Document
from doorstop.core.item import Item
from door... | doorstop-dev/doorstop | doorstop/core/tests/__init__.py | __init__.py | py | 7,484 | python | en | code | 424 | github-code | 36 | [
{
"api_name": "os.path.abspath",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line... |
18317520839 | # ----------------------------------------------------------------------------#
# Imports
# ----------------------------------------------------------------------------#
import random
from flask import Flask, abort, jsonify, request
from flask_cors import CORS
from models import setup_db, Category, Question
# ------... | RaghavGoel13/trivia-solution | backend/flaskr/app.py | app.py | py | 8,877 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "models.setup_db",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
... |
37750672638 | # coding=utf-8
from global_test_case import GlobalTestCase as TestCase
from ..models import Message, WriteItInstance, \
Moderation, Confirmation, OutboundMessage
from popit.models import Person
from django.core import mail
from subdomains.utils import reverse
import datetime
from mock import patch
from django.core.... | ciudadanointeligente/write-it | nuntium/tests/moderation_messages_test.py | moderation_messages_test.py | py | 19,167 | python | en | code | 38 | github-code | 36 | [
{
"api_name": "global_test_case.GlobalTestCase",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "models.WriteItInstance.objects.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "models.WriteItInstance.objects",
"line_number": 20,
"usage_type": "att... |
6790532061 | from django.db import models
from django.conf import settings
from ..querysets.resource import ResourceQuerySet
class ResourceManager(models.Manager):
queryset_class = ResourceQuerySet
def get_queryset(self):
return self.queryset_class(self.model, using=self._db)
def filter_by_project(self, pro... | tomasgarzon/exo-services | service-exo-core/files/managers/resource.py | resource.py | py | 1,318 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.db.models.Manager",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "querysets.resource.ResourceQuerySet",
"line_number": 8,
"usage_type": "name"
},
{
"a... |
20115420162 | import logging
import concurrent.futures
import pandas as pd
import random
import time
import requests
import os
import sys
from datetime import datetime
from utils.vars import *
from utils.common import *
from requests.structures import CaseInsensitiveDict
# Output the logs to the stdout
logging.basicConfig(stream=s... | jotozhun/azure-pre-scale | azure_auth_scale.py | azure_auth_scale.py | py | 17,441 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "logging.INFO",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogg... |
37738454658 | __docformat__ = 'restructuredtext en'
from collections import OrderedDict
import six
from six import string_types
from geoid.util import isimplify
from geoid.civick import GVid
from geoid import parse_to_gvid
from dateutil import parser
from sqlalchemy import event
from sqlalchemy import Column as SAColumn, Integer, U... | CivicSpleen/ambry | ambry/orm/partition.py | partition.py | py | 48,749 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "ambry.util.get_logger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "geoid.parse_to_gvid",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "geoid.parse_to_gvid",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "geoid.p... |
13459025825 | import argparse
class HackAssembler:
def __init__(self):
self.__comp_code = {
"0": "0101010",
"1": "0111111",
"-1": "0111010",
"D": "0001100",
"A": "0110000",
"!D": "0001101",
"!A": "0110001",
"-D": "0001111",
... | zhixiangli/nand2tetris | projects/06/hack_assembler.py | hack_assembler.py | py | 5,017 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 144,
"usage_type": "call"
}
] |
14061601965 | import binascii
import json
import logging
import cv2
import numpy as np
import requests
VIDEO_UPLOAD_URL = 'http://video-fs.like.video/upload_video.php'
IMAGE_UPLOAD_URL = 'http://img-fs.like.video/FileuploadDownload/upload_img.php'
logger = logging.getLogger(__name__)
def upload_video(video_bytes):
files = {... | ThreeBucks/model-deploy | src/utils/cdn_utils.py | cdn_utils.py | py | 3,379 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "binascii.crc32",
"line... |
39916510161 | import os
import re
import xlwt
from tkinter import *
from tkinter.filedialog import askdirectory
from xlwt import Workbook
root=Tk()
root.withdraw()
path=askdirectory()
print(path)
file_names=os.listdir(str(path))
name_lists=[]
output=[]
for file in file_names:
file_path=path + '/' + file
f=open(file_path,'r',... | nigo81/python_spider_learn | TXT处理/readtxt.py | readtxt.py | py | 1,005 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "tkinter.filedialog.askdirectory",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.search",
"... |
37463181641 | import Dataset as datos
import matplotlib.pyplot as plt
import numpy as np
import os
df_ventas = datos.get_df_ventas()
resample_meses = datos.get_resample_meses()
facturacion_por_juego = datos.get_facturacion_por_juego()
cantidad_ventas_por_juego = datos.get_cantidad_ventas_por_juego()
#--------------------... | matinoseda/CPT-datos-ventas | Estadísticas Juegos.py | Estadísticas Juegos.py | py | 5,685 | python | es | code | 0 | github-code | 36 | [
{
"api_name": "Dataset.get_df_ventas",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "Dataset.get_resample_meses",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "Dataset.get_facturacion_por_juego",
"line_number": 9,
"usage_type": "call"
},
{
"a... |
15646853934 | import json
import os
import string
import requests
from selenium import webdriver
from selenium.webdriver.common.by import By
import urllib.request
options = webdriver.ChromeOptions()
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', Fa... | fatbrother/crawler-test | main.py | main.py | py | 9,656 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.dump... |
127603653 | # encoding=utf8
import requests
from lxml import etree
class cityAreaCode():
def __init__(self):
self.url = "http://www.ip33.com/area/2019.html"
def get(self):
page = requests.get(self.url)
page.encoding = 'utf-8'
_element = etree.HTML(page.text)
divs = _element.xpath(... | lazyting/climbworm | python/CityAreaCode.py | CityAreaCode.py | py | 1,228 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "lxml.etree.HTML",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "lxml.etree.tostring",
"li... |
73379175144 | from functools import wraps
from flask import url_for, redirect, session
# 登陆限制装饰器
# 用于需要登陆的页面,如果没有登陆则要求登陆(跳转至登陆页面)
def login_required(func):
@wraps(func)
def wapper(*args, **kwargs):
if session.get('user_id'):
return func(*args, **kwargs)
else:
return redirect(url_for(... | BobXGY/bobqa | decorators.py | decorators.py | py | 419 | python | zh | code | 0 | github-code | 36 | [
{
"api_name": "flask.session.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "flask.redirect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.url_for",
"l... |
27193740899 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import glob
import logging
import argparse
from ngsmetavirus.config import *
from ngsmetavirus.common import check_path, mkdir, read_tsv
from dagflow import DAG, Task, do_dag
LOG = logging.getLogger(__name__)
__version__ = "1.0.0"
__author__ = ("Xingguo Zhang"... | zxgsy520/metavirus | ngsmetavirus/mngs_multi.py | mngs_multi.py | py | 6,833 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "dagflow.Task",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "dagflow.Task",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "ngsmetavirus.common.check... |
21788142764 | import numpy as np
from scipy.constants import G
from scipy.interpolate import interp1d
from astropy.constants import kpc
import general as ge
class zhao(object):
""" Class for generating a potential for a spherical dark matter halo,
using the data generated by the model of Zhao (2009).
Attrib... | Evd-V/Bachelor-thesis | zhao.py | zhao.py | py | 9,478 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "astropy.constants.kpc.value",
"line_number": 66,
"usage_type": "attribute"
},
{
"api_name": "astropy.constants.kpc",
"line_number": 66,
"usage_type": "name"
},
{
"api_name": "general.conv_inv_dens",
"line_number": 67,
"usage_type": "call"
},
{
"api_... |
74586144105 | from collections import defaultdict
def solution(id_list, report, k):
table = defaultdict(int) # 누가 몇번 신고 받은지 체크하는 테이블
answer = [0] * len(id_list)
for repo in set(report):
table[repo.split()[1]] += 1
# k번 이상 신고 받은 사람(report.split(' ')[1])인 경우
# 신고한 사람(report.split(' ')[0]) 메일 발송 횟수 1 추가
... | ycs1m1yk/TWS | Programmers/92334_sjh.py | 92334_sjh.py | py | 551 | python | ko | code | 2 | github-code | 36 | [
{
"api_name": "collections.defaultdict",
"line_number": 4,
"usage_type": "call"
}
] |
14821096504 | # Woman who habitually buys pastries before 5
import json
def find_customers_who_order_multiple_pastries_before_5am() -> list[str]:
"""
Identifies customer ids of customers who
placed orders between midnight and 5am
"""
with open('./noahs-jsonl/noahs-orders.jsonl', 'r') as jsonl_file:
m... | Annie-EXE/Hanukkah-of-Data-2022 | Hanukkah Day 4/main.py | main.py | py | 2,069 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "json.loads",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 47,
"usage_type": "call"
}
] |
42243182620 | import matplotlib.pyplot as plt
import numpy as np
import dill as pickle
sens_to_plot = ['20180314_grav_noshield_cant-0mV_allharm.npy', \
'20180314_grav_shieldin-nofield_cant-0mV_allharm.npy', \
'20180314_grav_shieldin-1V-1300Hz_cant-0mV_allharm.npy', \
'20180314_grav_... | charlesblakemore/opt_lev_analysis | scripts/mod_grav/plot_sensitivity.py | plot_sensitivity.py | py | 1,634 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "numpy.load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
... |
34212052955 | # https://www.acmicpc.net/problem/1260
# solution
# 1) 주어진 입력을 인접행렬로 저장한다
# 2) 현재 정점 그때그때 출력하는 dfs를 돌린다
# 3) bfs 하고 path를 출력한다
# TIL
# adj_mat = [([0,] * n),]*n -> 이런식으로 초기화 하면안됨. copy라 원소의 id값 다 같아지는 문제
# 파이썬 입력으로 input()은 굉장히 느리다. sys.stdin.readline() 사용
# dfs의 경우 최단거리 찾는 문제(탐색 여러번 반복)와 단순히 탐색하는 문제(한번만 탐색) 구분해서 풀자
... | chankoo/problem-solving | graph/1260-DFS와BFS.py | 1260-DFS와BFS.py | py | 2,933 | python | ko | code | 1 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "sys.stdin.readline",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
... |
15695220227 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import scipy.stats
import wbgapi as wb
import seaborn as sns
def world(ind, code, years):
'''
this function returns original data, transposed data and world data for above indicators
Parameters
----------
ind : index
code ... | sunithasomasundaran/ads1_statistics_and_trends_sunitha | assignment2.py | assignment2.py | py | 4,686 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "wbgapi.data.DataFrame",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "wbgapi.data",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "wbgapi.data.DataFrame",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "wbgapi.d... |
5154312569 | from sklearn.datasets import make_circles
from sklearn.datasets import make_blobs
from sklearn.datasets import make_moons
from sklearn.model_selection import train_test_split
class Circles(object):
def __init__(self):
self.X, self.labels = make_circles(n_samples=300, noise=0.1, random_state=5622, factor=0... | peterrrock2/ML_coursework | Homework/Hw4/data/__init__.py | __init__.py | py | 4,114 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sklearn.datasets.make_circles",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets.make_blobs",
"line_number": 16,
"usage_type": "cal... |
5411923106 | import requests
import json
from config import currency
class APIException(Exception):
pass
class Converter:
@staticmethod
def get_price(base, sym, amount):
try:
base_key = currency[base.lower()]
except KeyError:
raise APIException(f'Валюта {base} н... | kopitski/SkillFactory | Exchange_bot/extensions.py | extensions.py | py | 1,243 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "config.currency",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "config.currency",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "requests.request",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "json.loads",
"li... |
71960613545 | import matplotlib.pyplot as plt
import numpy as np
from sklearn.metrics import confusion_matrix
import itertools
from PIL import Image as PIL
def show_image(image, cmap=None):
plt.figure(figsize=(12, 12))
plt.imshow(image, cmap=cmap)
plt.show()
def show_images(images, labels=None):
if labels:
... | fukuta0614/active_learning | shared/PIA/analysis.py | analysis.py | py | 3,289 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.imshow",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "mat... |
73172240425 | import cv2
import numpy as np
class VideoCamera(object):
def __init__(self):
self.video = cv2.VideoCapture(0)
def __del__(self):
self.video.release()
def get_frame(self):
while True:
a="Not Found"
lower_green = np.array([45, 140, 50])
upper_green =... | ishivanshgoel/Technocrats-T1 | camera.py | camera.py | py | 936 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_numb... |
20081039110 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
# !pip install numpy
# !pip install pandas
# !pip install matplotlib
# !pip install sklearn
# !pip install dmba
# !pip install statsmodels
# !pip install yellowbrick
# In[2]:
import pandas as pd
import numpy as np
df = pd.read_csv("data/medical_clean.csv")
outcome ... | cjhammons/Multiple-Linear-Regression-on-Medical-Data | submission/multiple-linear-regression.py | multiple-linear-regression.py | py | 4,028 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pandas.Categorical",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.hist",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "matplotlib.... |
9710179885 | import random
from random import randint
import pygame
from essais.essai_dijkstra_damier import title
from lib_dijkstra import DijkstraManager, Point, pyrect_to_point, point_to_pyrect
verbose = False
class Entity(pygame.sprite.Sprite):
def __init__(self, name, x, y, screen=None):
super().__init__()
... | bermau/PW_19_pygamon | src/player.py | player.py | py | 10,618 | python | fr | code | 0 | github-code | 36 | [
{
"api_name": "pygame.sprite",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pygame.Rect",
... |
20948666331 | import os
import os.path as osp
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data as data
from torch import optim
from torch.utils.tensorboard import SummaryWriter
from sklearn.metrics import confusion_matrix
from model.refinenet import Segmentor
from mod... | ElhamGhelichkhan/semiseggan | train.py | train.py | py | 17,083 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.ones_like",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "torch.save",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
37407105905 | import pandas as pd
from sklearn.tree import DecisionTreeClassifier, plot_tree
import matplotlib.pyplot as plt
from sklearn.preprocessing import LabelEncoder
# read in your data
df = pd.read_excel("CreditRisk.xlsx")
# define your independent and dependent variables
X = df[['Volume', 'Value', 'Age']]
y = df[... | HyperionDevBootcamps/C4_DS_lecture_examples | Lecture code/Machine Learning/Decision Trees/Decision_Trees_cat.py | Decision_Trees_cat.py | py | 702 | python | en | code | 37 | github-code | 36 | [
{
"api_name": "pandas.read_excel",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.tree.DecisionTreeClassifier",
"line_number": 19,
"usage_type": "call"
},
... |
33589796845 | import scrapy
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
class fist_bookSpider(CrawlSpider):
name = 'fist_book'
allowed_domains = ['books.toscrape.com']
start_urls = ['http://books.toscrape.com/']
rules = (
Rule(LinkExtractor(), callback='pars... | andycortex/blog-scraper | first_book.py | first_book.py | py | 598 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "scrapy.spiders.CrawlSpider",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "scrapy.spiders.Rule",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "scrapy.linkextractors.LinkExtractor",
"line_number": 12,
"usage_type": "call"
}
] |
30133687535 | #!/ust/bin/python3
import fire
import sys
from functools import reduce
import os.path
red = '\033[0;31m'
green = '\033[0;32m'
yellow = '\033[0;33m'
blue = '\033[0;34m'
purple = '\033[0;35m'
cyan = '\033[0;36m'
white = '\033[0;37m'
end = '\033[0m'
host_file = '/etc/hosts'
new_file_path = None
def log_error(*msg):
... | Kuangcp/Script | python/tool/switch-host-group/app.py | app.py | py | 5,437 | python | en | code | 10 | github-code | 36 | [
{
"api_name": "functools.reduce",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 130,
"usage_type": "call"
},
{
"api_name": "os.path.path.exists",
"line_number": 171,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"l... |
74429979942 | import streamlit as st
from fastai.vision.all import *
import plotly.express as px
import pathlib
from streamlit_option_menu import option_menu
from apps import home, app, contact
temp = pathlib.PosixPath
with st.sidebar:
navbar = option_menu("Main Menu", ["Home", "Project", "Contact"],
i... | farkhod-developer/DL_Image_Classification_Model | manage.py | manage.py | py | 1,434 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pathlib.PosixPath",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "streamlit.sidebar",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "streamlit_option_menu.option_menu",
"line_number": 11,
"usage_type": "call"
},
{
"ap... |
14086949836 | import streamlit as st
from pages.common.queries import run_query
from pages.common.presenter import display_result
from pages.common.utils import convert_template
from pages.common.plotting import get_figure
import logging
logging.getLogger("pybatfish").setLevel(logging.WARNING)
APP = """This is a Streamlit app th... | martimy/Bat-Q | pages/2_Analysis.py | 2_Analysis.py | py | 1,801 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.WARNING",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "streamlit.set_page_config",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "stream... |
69930126823 | import pygame
import BulletClass
from EnemiesControllerClass import EnemiesController
class PlayerShip:
ShipSpeed = 7
# Static variable containing all the bullets the ship has fired
BULLET_RESOURCE = "../Resources/Images/bullet.png"
Bullets = []
def __init__(self, imageLocation, screenSize):
... | ErikTillberg/Space_Invaders_Clone | Game/PlayerShipClass.py | PlayerShipClass.py | py | 2,586 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.image.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pygame.transform.scale",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.tra... |
34445125382 | #!/usr/bin/env python
import os
import sys
import fileinput
import datetime
import logging
logFile = 'setup.log'
logging.basicConfig( filename = logFile,filemode = 'w', level = logging.INFO,format = '%(asctime)s - %(levelname)s: %(message)s', datefmt = '%m/%d/%Y %I:%M:%S %p' )
#import poaMenu
def g... | maratP/poa-devops | poa-node-setup.py | poa-node-setup.py | py | 7,598 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "imp.load_source",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "fileinput.input... |
20583493606 | import numpy as np
import cv2
import math
cap = cv2.VideoCapture(0)
while(True):
ret,frame = cap.read()
img = cv2.imread('D:/HW/OpenCV Workshop - distro2/OpenCV Workshop/tek1.png')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
cv2.imshow('frame', gray)
if cv2.waitKey(1) & 0xFF == ord('q'):
b... | Altair115/OpenCV2-Workshop | Opdrachten/Op2.py | Op2.py | py | 363 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_... |
31219990233 | import logging
import os
import sys
from logging import Logger
from typing import Any, Dict, List
import datasets
import torch
import transformers
import wandb
from transformers import TrainingArguments
from dp_arguments import DataTrainingArguments, ModelArguments
LABEL_DICT = {}
LABEL_DICT['ner'] = ['CARDINAL', 'D... | yileitu/probing-via-prompting | utils.py | utils.py | py | 9,989 | python | en | code | null | github-code | 36 | [
{
"api_name": "torch.zeros_like",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "torch.autograd",
"line_number": 56,
"usage_type": "attribute"
},
{
"api_name": "typing.Dict",
"line_number": 67,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"l... |
23295546136 | import tensorflow as tf
from tensorflow.keras import Sequential
from tensorflow.keras.layers import Flatten, Dense, Dropout, BatchNormalization, Conv2D, MaxPool2D
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.preprocessing import image
print(tf.__version__)
import numpy as np
import pandas as p... | Ryan-Red/MoviePosters | main.py | main.py | py | 2,665 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tensorflow.__version__",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras... |
3726457813 | from DQNAgent import DQNAgent
from pathlib import Path
my_file = Path("my_model.hd5")
if my_file.is_file():
Agent = DQNAgent("my_model.hd5")
else:
Agent = DQNAgent()
for i in range(1500):
Agent.observe()
Agent.train()
rewards = 0
for _ in range(10):
rewards += Agent.play()
print(rewards / 3)
Ag... | sojunator/DV2454Proj | Q_ml_keras.py | Q_ml_keras.py | py | 353 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "DQNAgent.DQNAgent",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "DQNAgent.DQNAgent",
"line_number": 8,
"usage_type": "call"
}
] |
25441622848 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='member',
options={},
... | MJafarMashhadi/CodeDescriptionInformationCollector | core/migrations/0002_auto_20160107_1255.py | 0002_auto_20160107_1255.py | py | 648 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterModelOptions",
"line_number": 14,
"usage_type": "call"
... |
72398212263 | from django import forms
from django.forms import Textarea
from .models import Comment, Post
class PostForm(forms.ModelForm):
class Meta:
model = Post
fields = ("text", "group", "image")
widgets = {
"text": Textarea(
attrs={"class": "form-control", "placeholder... | EISerova/yatube-social-network | yatube/posts/forms.py | forms.py | py | 738 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "models.Post",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.forms.Textar... |
18977859509 | from dask.distributed import Client, wait
import dask.dataframe as dd
import os
from shapely.geometry import LineString, Polygon, Point, box
from shapely import wkb
import rtree
import xarray as xr
import pandas as pd
import pyarrow as pa
index_url = './../data/roads'
df_url = './../data/osm_roads/roads.parquet'
clie... | maximyudayev/YY-MANET-Protocol | local/network_graph_build_no_dem.py | network_graph_build_no_dem.py | py | 7,549 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "dask.distributed.Client",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "shapely.wkb.loads",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "shapely.wkb",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "shapely.wkb.loa... |
20436996206 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('customer', '0009_auto_20151012_1449'),
('tab1', '0001_initial'),
]
operations = [
migrations.AddField(
m... | wlj459/unipub | tab1/migrations/0002_contactus_customer.py | 0002_contactus_customer.py | py | 505 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AddField",
"line_number": 15,
"usage_type": "call"
},
{
... |
37439980327 | import pandas as pd
from pathlib import Path
import numpy as np
from data_cleaning import clean_data
from data_preparation import data_preparation
INPUT_TEST_PATH = Path('data/raw/test.csv')
OUTPUT_PATH = Path('data/test_with_predicted_revenue/')
if __name__ == "__main__":
test_df = pd.read_csv(INPUT_TEST_PATH)
... | LlirikOknessu/brightika_test | linear_prod_version.py | linear_prod_version.py | py | 932 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "data_cleaning.clean_data",
... |
28205621966 | from typing import Dict, List, Optional, Union
from fastapi import APIRouter, Depends, Response, status
from sqlalchemy.orm import Session
from src import oauth, schemas
from src.db.database import get_db
from src.services import post as post_service
router = APIRouter(prefix="/posts", tags=["Blog Posts"])
@router.... | hiteshsankhat/blog_post | backend/src/api/endpoints/posts.py | posts.py | py | 1,700 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "fastapi.Depen... |
28686029068 | import json
import pandas as pd
from os.path import join
PROJECT_PATH = '../../'
event = pd.read_csv(join(PROJECT_PATH, 'data', 'LinearSearchThreadEvent.csv'),
header=None,
names=['Id', 'RootEventId', 'UserIdentifier', 'CreationDate', 'DiffSeconds', 'EventSource',
... | kbcao/sequer | code/DatasetExtraction/eventList_extraction.py | eventList_extraction.py | py | 1,645 | python | en | code | 15 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.Int64Dtype",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.Int64Dtype",
... |
6699760535 | from compat.legacy_model import LegacyModel
from customer.customers import CustomerObjectMap
import os
from common.io.interactive import query_yes_no
BASE_MODEL_DIR = r"E:\viNet_RnD\Deployment\Inference Models\Inception"
def create_candidate_model_legacy(class_map,
network_version=N... | h3nok/MLIntro | Notebooks/cli/legacy_cli.py | legacy_cli.py | py | 1,995 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "customer.customers.CustomerObjectMap.keys",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "customer.customers.CustomerObjectMap",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "customer.customers",
"line_number": 29,
"usage_type": "nam... |
13989770988 | from collections import deque
class Solution:
def wallsAndGates(self, rooms):
def neighbors(x, y):
for (i, j) in ((x - 1, y), (x + 1, y), (x, y - 1), (x, y + 1)):
if 0 <= i < n and 0 <= j < m and rooms[i][j] > 0:
yield (i, j)
def bfs(start):
... | dariomx/topcoder-srm | leetcode/zero-pass/facebook/walls-and-gates/Solution.py | Solution.py | py | 1,023 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 13,
"usage_type": "call"
}
] |
9098896290 | import os
import numpy as np
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFilter
from PIL import ImageFont
from tqdm import tqdm
train_dir = "dataset/train/"
test_dir = "dataset/test/"
# digit generation
def digit_generator(
digit="1",
font_name="/usr/share/fonts/truetype/custom/Hind... | rednafi/prinumco | digit_generation_src/digit_generation.py | digit_generation.py | py | 4,386 | python | en | code | 10 | github-code | 36 | [
{
"api_name": "PIL.Image.new",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "PIL.ImageDraw.Draw",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "PIL.ImageDraw",
"line_... |
9268710699 | import cv2
import numpy as np
import time
import os
from cobit_opencv_lane_detect import CobitOpencvLaneDetect
class CobitOpenCVGetData:
def __init__(self):
self.cap = cv2.VideoCapture('data/car_video.avi')
self.cv_detector = CobitOpencvLaneDetect()
self.image = None
self.angle = ... | cobit-git/little-cobit-web-ctrl | cobit_opencv_get_data_backup.py | cobit_opencv_get_data_backup.py | py | 1,512 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cobit_opencv_lane_detect.CobitOpencvLaneDetect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.imencode",
"line_number": 18,
"usage_type": "call"
},
{
"api_n... |
32022624457 | #Load variable from a file. Userstat.txt
#USerstat.txt has first line as whether user wants to choose more projects, and next lines has names of all projects user has chosen.
#We have to create a login function here for the user, else, how would the app know which userfile to download.?
#For now let's simply ask the ... | snehalgupta/issc | pcapp/app.py | app.py | py | 2,900 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "urllib.request.request.urlopen",
"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... |
39305646033 | import asyncio
import logging
import os
import threading
import uuid
from time import sleep
from pywintypes import Time
from win32con import FILE_SHARE_DELETE, FILE_SHARE_READ, GENERIC_WRITE, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, \
FILE_SHARE_WRITE
from win32file import CreateFile, CloseHandle, SetFileTime
from A... | SanketRevankar/AndroidFTP-DataBackup | AndroidFTPBackup/helpers/BackupHelper.py | BackupHelper.py | py | 7,605 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "AndroidFTPBackup.utils.BackupUtils.BackupUtils.date_from_timestamp",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "AndroidFTPBackup.utils.BackupUtils.BackupUtils",
"line_n... |
17498596227 | import time
import tkinter as tk
import tkinter.ttk as ttk
import tkinter.messagebox as tkmsg
from ttkthemes import ThemedTk
from PIL import ImageTk, Image
from geoCosiCorr3D.geoImageCorrelation.geoCorr_utils import splitcall, project_path, clamp
import geoCosiCorr3D.geoImageCorrelation.geoCorr_utils as utils
def r... | SaifAati/Geospatial-COSICorr3D | geoCosiCorr3D/geoCosiCorr3D_GUI/geoImageCorrelation_GUI/tk_utils.py | tk_utils.py | py | 20,960 | python | en | code | 37 | github-code | 36 | [
{
"api_name": "ttkthemes.ThemedTk",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "tkinter.ttk.Style",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "tkinter.ttk",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "tkinter.ttk.Frame",
... |
35056056600 | from src.reduction import ReductionMethod
import cantera as ct
def main() -> None:
"""
Edit all the variables in this function to perform the reduction.
Right now, it has DRG and DRGEP. Put all the state files in a folder and pass
the folder path to load the condition.
The automation of the resu... | fingeraugusto/red_app | main_app.py | main_app.py | py | 1,201 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cantera.Solution",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "src.reduction.ReductionMethod",
"line_number": 29,
"usage_type": "call"
}
] |
42211653033 | import ipywidgets
from ipywidgets import *
from IPython.display import display, Markdown
all_options=[]
all_answers=[]
all_feedback=[]
options1=['ASIC, SoC, FPGA, MPSoC', 'FPGA, SoC, ASIC, MPSoC', 'SoC, ASIC, FPGA, MPSoC', 'ASIC, MPSoC, FPGA, SoC']
ans1='ASIC, SoC, FPGA, MPSoC'
fb1_a='Correct! We know ASICs are appli... | philipwu62/xilinx_XUP_notebooks | lib/fpga_widg.py | fpga_widg.py | py | 3,813 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "IPython.display.display",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "IPython.display.Markdown",
"line_number": 72,
"usage_type": "call"
}
] |
5514632684 | # -*- coding: UTF-8 -*-
from Courier import Courier,Order,debugFlag,OrdersPerSecond
import queue,sys,statistics
import time,json
import threading
def GetNextOrder(prepareTime):
courier = Courier();
o=Order(courier,prepareTime);
return o
if __name__ == '__main__':
try:
with open('dispatch_o... | slideclick/2021ccs | execu/main.py | main.py | py | 1,525 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "Courier.Courier",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "Courier.Order",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number... |
71104421224 | #!/usr/bin/env python
# -*- coding=UTF-8 -*-
# Created at May 26 10:07 by BlahGeek@Gmail.com
import sys
if hasattr(sys, 'setdefaultencoding'):
sys.setdefaultencoding('UTF-8')
import os
import httplib2
import requests
from BeautifulSoup import BeautifulSoup
from .settings import COOKIR_PATH
BASE_URL = 'http://3g.... | blahgeek/treehole | treehole/renren.py | renren.py | py | 1,318 | python | en | code | 30 | github-code | 36 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.Session",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "settings.COOKIR_PATH",
"line_number": 21,
"usage_type": "argument"
},
{
"api_name": "reque... |
7755902959 | import logging
from typing import Any, Callable, Coroutine, Dict, List, Optional, Union
import attr
from geojson_pydantic.geometries import (
GeometryCollection,
LineString,
MultiLineString,
MultiPoint,
MultiPolygon,
Point,
Polygon,
)
from pydantic import validator
from pydantic.types impor... | microsoft/planetary-computer-apis | pcstac/pcstac/search.py | search.py | py | 3,330 | python | en | code | 88 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "stac_fastapi.pgstac.types.search.PgstacSearch",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 33,
"usage_type": "name"
},
{
"a... |
14783455392 | '''
ME 598 CUDA
Homework 2
Author: Hien (Ryan) Nguyen
Last modified: 01/28/2018
'''
import numpy as np # import scientific computing library
import matplotlib.pyplot as plt # import plotting library
from numba import cuda
import math
import time
from mpl_toolkits import mplot3d
''' Question 2 func... | ryannguyen94/CUDA | HW2/hw2.py | hw2.py | py | 9,498 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "math.sin",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "math.sinh",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 24,... |
21135250267 | # Databricks notebook source
# MAGIC %md
# MAGIC ## 2D Linear Regression
# MAGIC
# MAGIC #### Description
# MAGIC
# MAGIC This notebook is designed to provide a very basic insight into linear regression and how to utilise sklearn to perform it on datsets.
# MAGIC
# MAGIC In this notebook linear regression is performed ... | NHSDigital/sde_example_analysis | python/machine_learning_small_data/regression_simple.py | regression_simple.py | py | 7,838 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 78,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "... |
27479098786 |
import os
import pika # Importa a biblioteca pika para interagir com o RabbitMQ
import time # Importa a biblioteca time para controlar o tempo de sleep do loop
import socket # Importa socket para verificar a conectividade com a internet
import json # Importa json para manipular dados JSON
import random # Importa ... | elderofz1on/ZionArchive | Projetos/MachineSimulatorMQTT/sensor_simulator.py | sensor_simulator.py | py | 7,987 | python | pt | code | 0 | github-code | 36 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"line_num... |
73122366504 | from django.db import models
from django.contrib.auth.models import User
from ckeditor_uploader.fields import RichTextUploadingField
# Create your models here.
class System(models.Model):
name = models.CharField(max_length=20, verbose_name='System')
owner = models.ForeignKey(User, verbose_name='Owner', on_de... | ikofan/sh6 | codes/models.py | models.py | py | 5,282 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.db.models.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "... |
39901505337 | from collections import OrderedDict
from django.core.urlresolvers import resolve
def link_processor(request):
"""
This function provides, to all pages, a dict of links called "page_links".
These links contain {"name": "tag"} for a name of a page to a view tag.
These are used to automatically populate... | brhoades/sweaters-but-with-peer-reviews | middleware/links.py | links.py | py | 712 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "collections.OrderedDict",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.core.urlresolvers.resolve",
"line_number": 19,
"usage_type": "call"
}
] |
25196942976 | import numpy as np
import argparse
### Arguments ###
parser = argparse.ArgumentParser()
parser.add_argument('input', type=str, help='Input text file')
parser.add_argument('fmap', type=str, help='Map with value and residue')
parser.add_argument('chain', type=str, help='Chain identifier to match residues')
parser.add_a... | JAMelendezD/Contacts | paint_pdb.py | paint_pdb.py | py | 2,209 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "argparse.BooleanOptionalAction",
"line_number": 10,
"usage_type": "attribute"
}
] |
26409275029 | #这个是我自己写的,过了前80个Case 过不了最后一个 超时了
#代码随想录的前两个答案也超时,只有那个用字典的不超时
'''
class Solution:
def findItinerary(self, tickets: List[List[str]]) -> List[str]:
self.result = []
tickets.sort()
used = [False] * len(tickets)
self.backtracking(['JFK'],used,tickets)
return self.result
def ... | lpjjj1222/leetcode-notebook | 332. Reconstruct Itinerary.py | 332. Reconstruct Itinerary.py | py | 2,563 | python | zh | code | 0 | github-code | 36 | [
{
"api_name": "collections.defaultdict",
"line_number": 42,
"usage_type": "call"
}
] |
5185686033 | import re
import ssl
import requests
import urllib.request
from lxml import etree
from fake_useragent import UserAgent
from concurrent.futures import wait, ALL_COMPLETED
from .common import Anime, Seed, Subgroup
class Mikan:
def __init__(self, logger, config, executor):
self.url = config['URL']
sel... | FortyWinters/autoAnime | src/lib/spider.py | spider.py | py | 12,664 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "fake_useragent.UserAgent",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "lxml.etree.HTML",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
... |
14003011170 | import json
import requests
import random
import re
baseUrl = "http://jw1.yzu.edu.cn/"
session = requests.Session()
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36',
'Content-Type': 'application/x-www-form-urlencoded'... | Rickenbacker620/Codes | Python/stuff/urp.py | urp.py | py | 2,979 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.Session",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "re.S",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "random.randint",
"line_numbe... |
3587126567 | # -*- coding: utf-8 -*-
"""
Binarization
Feature binarization is the process of thresholding numerical features to
get boolean values.
"""
from sklearn.model_selection import train_test_split
from sklearn import preprocessing
import numpy as np
import pandas as pd
from scipy import signal,stats
from flas... | KaifangXu/APIs | Data_pre/Binarization.py | Binarization.py | py | 2,972 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.exists",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "codecs.open",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number... |
13961966989 | from django import forms
from django.db import transaction
from django.utils.translation import gettext as _
from ..models import Duplicate, HelperShift
class MergeDuplicatesForm(forms.Form):
def __init__(self, *args, **kwargs):
self.helpers = kwargs.pop("helpers")
super(MergeDuplicatesForm, sel... | helfertool/helfertool | src/registration/forms/duplicates.py | duplicates.py | py | 4,063 | python | en | code | 52 | github-code | 36 | [
{
"api_name": "django.forms.Form",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.forms.ModelMultipleChoiceField",
"line_number": 14,
"usage_type": "call"
},
{
"api_name"... |
15287647409 | from django.test import TestCase
from users.forms import UserUpdateForm
class TestForms(TestCase):
def test_update_form_valid_data(self):
"""Test for valid update form"""
form = UserUpdateForm(data={
'username': 'Praveen',
'email': 'Praveen.t@gmail.com'
})
... | ardagon89/deploying-a-email-classification-model-in-a-full-stack-website | singularity/users/test/test_forms.py | test_forms.py | py | 572 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.test.TestCase",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "users.forms.UserUpdateForm",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "users.forms.UserUpdateForm",
"line_number": 19,
"usage_type": "call"
}
] |
72655723623 | import os
import sys
import math
from tqdm import tqdm
import pandas as pd
import numpy as np
sys.path.insert(1, os.path.join(sys.path[0], '..'))
from util import argparser
def permutation_test(df, column, n_permutations=100000, batch_size=1000):
# Get actual batch size
batch_size = min(batch_size, n_permuta... | rycolab/form-meaning-associations | src/h04_analysis/get_results_per_token.py | get_results_per_token.py | py | 3,405 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.path.insert",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
5297089787 | import asyncio
import json
import logging
import logging.config
from dataclasses import dataclass
import yaml
from web3 import Web3
from web3._utils.filters import LogFilter
@dataclass
class FilterWrapper:
event_filter: LogFilter
pair_name: str
oracle_address: str
logger: logging.Logger
class Block... | dzahbarov/blockchain_monitor | monitor.py | monitor.py | py | 2,721 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "web3._utils.filters.LogFilter",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "logging.Logger",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 12,
"usage_type": "name"
},
{
"api_name"... |
6846890085 | import pandas as pd
import sqlite3
def connect_sqlite(db_file):
with sqlite3.connect(db_file) as conn:
conn.row_factory = sqlite3.Row
cur = conn.cursor()
return conn, cur
def get_dataframe(db_file, sql):
conn, cur = connect_sqlite(db_file)
df = pd.read_sql(sql,conn)
... | tcref/helloworld | helloworld/tcref/src/main/webpy_rest/check_db/statistics.py | statistics.py | py | 895 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlite3.connect",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sqlite3.Row",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_sql",
"line_number": 14,
"usage_type": "call"
}
] |
6529596584 | """
The `test.unit.sha_api.mybottle.sha_api_bottle_test` module provides unit tests for the `ShaApiBottle` class in
`sha_api.mybottle.sha_api_bottle`.
Classes:
TestShaApiBottle: A unit test class for the `ShaApiBottle` class.
"""
import json
import tempfile
import unittest
from bottle import ConfigDict # pylint:... | ju2wheels/python_sample | python/test/unit/sha_api/mybottle/sha_api_bottle_test.py | sha_api_bottle_test.py | py | 4,614 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "tempfile.NamedTemporaryFile",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "tempfile.NamedTemporaryFile",
"line_number": 39,
"usage_type": "call"
},
{
"ap... |
21159707752 | # --------------
#Importing header files
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#Path of the file
path
#Code starts here
#Reading the file
data=pd.read_csv(path)
#Renaming a column
data.rename(columns={'Total':'Total_Medals'},inplace=True)
#Printing the first five colu... | nagnath001/olympic-hero | code.py | code.py | py | 4,367 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_... |
14141185614 | import requests
import json
import urllib.parse
from django.conf import settings
def current_place():
"""
現在地の緯度経度を取得する。
Returns:
int: 現在地の緯度、経度
"""
geo_request_url = "https://get.geojs.io/v1/ip/geo.json"
geo_data = requests.get(geo_request_url).json()
# print(geo_data['latitud... | nicenaito/theatreCheckIn | theatreplaces.py | theatreplaces.py | py | 2,354 | python | ja | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.API_MAP",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "r... |
38107931605 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('article', '0002_remove_article_article_date'),
]
operations = [
migrations.AddField(
model_name=... | Evgeneus/blog-django-1.7 | article/migrations/0003_article_article_date.py | 0003_article_article_date.py | py | 494 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AddField",
"line_number": 15,
"usage_type": "call"
},
{
... |
71300192743 | import itertools
import tqdm
import subprocess
def add_to_seq(seq, feature, label):
if label[0] == 'B':
seq.append(feature)
elif label[0] == 'I':
if len(seq) > 0:
seq[-1] += feature
else:
seq.append(feature)
elif label[0] == 'S':
seq.append(feature)
... | YaooXu/Chinese_seg_ner_pos | evaluate.py | evaluate.py | py | 9,381 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "tqdm.tqdm",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "itertools.chain.from_iterable",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"line_number": 53,
"usage_type": "attribute"
},
{
"api_name": "subproce... |
43034357184 | import datetime
import os
import time
import xarray as xr
from app.dataprocessing.benchmark import Timer
from app.dataprocessing.datasource_interface import IDatasource
from app.dataprocessing.local.local_reader import LocalReader
from app.dataprocessing.remote.opendap_access_cas import OpendapAccessCAS
from app.datas... | oyjoh/adaptive-data-retrieval | app/dataprocessing/data_handler.py | data_handler.py | py | 5,439 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "app.datastructures.datastructure_interface.INode",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "app.datastructures.datastructure_interface.get_bounds",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number":... |
21877552923 | import os
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives.hashes import SHA256
from cryptography.hazmat.primitives.asymmetric import padding
# save file... | Marcus11Dev/Blockchain_Lesson_Agent | create_Keys.py | create_Keys.py | py | 1,319 | 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.abspath",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cryptography.hazmat.prim... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.