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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
40125515571 | import uuid
from .alexa_utils import get_utc_timestamp
class AlexaResponse:
def __init__(self, **kwargs):
self.correlation_token = kwargs.get('correlation_token', None)
self.cookies = {}
self.include_endpoint = kwargs.get('include_endpoint', True)
self.payload = {}
self.... | Ernestyj/PyProj | alexa-smarthome/sample_backend/lambda/lambda_api/python/alexa/skills/smarthome/alexa_response.py | alexa_response.py | py | 2,228 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "uuid.uuid4",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alexa_utils.get_utc_timestamp",
"line_number": 45,
"usage_type": "call"
}
] |
9638481335 | import requests
import os
from twilio.rest import Client
# my position: 40.708979,286.017400, 106.017400
OWM_Endpoint = "https://api.openweathermap.org/data/2.5/onecall"
weather_parameter = {
"lat":40.708979,
"lon": 106.017400,
"exclude": "current,minutely,daily",
"appid": os.environ.get("OWN_A... | na-lin/100-days-of-Python | day35-Rain-Alert/main.py | main.py | py | 1,104 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "twilio.rest.Client",
... |
40720540996 | import random
import art
def check(guess, num):
if guess == num:
print("You win!")
return 1
elif guess > num:
print("Your guess is higher.")
else:
print("Your guess is lower.")
def game():
print("welcome to the Number Guessing Game!\nI'm thinking of a number between 1 ... | abishekbalaji/hundred_days_of_code_python | number-guessing-game/guess_the_number.py | guess_the_number.py | py | 1,217 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "art.logo",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "random.randint",
"line_number": 18,
"usage_type": "call"
}
] |
9186763090 | import argparse
import os
import re
import zipfile
_PACKAGE_RE = re.compile(r'(package)\s+([\w\.]+);')
def _get_file_map_entry(java_file_path, java_file):
"""Returns the top-level Java class and header file path tuple.
Args:
java_file_path: The file path of the source Java file.
java_file: The actual fi... | bazelbuild/bazel | tools/j2objc/j2objc_header_map_binary.py | j2objc_header_map_binary.py | py | 3,522 | python | en | code | 21,632 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"line_... |
8860175496 |
import json
import datetime #for reading present date
import time
import requests #for retreiving coronavirus data from web
from plyer import notification #for getting notification on your PC
import http.client
from threading import Thread
import csv
import sys
mylist=[]
def fetchCoinValue(id):
... | danielgabor99/blockchainrepo | p5.py | p5.py | py | 2,411 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "http.client.client.HTTPSConnection",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "http.client.client",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "http.client",
"line_number": 16,
"usage_type": "name"
},
{
"api_name":... |
29140704316 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from PIL import Image
import random as r
from math import *
#---------FONCTIONS DE BASE---------
def ouvrir(nomimage):
#Creer l'objet image a partir du fichier image, exemple : nomimage='lena.jpg'
img=Image.open(nomimage)
#Renvoie l'objet image a partir du fichie... | BrandidiCH4O4/Code-des-cours | COURS/Culture num/Utilitaire.py | Utilitaire.py | py | 1,974 | python | fr | code | 0 | github-code | 6 | [
{
"api_name": "PIL.Image.open",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "PIL.Image.new",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number":... |
23037166832 | #-*- coding: utf-8 -*-
import os,sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # 1단계 상위폴더를 sys path에 추가
import json, time, uuid, datetime
from pytz import utc
from waitress import serve
from flask_uuid import FlaskUUID
from flask import Flask, Response, request, send_file
from pathlib... | genycho/dummy_server_example | dummy_be/dummy_be.py | dummy_be.py | py | 6,510 | python | ko | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
18804702067 | from typing import Dict, List, Optional, TypeVar, Union
import pandas as pd
import ujson
from pymilvus.client.abstract import SearchResult
from pymilvus.client.types import Replica
from pymilvus.exceptions import (
ExceptionsMessage,
MilvusException,
PartitionNotExistException,
)
from .mutation import Mu... | milvus-io/pymilvus | pymilvus/orm/partition.py | partition.py | py | 25,514 | python | en | code | 744 | github-code | 6 | [
{
"api_name": "typing.TypeVar",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "typing.TypeVar",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "collection.Collection",
... |
13692292509 | """Provide the Reason class."""
from typing import Any, Dict, Generator, Optional, TypeVar, Union
from ...const import API_PATH
from ...exceptions import ClientException
from .base import RedditBase
_RemovalReason = TypeVar("_RemovalReason")
Reddit = TypeVar("Reddit")
Subreddit = TypeVar("Subreddit")
class RemovalR... | addsisem/Terf-Incel_Anaylsis | interp/Lib/site-packages/praw/models/reddit/removal_reasons.py | removal_reasons.py | py | 6,049 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "typing.TypeVar",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "typing.TypeVar",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "typing.TypeVar",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "base.RedditBase",
"lin... |
29685811177 | revision = '024eb25bb08f'
down_revision = 'e9573113afd2'
from alembic import op
import sqlalchemy as sa
from sqlalchemy import sql
def upgrade():
insert_table = sql.table(
u'amphora_roles',
sql.column(u'name', sa.String),
sql.column(u'description', sa.String)
)
op.bulk_insert(
... | BeaconFramework/Distributor | octavia/db/migration/alembic_migrations/versions/024eb25bb08f_add_roles_to_amphora.py | 024eb25bb08f_add_roles_to_amphora.py | py | 443 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sqlalchemy.sql.table",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.sql",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.sql.column",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.... |
40125954043 | import os
import copy
import time
import torch
import pickle
import pandas as pd
import numpy as np
import torch.nn.functional as F
from torch.utils import data
from torch import dropout, nn
from prettytable import PrettyTable
from torch.utils.data import SequentialSampler
from sklearn.metrics import mean_squared_erro... | AlexandrNP/BindingScoresDRP | dl_scripts/DeepDrugRegressor.py | DeepDrugRegressor.py | py | 12,384 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.device",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.Dataset",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "pandas.Da... |
37118647018 | from enum import StrEnum
from pydantic import BaseModel, HttpUrl, field_serializer
from pydantic_core import Url
from app.schemas import WeaponType
class WeaponSubstatType(StrEnum):
attack = 'Attack %'
critical_rate = 'Critical Rate %'
critical_damage = 'Critical Damage %'
defence = 'Defense %'
... | EymireWorld/gi-data | app/weapon/schemas.py | schemas.py | py | 1,822 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "enum.StrEnum",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "pydantic.HttpUrl",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "app.schemas.WeaponTyp... |
69939236348 | from xml.etree.ElementTree import ParseError
from numpy import source
import pytest
import os
from fault_tolerant_routing_mux.rr_graph_parser import RRGraphParser
BASE_DIR = "tests/sample_files"
def test_no_file():
with pytest.raises(TypeError):
rrgp = RRGraphParser()
def test_empty_file():
with pytes... | gaialucas/fault-tolerant-routing-mux | tests/test_parse_rr_graph.py | test_parse_rr_graph.py | py | 1,971 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "pytest.raises",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "fault_tolerant_routing_mux.rr_graph_parser.RRGraphParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 13,
"usage_type": "call"
},
{
... |
19363541428 | # -*- coding: utf-8 -*-
"""
Created on Mon Jul 13 15:16:47 2020
@author: OCAC
"""
import requests
from win10toast import ToastNotifier
import json #retrieve data from API in json format
import time
def update():
r=requests.get("https://coronavirus-19-api.herokuapp.com/all")
data=... | AnkitM18-tech/Random-Python | covid19bot.py | covid19bot.py | py | 595 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "win10toast.ToastNotifier",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 21,
"usage_type": "call"
}
] |
32604197630 | from django.urls import path
from base.views.auth_view import LogoutView, UserLoginView
from base.views.category_view import (
CategoryCreateView, CategoryDeleteView, CategoryListView,
CategoryUpdateView, category_search
)
from base.views.color_view import (
ColorCreateView, ColorDeleteView, ColorListView,... | SainezKimutai/test-capital | base/urls.py | urls.py | py | 10,845 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "base.views.auth_view.UserLoginView.as_view",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "base.views.auth_view.UserLoginView",
"line_number": 76,
"usage_type": "name"
... |
73111916987 | #!/usr/bin/env python
# write by sonnonet 1.5Ver
# 2023-12-05
# CO2 Rev 2.4
# THL Rev 1.6 Extenstion
# PH Rev 1.0
# Serial to Print
# Data Format
# CO2 Data0
# THL Temperature Data0, Humidity Data1, Illumination Data2, Battery Data3
import sys
import tos
import datetime
import threading
from influxdb import InfluxD... | sonnonet/2023_inhatc | Zigbee/Oscilloscope/oscilloscope.py | oscilloscope.py | py | 2,354 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "tos.Packet",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "tos.Packet.__init__",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tos.Packet",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"l... |
71719656829 | from collections import namedtuple
from math import floor
import matplotlib.pyplot as plt
from canvas import Canvas
from color import color
from tuple import point, normalize, vector3, x, y
projectile = namedtuple('Projectile', 'position velocity')
environment = namedtuple('Environment', 'gravity wind')
def tick(e... | mournival/raytracerchallenge-py | putting_it_together/projectile.py | projectile.py | py | 1,323 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.namedtuple",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tuple.point",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tuple.norma... |
26633016264 | import sys
from datetime import datetime
from tkinter import *
import time
# loading Python Imaging Library
from PIL import ImageTk, Image
# To get the dialog box to open when required
from tkinter import filedialog
import numpy as np
import cv2
import os
import cv2
import numpy as np
# This is a line segmentation... | nadershoulan/HWRS | charachter_segmentation/Segmentation/imaglineseg.py | imaglineseg.py | py | 2,362 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "tkinter.filedialog.askopenfilename",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "os.path.basename",
"line_number": 25,
"usage_type": "call"
},
{
"api_name":... |
44179337495 | from gensim.models import word2vec
from bin2op import parse, unique, counts, nextIndex
import numpy as np
import math
import sys
np.set_printoptions(threshold=sys.maxsize)
file =sys.argv[1]
syntax = "intel"
shellcode, code, opcodes, operands, instructions = parse(file, syntax, None)
sentences = instructions
ops = un... | d-demirci/metu-r3v-ml | word2vector.py | word2vector.py | py | 783 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.maxsize",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "bin2op.parse",
... |
16909201634 | """
Linda Lin
1/15/2021
Input: CRISPRme best file (top 1000 sites or more, without on-target)
Output: top OT plots for CRISPRme manuscript
(Note: will get runtime warnings but all are fine to ignore)
"""
import pandas as pd
import numpy as np
import math
import matplotlib.pyplot as plt
import matplotlib.patches as m... | pinellolab/CRISPRme | plot_generation_paper/old_script/CRISPRme_plots.py | CRISPRme_plots.py | py | 7,315 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.use",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "sys.argv",
... |
2856031008 | import unittest
from conans.test.tools import TestClient
from conans.paths import PACKAGES_FOLDER, CONANINFO, EXPORT_FOLDER,\
CONAN_MANIFEST
import os
from conans.model.manifest import FileTreeManifest
from time import time
conan_vars1 = '''
[settings]
arch=x64
os=Windows
compiler=Visual Studio
co... | AversivePlusPlus/AversivePlusPlus | tools/conan/conans/test/command/search_test.py | search_test.py | py | 9,728 | python | en | code | 31 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 79,
"usage_type": "attribute"
},
{
"api_name": "conans.test.tools.TestClient",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "conans.paths.PACKAGES_FOLDER",
"line_number": 98,
"usage_type": "name"
},
{
"... |
35307706805 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from httpfpt.common.log import log
from httpfpt.core import get_conf
class DingTalk:
def __init__(self, content: dict):
self.content = content
def send(self) -> None:
try:
import requests
headers = {'Content-Type': 'appl... | wu-clan/httpfpt | httpfpt/utils/send_report/ding_talk.py | ding_talk.py | py | 1,694 | python | en | code | 21 | github-code | 6 | [
{
"api_name": "httpfpt.core.get_conf.TEST_REPORT_TITLE",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "httpfpt.core.get_conf",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "httpfpt.core.get_conf.PROJECT_NAME",
"line_number": 21,
"usage_type": ... |
20631048020 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Python framework for developing training data for neural network emulators of
RRTMGP gas optics scheme; to be run from /examples/ml-training within the
RTE+RRTMGP library
Another script (1/3) generates INPUT data for RRTMGP (saving to a netCDF file)
according to us... | earth-system-radiation/rrtmgp-nn-training | examples/ml-training/scripts_and_data/ml_generate_outputs.py | ml_generate_outputs.py | py | 3,542 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.getcwd",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "netCDF4.Dataset",
"line_number": 76,
"usage_type": "call"
}
] |
11754957202 | # This application will read the mailbox data (mbox.txt) and count the number of email messages per organization (
# i.e. domain name of the email address) using a database with the following schema to maintain the counts.
import sqlite3
conn = sqlite3.connect('maildatab.sqlite')
cur = conn.cursor()
#initial Counts ... | monmarupeddi/PYTHON-4-EVERYBODY | python4/emailcount-in-db/emaildbcount.py | emaildbcount.py | py | 1,188 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 6,
"usage_type": "call"
}
] |
906967297 | from starlette.status import (
HTTP_200_OK,
HTTP_201_CREATED,
HTTP_401_UNAUTHORIZED,
HTTP_409_CONFLICT,
)
from starlette.testclient import TestClient
from .test_auth import get_random_logged_user
def create_enterprise(
client: TestClient,
name="somename",
nip_number="0623601757",
addr... | hawkesky/vatcalc | app/tests/test_enterprise.py | test_enterprise.py | py | 2,549 | python | en | code | null | github-code | 6 | [
{
"api_name": "starlette.testclient.TestClient",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "starlette.testclient.TestClient",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "test_auth.get_random_logged_user",
"line_number": 27,
"usage_type": "call... |
27261938261 | import os
import pathlib
import re
def get_keys():
log_keys_path = os.path.join(
pathlib.Path(__file__).parent.absolute(), "../common/logging/log_key.h"
)
f = open(log_keys_path)
text = f.read()
print(text)
list_of_keys = re.search(r"enum LogKey.\{(.*?)\};", text, re.DOTALL).group(1)... | superjax/rtk_factor_graph | plotting/plot_keys.py | plot_keys.py | py | 528 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 15... |
41016621180 | import matplotlib.pyplot as plt
import pandas as pd
def plot():
before = pd.read_csv("female.csv")
#after = pd.read_csv("afterFemale.csv")
plt.scatter(before.number, before.value, color='red', label='before deformations F')
#plt.scatter(after.number, after.value, color='red', label='after deformations ... | akauffmann4/plotting | mainPrincipalComponents.py | mainPrincipalComponents.py | py | 920 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "pandas.read_... |
39476676805 | """
为线上图库中的部位做整合处理
若A,B整合,则将A的所有节点查询出来,增加到B节点,并将A节点的所有东西删除--弃:要去重
将A,B两点都查出来,然后去重,增加到新节点
"""
from py2neo import Node, Relationship, Graph
from pandas import DataFrame
import json
# import codecs
import re
# 本地测试库
graph = Graph(
host="127.0.0.1", # neo4j 搭载服务器的ip地址,ifconfig可获取到
http_port=7474, ... | zhang8929/zhangyuguang | zhangyuan/db/merge_sth.py | merge_sth.py | py | 16,483 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "py2neo.Graph",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 17... |
71066875069 | from manimlib.utils.tex_file_writing import tex_hash
from manimlib.utils.directories import get_tex_dir
import requests
import urllib
from fake_headers import Headers
import os
import re
# from helium import *
# import pyperclip
def tex_to_svg_file_online(tex_file_content):
""" Using the online latex compiler: ht... | beidongjiedeguang/manim-express | manim_express/utils/onlinetex.py | onlinetex.py | py | 3,051 | python | en | code | 13 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "manimlib.utils.directories.get_tex_dir",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "mani... |
34632070313 | # -*- coding: utf-8 -*-
# @Author: Xingmo
import cv2
img = cv2.imread('test.jpg')
# split 返回BGR三个通道
b,g,r = cv2.split(img)
# merged 通道合并
merge = cv2.merge([b,g,r])
cv2.imshow('merge',merge)
#cv2.imshow("Red", r)
#cv2.imshow("Green", g)
#cv2.imshow("Blue", b)
cv2.waitKey(0)
cv2.destroyAllWindows()
| liuyuhua-ha/opencvStudy | MixImg.py | MixImg.py | py | 325 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.split",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.merge",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 14,
... |
28734403975 | """Jena/Fuseki data API client to manage data."""
from .base import FusekiBaseClient
from ..utils import build_http_file_obj
class FusekiDataClient(FusekiBaseClient):
"""Fuseki 'data' API client (data service)."""
def _build_uri(self, ds_name, *, service_name=None):
"""Build service URI.
:p... | Nobatek/fuseki-manager | fuseki_manager/api_client/data.py | data.py | py | 1,745 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "base.FusekiBaseClient",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "utils.build_http_file_obj",
"line_number": 46,
"usage_type": "call"
}
] |
8451911626 | from userbot import LANGUAGE, LOGS
from json import loads, JSONDecodeError
from os import path, remove
LOGS.info("Dil dosyası yükleniyor...")
LANGUAGE_JSON = None
if LANGUAGE_JSON == None:
if path.isfile(f"./userbot/language/{LANGUAGE}.xjson"):
try:
LANGUAGE_JSON = loads(... | LavanderProjects/XUserBot | userbot/language.py | language.py | py | 1,520 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "userbot.LOGS.info",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "userbot.LOGS",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "os.path.isfile",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numbe... |
30061563834 | from datetime import datetime
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
def log_hello():
print("hello from the dag")
dag = DAG(
'hello_world_dag',
description='A simple DAG that logs "hello from the dag"',
schedule_interval='@once',
start_date=datetime(20... | guilherme-tavares-indicium/hyland_airflow_dags | airflow/dags/hello_world_dag.py | hello_world_dag.py | py | 459 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "airflow.DAG",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "airflow.operators.python_operator.PythonOperator",
"line_number": 16,
"usage_type": "call"
}
] |
34039379808 | from fastapi import APIRouter, Depends
from fastapi.encoders import jsonable_encoder
from fastapi.responses import JSONResponse
from server.api.organizations.schemas import OrganizationCreate
from server.application.organizations.commands import CreateOrganization
from server.application.organizations.queries import G... | etalab/catalogage-donnees | server/api/organizations/routes.py | routes.py | py | 1,512 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "server.api.organizations.schemas.OrganizationCreate",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "server.config.di.resolve",
"line_number": 30,
"usage_type": "call"
... |
23972797322 | #!/usr/bin/env python3
import Adafruit_PCA9685
import time
import rospy
import numpy as np
from buggycontrol.msg import Actions
from utils import loaddefaultconfig
class PWMDriver:
def __init__(self):
self.config = loaddefaultconfig()
self.pwm_freq = int(1. / self.config["update_period"])
... | silverjoda/buggycontrol | src/nodes/pwmdriver.py | pwmdriver.py | py | 1,590 | python | en | code | null | github-code | 6 | [
{
"api_name": "utils.loaddefaultconfig",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "Adafruit_PCA9685.PCA9685",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "rospy.init_node",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "rosp... |
12374932188 | import random
import requests
from .data import NOUNS_DICTIONARY, ADJECTIVES_DICTIONARY, WORD_DICTIONARY
#def __fetch_usernames():
# r = requests.get('https://raw.githubusercontent.com/jeanphorn/wordlist/master/usernames.txt')
# r.raise_for_status()
# return [l for l in r.text.split('\n') if len(l) > 2]
# us... | xransum/databuild | databuild/username.py | username.py | py | 1,577 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "random.randrange",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "random.randrange",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "random.randrange",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "random.randrange",... |
71892740989 | from transformers import GPT2LMHeadModel, AutoTokenizer
model_name = 'gpt2'
model = GPT2LMHeadModel.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)
# Set pad_token
tokenizer.add_special_tokens({'pad_token': '[PAD]'})
max_length = 50
previous_responses = []
while Tr... | Zinedinarnaut/ChatBot-using-GPT-2 | chatbot.py | chatbot.py | py | 1,689 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "transformers.GPT2LMHeadModel.from_pretrained",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "transformers.GPT2LMHeadModel",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "transformers.AutoTokenizer.from_pretrained",
"line_number": 5,
"u... |
86572079170 | import argparse
import os.path
import re
import sys
from mako.template import Template
TEMPLATE_RS = Template("""\
// Copyright © 2024 Collabora Ltd. and Red Hat Inc.
// SPDX-License-Identifier: MIT
// This file is generated by lib_rs_gen.py. DO NOT EDIT!
#![allow(unused_imports)]
<%def name="import_mod(m, path)">... | sailfishos-mirror/mesa | src/nouveau/headers/lib_rs_gen.py | lib_rs_gen.py | py | 2,341 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "mako.template.Template",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "os.path.path.basename",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "o... |
18606906413 |
import flask
from flask import request, render_template
from flask import send_file
import os
from PIL import Image
import numpy as np
from utils import *
from keras.models import load_model
import tensorflow as tf
import keras
print(tf.__version__)
print(keras.__version__)
model = load_model("point65_v2.h5")
app = fl... | mtjin/VisionApp | Real_VisionApp/mirror_servercode.py | mirror_servercode.py | py | 4,522 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "tensorflow.__version__",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "keras.__version__",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "keras.models.load_model",
"line_number": 14,
"usage_type": "call"
},
{
"api_na... |
23397239542 | from GUI.Backend.ScraperPrototype import ScraperPrototype
import time
from datetime import datetime
from selenium.common import NoSuchElementException
from selenium.webdriver.common.by import By
import pandas as pd
import undetected_chromedriver as uc
import os
class ErosScraper(ScraperPrototype):
def __init__(se... | PauloDrefahl/NetspiderHSI | GUI/Backend/Scraper/ErosScraper.py | ErosScraper.py | py | 14,167 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "GUI.Backend.ScraperPrototype.ScraperPrototype",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.today",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 78,
"usage_type": "name"
},
... |
43185323431 | import random
import sys
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
df = pd.read_csv("Medals.csv")
pie = []
labels = []
others = []
mycolors = []
colors = ['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd','#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf']
for i in df.index :
i... | punsnx/TCASTHH | Python/37.py | 37.py | py | 804 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",... |
6971513047 | import pandas as pd
import matplotlib.pyplot as plt
dataset = pd.read_csv('../data/census.csv')
# O histograma baseado nos intervalos padrões criados pelo Pandas mostrou que não foi uma boa distribuição.
# O Jones mostrou na solução do exercício uma maneira de criar intervalos manuais e é essa solução que coloquei
# a... | rveneroso/python-iaexpert-estatistica_cd_ml-distribuicao-frequencia | src/exercicio_1.py | exercicio_1.py | py | 743 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pandas.cut",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
32836858416 | """
PROJECT 1 - Doubly Linked List + Recursion
Name: Chris Li
"""
from __future__ import annotations # allow self-reference
from typing import TypeVar, Generic, Callable # function type
from random import randint, seed
from Project1.Node import DoublyLinkedListNode as Node
T = TypeVar("T")
class List:
"""
... | qil04/Double_linked_List | List.py | List.py | py | 11,153 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.TypeVar",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "typing.Generic",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "Project1.Node.DoublyLinkedListNode",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "Proj... |
38755958670 | # Common setup.py code shared between all the projects in this repository
import sys
import os
import logging
from setuptools.command.test import test as TestCommand
from setuptools.command.egg_info import egg_info as EggInfoCommand
class PyTest(TestCommand):
pytest_args = []
src_dir = None
def initiali... | man-group/pytest-plugins | common_setup.py | common_setup.py | py | 2,639 | python | en | code | 526 | github-code | 6 | [
{
"api_name": "setuptools.command.test.test",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "setuptools.command.test.test.initialize_options",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "setuptools.command.test.test",
"line_number": 15,
"usage_typ... |
10360353601 | from PreviewDialog.UI.PreviewDialog import Ui_FileDialogWindow
from PyQt5.QtWidgets import QFileDialog, QMessageBox, QDialog, QTableWidgetItem
class PreviewDialog(QDialog, Ui_FileDialogWindow):
def __init__(self, parent=None):
super(PreviewDialog, self).__init__(parent)
self.setupUi(self)
... | mandeling/MathStatistics | PreviewDialog/__init__.py | __init__.py | py | 2,281 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "PreviewDialog.UI.PreviewDialog.Ui_FileDialogWindow",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QFileDialog.Options",
"line_number": 18,
"usage_... |
1370610247 | """
Calculates statistics like most wins by a franchise, most wins by a coach, most
mvps by player based on Super Bowl data.
"""
import csv
from collections import Counter
from collections import namedtuple
legacy_franchises = {
"Indianapolis Colts": "Baltimore Colts",
"Los Angeles Chargers": "San Diego Charg... | craighillelson/super_bowls | super_bowls.py | super_bowls.py | py | 11,771 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "csv.reader",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",... |
37400707041 | from __future__ import print_function
import numpy as np
from copy import deepcopy
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import transforms
import torch.nn.utils.rnn as rnn_utils
class BaselineCNN(nn.Module):
def __init__(self, img_size=16, channels=1, kernel_size=3, ... | hokysung/gameoflife_cognition | models.py | models.py | py | 8,626 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
72283495549 | import psaw
import progressbar
import re
from collections import defaultdict, namedtuple
import argparse
import json
import ast
api = psaw.PushshiftAPI()
comment_regex = re.compile(r"""\[\*\*\*(?P<name>.+)\*\*\*\].+fanfiction.net\/s\/(?P<id>\d+)""")
FicComment = namedtuple('FicComment', ['name', 'id', 'score... | FanfictionBot/fanfictionbot.github.io | related-fics.py | related-fics.py | py | 3,707 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "psaw.PushshiftAPI",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "collections.defaul... |
21415110276 | """Module containing the authentication API of the v1 API."""
from .models.auth import AccessTokenSchema, UserSchema
from typing import Dict
from flask.helpers import url_for
from flask.views import MethodView
from dataclasses import dataclass
from http import HTTPStatus
from flask_jwt_extended import (
create_acc... | buehlefs/flask-template | flask_template/api/v1_api/auth.py | auth.py | py | 2,960 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "fla... |
25554990759 | import tornado.ioloop
import tornado.web
import tornado.gen
import tornado.tcpserver
from tornado.iostream import StreamClosedError
class StreamHandler(tornado.web.RequestHandler):
CLIENTS = []
def initialize(self):
print('Client connected')
self.CLIENTS.append(self)
def on... | cipriantarta/python-capture | server.py | server.py | py | 2,250 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "tornado.ioloop.web",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "tornado.ioloop",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "tornado.ioloop.web",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "tornado.... |
38577743485 | import pandas as pd
from transformers import AutoTokenizer,T5ForConditionalGeneration
import torch
import torch.nn as nn
import argparse
from torch import optim
parser = argparse.ArgumentParser(description="pytorch emotion classify")
parser.add_argument('--cuda',type = bool,default=True,help='use cuda')
parser.add_arg... | littlepeachs/Grey-box-attack | src/train_cls.py | train_cls.py | py | 6,495 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.nn.CrossEntropyLoss",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "torch.n... |
1710951811 | #!/usr/bin/env python
import scipy
import pylab
import libyawff
import cPickle as pickle
dt = 1.0/3000.0
run_params = {
'dt' : dt,
'yaw_inertia' : 3.22,
'yaw_damping' : 0.0,
'yaw_torq_lim' : 0.5,
'yaw_torq_deadband' : 0.0,
'yaw_filt_lpcut' : 10.0,
'yaw_f... | willdickson/yawff | python/examples/yawff_w_ctlr_test.py | yawff_w_ctlr_test.py | py | 1,954 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "libyawff.INTEG_RKUTTA",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "libyawff.FF_ON",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "libyawff.CTLR_ON",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "... |
1310018065 | import torch
import torch.nn as nn
import torch.nn.functional as functional
class MLPActorCritic(nn.Module):
def __init__(self,
ranges_shape,
target_points_shape,
body_fets=(64, 32, 16, 8),
num_actions=3):
super(MLPActorCritic, self).__in... | Bartolo1024/RL-Local-Path-Planning | agents/nets/ac_models/mlp_model.py | mlp_model.py | py | 1,216 | python | en | code | 21 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
44844111823 | import os
import torch
import wandb
import numpy as np
import torch.nn.functional as F
from tqdm.auto import tqdm, trange
from stable_baselines3.common.vec_env import DummyVecEnv
from trajectory.utils.env import vec_rollout, create_env
from trajectory.models.gpt.ein_linear import EinLinear
from trajectory.utils.sched... | Howuhh/faster-trajectory-transformer | trajectory/models/gpt/gpt_trainer.py | gpt_trainer.py | py | 7,900 | python | en | code | 90 | github-code | 6 | [
{
"api_name": "trajectory.utils.common.weight_decay_groups",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 80,
"usage_type": "attribute"
},
{
"api_name": "trajectory.models.gpt.ein_linear.EinLinear",
"line_number": 80,
"usage_type": "... |
5459474809 | import requests
from django.http import HttpResponseRedirect
from rest_framework.views import APIView
from requests_oauthlib import OAuth1, OAuth1Session
from datetime import datetime
from .serializers import TwitterCredentialsSerializer, TwitterProfileSerializer
from .models import TwitterCredentials, TwitterProfile
... | shettyrakshit/Twitter-integration-v2 | twitter/oauth/views.py | views.py | py | 9,857 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests_oauthlib.OAuth1Session",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "requests_oauthlib.OAuth1",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": ... |
2655249457 | # Essential Function
import cv2 as cv
img = cv.imread('photos/itachi.jpg')
cv.imshow('Itachi', img)
# Converting to grayscale
gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
# cv.imshow('Itachi_gray', gray)
# Blur
blur = cv.GaussianBlur(img, (3, 3), cv.BORDER_DEFAULT) # 3,3 is kernel size(width and height ... | TenzinTsundue/Computer-Vision-task | OpenCV-Related/essential_function.py | essential_function.py | py | 918 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number... |
37366654258 | #!/usr/bin/env python3
from pylab import *
import matplotlib.pyplot as plt
import numpy as np
import math
from common import *
if dim != 1 :
print ("Error: can not plot 1d data (dim=%d)" % dim)
sys.exit()
lc = ['b', 'r', 'k', 'c', 'm', 'y']
fig, ax = plt.subplots(1, 1, figsize=(8, 5))
idx_vec = range(1, n... | zwpku/EigenPDE-NN | plot_scripts/plot_1d_FVD_and_nn.py | plot_1d_FVD_and_nn.py | py | 2,157 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "numpy.linspace",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.loa... |
4639990522 | import importlib # For importing other python files, especially configuration.
import os.path # Needed for various system path operations.
import platform # Import module »platform« to be able to get the user’s operating system.
import re # Regular expressions.
import requests # Web requests.
import sys ... | weidengeist/Willowbot | modules/basics.py | basics.py | py | 17,207 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "time.perf_counter",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "time.perf_counter",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "time.perf_counter",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "re.sub",
"l... |
22780218102 | from typing import List
from project.robots.base_robot import BaseRobot
from project.robots.female_robot import FemaleRobot
from project.robots.male_robot import MaleRobot
from project.services.base_service import BaseService
from project.services.main_service import MainService
from project.services.secondary_service... | DanieII/SoftUni-Advanced-2023-01 | oop/exam/project/robots_managing_app.py | robots_managing_app.py | py | 3,301 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "project.services.main_service.MainService",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "project.services.secondary_service.SecondaryService",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "project.robots.male_robot.MaleRobot",
"line_num... |
22367956697 | """
This file is part of YAOS and is licenced under the MIT licence.
Common utilities used by multiple submodules.
"""
import gettext
gettext.bindtextdomain('yaosapp', '/lang')
gettext.textdomain('yaosapp')
_ = gettext.gettext
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import GdkPixbu... | tom66/scopeapp | Utils.py | Utils.py | py | 10,884 | python | en | code | 16 | github-code | 6 | [
{
"api_name": "gettext.bindtextdomain",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "gettext.textdomain",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "gettext.gettext",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "gi.requi... |
19423775977 | from dataclasses import dataclass
import yaml
import jinja2
import geopandas as gpd
TEMPLATE = """
overrides:
{% for grid_size, links in restrictions.items() %}
{{ grid_size }}:
{%- for link in links %}
links.{{ link.location_A }},{{ link.location_B }}.techs.ac_transmission.constraints.energy_... | timtroendle/geographic-scale | src/construct/grid_size_restrictions.py | grid_size_restrictions.py | py | 2,959 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "geopandas.read_file",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "jinja2.Template",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "yaml.safe_l... |
37693691122 | from mesa.visualization.ModularVisualization import VisualizationElement
class ContinuousCanvas(VisualizationElement):
local_includes = ["autonomous_intersection/continuous_canvas.js"]
portrayal_method = None
canvas_height = 500
canvas_width = 500
def __init__(self, portrayal_method, canvas_heigh... | GrzegorzNieuzyla/Autonomous-Intersection | autonomous_intersection/continuous_canvas.py | continuous_canvas.py | py | 964 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "mesa.visualization.ModularVisualization.VisualizationElement",
"line_number": 4,
"usage_type": "name"
}
] |
32144845205 | # !pip install fair-esm
# from google.colab import drive
# drive.mount('/content/drive')
import pandas as pd
import torch
from torch.utils.data import Dataset
import esm
import numpy as np
import csv
import os
from tqdm import tqdm
from sklearn.utils import shuffle
import tensorflow as tf
class pharos(Dataset):
d... | txz32102/paper | pharos/esm2_t6_8M_UR50D.py | esm2_t6_8M_UR50D.py | py | 18,165 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "esm.pretrained.esm2_t33_650M_UR50D",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "esm.pretrained",
"line_number": 41,
"usage_type": "attribute"
},
{
"a... |
18654804504 | from bs4 import BeautifulSoup
import src.helper as helper
'''
Requirement: Admin permission.
Description: Parse a TIOJ problem's testcase list. Collect all the id for each testcase (use the file name for identification).
Return value: A dictionary with the testcase file name as key, the id string array as value.
''... | baluteshih/tioj-problem-tools | src/problem_handler/get_data_idmap.py | get_data_idmap.py | py | 815 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 14,
"usage_type": "call"
}
] |
5349262932 | import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522
from gpiozero import LED
import signal
import time
import asyncio
import requests
class Timeout():#class for timeout of input
class Timeout(Exception):
pass
def __init__(self,sec):
self.sec = sec
def __enter__(self):
... | jonahcancio/unlockitsocket_rpi | rfid_coroutine.py | rfid_coroutine.py | py | 3,770 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "signal.signal",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "signal.SIGALRM",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "signal.alarm",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "signal.alarm",
"li... |
21101356863 | import http
import os
from enum import Enum, auto
from shutil import copytree
import click
import requests
from dateutil import parser as datetime_parser
from flask import current_app, request, render_template, Blueprint
webhook = Blueprint('webhook', __name__)
class RequestType(Enum):
UNKNOWN = auto()
INCI... | Cobliteam/statuspage2slack | statuspage2slack/webhook.py | webhook.py | py | 2,467 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Blueprint",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "enum.auto",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "enum.auto",
"line_number": 16... |
71851475068 | #!/usr/bin/python3
"""The `amenities` module"""
from flask import jsonify, abort, request, make_response
from api.v1.views import app_views
from models import storage
from models.amenity import Amenity
@app_views.route("/amenities", methods=["GET"], strict_slashes=False)
def list_all_amenities():
"""Lists all a... | Navi212/AirBnB_clone_v3 | api/v1/views/amenities.py | amenities.py | py | 2,079 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.storage.all",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "models.amenity.Amenity",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "models.storage",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "flask.js... |
41052589163 | # -*- coding: utf-8 -*-
"""
Author: spicer bak, phd
Contact: spicer.bak@usace.army.mil
Association: USACE CHL Field Research Facility
my own library with useful functions and tips from which i found to be helpful
on various general functions that don't fit into specific other codes
this folder needs to be added to sy... | SBFRF/FRF_bathy_netCDF | sblib.py | sblib.py | py | 37,737 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "imageio.imread",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "imageio.mimwrite",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.size",
"line_numb... |
21390321933 | import os
import sys
import urllib
import requests
import pandas as pd
from datetime import datetime
from datetime import timedelta
from pathlib import Path
from argparse import ArgumentParser, RawTextHelpFormatter
YEARS = ['2017', '2018', '2019', '2020', '2021']
MONTHS = list(range(1, 13))
INTERVALS = ["1m", "5m", "1... | Howii/binance-archive | util.py | util.py | py | 9,560 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "datetime.datetime",
"line_number": 71,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.today",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "datetime... |
14574623199 | from brian2.parsing.rendering import NodeRenderer
class LEMSRenderer(NodeRenderer):
expression_ops = NodeRenderer.expression_ops.copy()
expression_ops.update({
# BinOp
'Pow': '^',
# ??? 'Mod': '%',
# Compare
'Lt': '.lt.',
'LtE': '.le.',
'Gt... | brian-team/brian2tools | brian2tools/nmlexport/lemsrendering.py | lemsrendering.py | py | 1,312 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "brian2.parsing.rendering.NodeRenderer",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "brian2.parsing.rendering.NodeRenderer.expression_ops.copy",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "brian2.parsing.rendering.NodeRenderer.expression_op... |
21071680783 |
import numpy as np
class SimpleSegmentation:
def __init__(self):
self.max_length_seconds = 15 # Seconds
self.min_length_seconds = 3 # Seconds
self.max_length_frames = self.max_length_seconds * 16000
self.min_length_frames = self.min_length_seconds * 16000
self.always_cr... | centre-for-humanities-computing/Gjallarhorn | data_processing/simple_segmentation.py | simple_segmentation.py | py | 2,069 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.random_integers",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "ffmpe... |
705346460 | import pytest
from anoncreds.protocol.primary.primary_proof_builder import fourSquares
def testQuadEquationLagranges():
delta = 85
u = fourSquares(delta)
print("u1: {0} u2: {1} u3: {2} u4: {3}".format(u['0'], u['1'], u['2'],
u['3']))
assert (u['0'] *... | hyperledger-archives/indy-anoncreds | anoncreds/test/test_quad_equation_lagranges.py | test_quad_equation_lagranges.py | py | 515 | python | en | code | 24 | github-code | 6 | [
{
"api_name": "anoncreds.protocol.primary.primary_proof_builder.fourSquares",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "anoncreds.protocol.primary.primary_proof_builder.fourSquares",
"lin... |
30671074856 | import pymongo
# ------------Database----------
DB_URL = "mongodb+srv://mdisk:mdisk@cluster0.5f5kz5s.mongodb.net/?retryWrites=true&w=majority"
mongo = pymongo.MongoClient(DB_URL)
db = mongo["oggylink"]
dbcol = db["users"]
# database functions
def total_user() -> str:
user = dbcol.count_documents({})
... | crazebotz/OggyLink-Bot | database.py | database.py | py | 1,307 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 5,
"usage_type": "call"
}
] |
8413371884 | import random
import numpy as np
from types import SimpleNamespace
from collections import namedtuple
from itertools import product
from typing import Sequence
from scipy.optimize import minimize
from vgc_project.soft_vgc import soft_value_guided_construal
Trial = namedtuple("Trial", "maze obstacle type value")
Boun... | markkho/value-guided-construal | vgc_project/vgc_project/parameter_fit.py | parameter_fit.py | py | 7,339 | python | en | code | 20 | github-code | 6 | [
{
"api_name": "collections.namedtuple",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "typing.Sequence",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "numpy.i... |
34962824534 |
#Import what is needed
from pyspark.sql import SQLContext
from pyspark import SparkContext
from pyspark.sql.types import *
from pyspark.sql import SQLContext, Row
from sparknlp.base import *
from sparknlp.pretrained import PretrainedPipeline
import sparknlp
from pyspark.sql import SparkSession
import pandas as pd
fr... | yogenderPalChandra/spark | file.py | file.py | py | 7,943 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sparknlp.start",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SQLContext",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "os.path",
"lin... |
18835088242 | import functools
import time
from datetime import datetime, timedelta
import pandas as pd
import plotly.graph_objects as go
from dash_apps.lib.events_28d import events
from dash_apps.lib.filters import select
from style.theme import (TRANSPARENT, WHITE, colors_map, colorscale,
graph_title_font... | slyg/dash-plotly | src/dash_apps/figures/most_failing.py | most_failing.py | py | 1,960 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dash_apps.lib.filters.select",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "dash_apps.lib.events_28d.events",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "dash_apps.lib.events_28d.events",
"line_number": 19,
"usage_type": "name"
... |
10622660926 | #!/usr/bin/env python3
"""Add custom tags to OSM extracts for DGL’s travel time matrices"""
__all__ = ["CyclingSpeedAnnotator"]
import collections.abc
import functools
import pathlib
import osmium
import pandas
class CyclingSpeedAnnotator(osmium.SimpleHandler):
def __init__(
self,
cycling_s... | DigitalGeographyLab/cycling-speed-annotator | src/cycling_speed_annotator/cycling_speed_annotator.py | cycling_speed_annotator.py | py | 3,100 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "osmium.SimpleHandler",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "collections.abc.abc",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name... |
20044197510 | from pprint import pprint
import pymongo
import json
from pymongo import MongoClient, InsertOne, TEXT
import os
import argparse
from bson import json_util
def main():
portNumber = input("Please enter port number: ")
clientPort = "mongodb://localhost:" + portNumber
client = MongoClient(clientPort)
p... | Kshah10/Mini_Project2 | load-json.py | load-json.py | py | 1,337 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 38,
"usage_type": "call"
}
] |
23692862469 | """
Contains definitions for the classes QueryInfo and QueryResponse
Last Modification: Added documentation
Date of Modification: 14/11/2022 11:45
"""
from pprint import pprint
from common.dnsEntry import DNSEntry, EntryType
import common.utils as utils
import itertools
class QueryInfo:
"""
Represents a quer... | SLP25/DNS | common/query.py | query.py | py | 5,975 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "common.dnsEntry.EntryType",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "common.dnsEntry.DNSEntry",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "common.dnsEntry.EntryType.SOASP",
"line_number": 51,
"usage_type": "attribute"
},
... |
32026896658 | from dataclasses import Field, field, fields
from re import T
from rest_framework import serializers
from base.models import *
from django.contrib.auth.models import User
#
# class CartItemSerializer(serializers.ModelSerializer):
# item = serializers.SerializerMethodField()
#
# class Meta:
# model = C... | mehmetyavas/Fullstack-tutorial | backend/saplament/base/api/serializers.py | serializers.py | py | 3,707 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "dataclasses.fields",
"line_number": 24,
"usage_type": "name"
... |
30929917415 | import torch
from transformers import GenerationConfig, AutoModel, AutoTokenizer, AutoModelForCausalLM
from langchain.llms.base import LLM
from langchain.llms.utils import enforce_stop_tokens
from typing import List, Optional, Mapping, Any
import sys
import logging
class MOSSLLM(LLM):
max_token: int = 2048
tempera... | inforix/lll | utils/mossllm.py | mossllm.py | py | 4,036 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "langchain.llms.base.LLM",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "typing... |
74691603386 | import pygame,math,random,os,time
import PyUI as pyui
pygame.init()
screen = pygame.display.set_mode((1000, 600),pygame.RESIZABLE)
pygame.scrap.init()
ui = pyui.UI()
class funcer:
def __init__(self,level,main):
self.func = lambda: main.gengame(level)
class funcerk:
def __init__(self,ID,main)... | LazerWolfeGod/Lift-Game | lift game.py | lift game.py | py | 27,261 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pygame.RESIZABLE... |
40684734293 | import datetime
import getopt
import getpass
import os
import re
import string
import sys
version = "1.0.2"
lines = ""
iesDefs = {}
ieofielist = {}
choicelist = {}
choiceiesDefs = {}
outdir = './'
filenames = []
verbosity = 0
prefix = ""
FAIL = '\033[91m'
WARN = '\033[93m'
ENDC = '\033[0m'
fileprefix = ""
filepref... | magma/magma | lte/gateway/c/core/oai/tasks/s1ap/messages/asn1/asn1tostruct.py | asn1tostruct.py | py | 44,773 | python | en | code | 1,605 | github-code | 6 | [
{
"api_name": "sys.stderr.write",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "datetime.datet... |
2975007060 | from constants import Menu
from collections import defaultdict
def set_flags_special_dish(dictionary_with_orders):
if 'Red' in dictionary_with_orders or 'Blue' in dictionary_with_orders or 'Soup' in dictionary_with_orders:
return True
else:
return False
def menu_tuple(menu_dictionary):
... | kacsa007/sushi-home | service.py | service.py | py | 4,642 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "constants.Menu.menu_values",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "constants.Menu",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 28,
"usage_type": "call"
},
{
"api_name":... |
11353076513 | """
트리의 부모 찾기
https://www.acmicpc.net/problem/11725
"""
import sys
from collections import deque
N = int(sys.stdin.readline())
parents = [0]*(N+1)
parents[1] = 1
tree = {}
for line in sys.stdin:
if line == '\n':
break
X, Y = map(int,line.split())
if X not in tree:
tree[X] = [Y]
else:
... | jihoonyou/problem-solving | Baekjoon/boj11725.py | boj11725.py | py | 765 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.stdin.readline",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
... |
32505730105 | # -*- coding: utf-8 *-
import pprint
import cgi
from urllib import unquote_plus
class Request(object):
@staticmethod
def createFromEnviron(environ):
request = Request()
request.__method = environ['REQUEST_METHOD']
request.__pathInfo = environ['PATH_INFO']
request.query = dict(... | alculquicondor/Symfopy | vendor/Symfopy/Component/HttpFoundation.py | HttpFoundation.py | py | 3,140 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "urllib.unquote_plus",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cgi.FieldStorage",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pprint.pformat",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "pprint.pformat",
... |
32573407816 | from hashlib import sha256
import json
from datetime import datetime
class Block:
def __init__(self, index, previous_hash, current_transactions, timestamp, nonce):
self.index = index
self.previous_hash = previous_hash
self.current_transactions = current_transactions
self.timestamp ... | nicolasmnl/BlockChain_Monitoring_System | SimpleBlockChain/blocks/blockchain.py | blockchain.py | py | 2,618 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "json.dumps",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "hashlib.sha256",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "hashlib.sha256",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_numbe... |
19064564138 | import logging
import os
from typing import List, Optional, TypedDict, cast
from mutagen import File, flac, mp3
from pylistfm.sound_utils import Track, Title, Album
class TagsInfo(TypedDict):
album: List[str]
title: List[str]
class Tags:
albums: List[Album] = []
titles: List[Title] = []
class Info... | ntnbrtnkv/pylistfm | pylistfm/destinations/local/sound_utils.py | sound_utils.py | py | 3,986 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.TypedDict",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number... |
21228241356 | import logging
from django.core.handlers.wsgi import WSGIRequest
from django.http import JsonResponse
from widgets import services
logger = logging.getLogger('server')
class LibraryPageMixin:
"""Создан для медиа библиотеки, которая пока не добавлена на сайт"""
template_name = None
name_page = None
... | alex-polo/homepage | widgets/mixins.py | mixins.py | py | 7,695 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "widgets.services.get_settings_value",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "widgets.services",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": ... |
27455276695 | import csv
from bs4 import BeautifulSoup
def extract_and_save():
f = open("data.csv")
encoding = "mac-roman"
reader = csv.reader(f)
negative = open("negative.txt", "w")
positive = open("positive.txt", "w")
for row in reader:
soup = BeautifulSoup(row[2].decode("mac-roman"))
all_... | mainman100/workspace | Python/Odesk/extract_tags_german/extracting.py | extracting.py | py | 718 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "csv.reader",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 10,
"usage_type": "call"
}
] |
31632144604 | import os
import sys
import numpy as np
import tables as tb
import pandas as pd
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.colors as clrs
from invisible_cities.evm.event_model import Cluster, Hit
from invisible_cities.typ... | paolafer/next_analysis | plotting/old_h5_and_IC/plot_corr_voxels.py | plot_corr_voxels.py | py | 8,661 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.use",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "invisible_cities.io.dst_io.load_dst",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "invisible_cities.evm.event_model.HitCollection",
"line_number": 41,
"usage_type": "call... |
29109946804 | from discord.ext import commands
from discord import utils
import lavalink
class MusicCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.bot.music = lavalink.Client(754169016087478302) # Bot's user id
self.bot.music.add_node("localhost", 7000, "ILoveHatsuneMiku", "na", "music-... | UltraDagon/Hatsune-Miku-Discord-Bot | venv/cogs/music.py | music.py | py | 1,540 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "lavalink.Client",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "disco... |
36525284129 | from flask import Flask, request
from PIL import Image
import os
import base64
from werkzeug.datastructures import ImmutableMultiDict
from PIL import Image
import json
import io
from tensorflow.keras.applications import ResNet50
#from tensorflow.keras.applications import VGG16
#from tensorflow.keras.applications im... | dmfow/ImTheConductor | Week6/test.py | test.py | py | 3,501 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.applications.ResNet50",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "tensorflow.keras.applications.imagenet_utils.preprocess_input",
"line_number": 39,
"us... |
35873306205 | # List all mp3 files and sink bytes into kafka stream "mp3_tracks" topic
import os, sys
import argparse
import time
import json
import uuid
from kafka import KafkaProducer
producer = KafkaProducer(bootstrap_servers='localhost:9092')
topic = 'mp3_tracks'
def audio_to_bytes(input_file):
with open(input_file) as in_... | revythas/kafka-audio-processing | producer.py | producer.py | py | 1,342 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "kafka.KafkaProducer",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_numbe... |
70325403068 | import collections
import scrapy
from scrapy.crawler import CrawlerProcess
from ReviewObjects.Review import Review
from ScraperStrategies.ReviewScraperBase import ReviewScraperBase
class ScrapyReviewScraper(ReviewScraperBase):
def __init__(self):
self.urls_to_visit = collections.deque()
self.revi... | bje43/PodiumInterview | ScraperStrategies/ScrapyReviewScraper.py | ScrapyReviewScraper.py | py | 2,422 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "ScraperStrategies.ReviewScraperBase.ReviewScraperBase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "collections.deque",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 12,
"usage_type": "call"
},
... |
19584237217 | import math
import numpy as np
import torch
from torch import nn, Tensor
import torch.nn.functional as F
from torch.nn import TransformerEncoder, TransformerEncoderLayer
from timm.models.layers import DropPath, to_2tuple, trunc_normal_
# ===============================Original Transformer Encoder=====================... | OASans/Swin4NER | Swin_NER/Models/fusions_swin.py | fusions_swin.py | py | 17,516 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.Dropout",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
73529468027 | from skimage import io, color
class DatasetCleaner:
def __init__(self, paths):
self.invalid_paths = []
self.paths = paths.iloc[:, 0]
self.dataset_length = paths.shape[0]
def fit(self):
for idx in range(self.dataset_length):
try:
image = io.imread(se... | default-303/easyTorch | utils/cleaner.py | cleaner.py | py | 720 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "skimage.io.imread",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "skimage.io",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "skimage.color.gray2rgb",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "skimage.color",
... |
22779712382 | from collections import deque
quantity = int(input())
queue = deque()
while True:
command = input()
if command == "Start":
break
queue.append(command)
while True:
command = input()
if command == "End":
print(f"{quantity} liters left")
break
if command.startswith("refil... | DanieII/SoftUni-Advanced-2023-01 | advanced/lists_as_stacks_and_queues/water_dispenser.py | water_dispenser.py | py | 1,337 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 4,
"usage_type": "call"
}
] |
1924411381 | # Third-party
import pytest
# First-party
from idpi import mars
@pytest.fixture
def sample():
# for param=U, date=20200101, time=0000
return {
"class": "od",
"date": "20200101",
"expver": "0001",
"levtype": "ml",
"levelist": list(range(1, 81)),
"model": "COSMO-... | MeteoSwiss-APN/icon_data_processing_incubator | tests/test_idpi/test_mars.py | test_mars.py | py | 1,342 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pytest.fixture",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "idpi.mars.Request",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "idpi.mars",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "idpi.mars.Request",
... |
50559999 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 2 11:18:27 2023
@author: fei
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
import scipy.stats as stats
from scipy.stats import chi2
def chisq(T,mu_T,rejection_factor):
'''
perform Chi-Square ... | georgesuhk/TBPS_7 | fitting/goodnessoffit.py | goodnessoffit.py | py | 3,298 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "scipy.stats.chisquare",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "scipy.stats",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "numpy.exp",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.histogram",
"li... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.