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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
36912820661 | # -*- coding: utf-8 -*-
"""Base class for State objects."""
import inspect
import os
from datetime import datetime
from typing import List
from ._keys import STATES_KEY
from .. import ConfigDb, LOG
from .._events.event_queue import EventQueue
from .._events.pubsub import get_subscribers, publish, subscribe
from ..util... | rtobar/integration-prototype | sip/execution_control/configuration_db/sip_config_db/states/_state_object.py | _state_object.py | py | 9,868 | python | en | code | null | github-code | 18 | [
{
"api_name": "typing.List",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "_keys.STATES_KEY",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "_keys.STATES_KEY",
"line_number": 32,
"usage_type": "argument"
},
{
"api_name": "typing.List",
"... |
13016611756 | """
Model module:
1, building model;
2, mass_matrix_full, forcing_full, linearized;
3, parameters, coordinates, speeds convert from string to symbols;
4, zero auxiliary speeds, reference configuration;
5, contact forces.
"""
import os
import pdb
import sympy as sym
import sympy.physics.mechanics as mec
from numpy imp... | StefenYin/BicycleThesis | constraint/model.py | model.py | py | 14,560 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sympy.physics.mechanics.Vector",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "sympy.physics.mechanics",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "sympy.physics.mechanics.mechanics_printing",
"line_number": 19,
"usage_type":... |
35474364516 | import requests
from flask import Flask
def getLatLng(address):
result = ""
url = 'https://dapi.kakao.com/v2/local/search/address.json?query=' + address
rest_api_key = '15846e51cb8ace77e040eaac2bb7fbbf'
header = {'Authorization': 'KakaoAK ' + rest_api_key}
r = requests.get(url, headers=head... | wnsgur5303/EducatedPython | day12/1taem/map.py | map.py | py | 2,747 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
}
] |
8337730765 | import os
from datetime import datetime
from airflow import DAG
from airflow.operators.bash import BashOperator
from airflow.providers.google.cloud.transfers.bigquery_to_bigquery import (
BigQueryToBigQueryOperator,
)
from airflow.utils.task_group import TaskGroup
from airflow.utils.trigger_rule import TriggerRule... | sparsh-ai/recohut | docs/06-orchestration/airflow/dags/dbt-examples/copy_store_failures_bigquery.py | copy_store_failures_bigquery.py | py | 3,101 | python | en | code | 91 | github-code | 18 | [
{
"api_name": "os.getenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "airflow.DAG",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number"... |
13502078749 | import pygame
pygame.init()
pygame.display.set_caption("Path-Visualizer")
# Screen Settings
WIDTH = 1536
HEIGHT = 768
GRID_SIZE = 24 # The size of each grid square
GRID_OFFSET_X = 240 # The offset for the grid on the X-axis
GRID_WIDTH = WIDTH - GRID_OFFSET_X - GRID_SIZE*2
GRID_HEIGHT = HEIGHT - GRID_SIZE*2
# ... | KuilySayantan/My_Python_Path_Visualizer | settings.py | settings.py | py | 1,115 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pygame.init",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_caption",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 4,
"usage_type": "attribute"
}
] |
6405377336 | import subprocess
from pathlib import Path
from typing import List, Dict, Tuple
from itertools import groupby
from collections import OrderedDict
import pandas as pd
from sklearn.metrics import adjusted_rand_score
DATA_DIR = Path(__file__).resolve().with_name("WSI")
BTSRNC = DATA_DIR / "bts-rnc"
RU = "ru"
def extrac... | nvanva/filimdb_evaluation | wsi/score.py | score.py | py | 5,729 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "pathlib.Path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_numb... |
28996128970 | import os
import attr
from torchbiggraph.converters.import_from_tsv import convert_input_data
from torchbiggraph.config import parse_config
from torchbiggraph.train import train
from torchbiggraph.eval import do_eval
DATA_DIR = "datas/soc-LiveJournal"
CONFIG_PATH = "config.py"
FILENAMES = {
'train': 'train.txt',... | reganzm/Learn-Pytorch-And-Become-A-Data-Scientist | chapter10/PBG/train_and_test.py | train_and_test.py | py | 1,455 | python | en | code | 29 | github-code | 18 | [
{
"api_name": "os.path.splitext",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
18605205113 | """baseline model
1. Deep Cross-Modal Audio-Visual Generation
2. CMCGAN: A Uniform Framework for Cross-Modal Visual-Audio Mutual Generation
"""
import os
import h5py
import argparse
import logging
import time
import tqdm
import json
import pickle
import random
import numpy as np
import torch
from tensorboardX import ... | smallflyingpig/speech-to-image-translation-without-text | Audio_to_Image/train_audio_encoder.py | train_audio_encoder.py | py | 22,364 | python | en | code | 24 | github-code | 18 | [
{
"api_name": "torch.manual_seed",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "random.seed",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"l... |
10533020936 | import torch
import random
import pickle
import os
import wikipedia
import wolframalpha
import speech_recognition as sr
from gtts import gTTS
from utils import download_pretrained_model, add_special_tokens, sample_sequence
from transformers import OpenAIGPTTokenizer, OpenAIGPTLMHeadModel
random.seed(42)
torch.random.... | RYOG-Rehan-Ali/Barbie-With-Brain | Barbie With Brain/main.py | main.py | py | 2,801 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "random.seed",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.random.manual_seed",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.random",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "random.seed",
... |
29215321007 | import cv2
import math
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
matplotlib.use('TkAgg')
from copy import deepcopy as dpc
D0 = 5 #radius
n = 2 #order
def min_max_normalize(img_inp):
inp_min = np.min(img_inp)
inp_max = np.max(img_inp)
for i in range (img_inp.shape[0]):
fo... | prithul-37/Image-Lab | Practice/butter.py | butter.py | py | 2,825 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "matplotlib.use",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 18... |
29119462785 | import png
from typing import List
def save(image: List) -> None:
convert = []
for row in image:
tuple_row = []
for color in row:
for rgb_value in color:
tuple_row.append(rgb_value)
convert.append(tuple(tuple_row))
dimensions = len(image)... | JamesZhang22/pypaint | utils/save.py | save.py | py | 473 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.List",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "png.Writer",
"line_number": 15,
"usage_type": "call"
}
] |
42661377467 | import threading
import time
import datetime
import cv2
from EasyROI import EasyROI
import json
import cv2
from pprint import pprint
from ultralytics import YOLO
from PIL import Image
import cv2
from shapely.geometry import Polygon
from shapely.geometry import box as bbox
import numpy
from EasyROI import ... | hivanazari/hinaserver | camera.py | camera.py | py | 7,014 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "EasyROI.EasyROI",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "shapely.geometry.Polygon",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "shapely.geometry.box",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "ultraly... |
21158588088 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from libcity.model import loss
from libcity.model.abstract_traffic_state_model import AbstractTrafficStateModel
def normalize(data, mean, std):
return (data - mean) / std
def unnormalize(data, mean, std):
... | LibCity/Bigscity-LibCity | libcity/model/eta/DeepTTE.py | DeepTTE.py | py | 14,001 | python | en | code | 644 | github-code | 18 | [
{
"api_name": "torch.device",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.LongTensor",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.arange",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.autograd.Variable",
... |
9362919186 | import uvicorn
import strawberry
from fastapi import FastAPI
from strawberry.fastapi import GraphQLRouter
@strawberry.type
class Query:
@strawberry.field
def hello(self) -> str:
return "Hello World"
schema = strawberry.Schema(query=Query)
graphql_app = GraphQLRouter(schema)
app = FastAPI()
app.inc... | cristiciortea/learning-fastapi-tier3 | src/main.py | main.py | py | 524 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "strawberry.field",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "strawberry.type",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "strawberry.Schema",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "strawberr... |
38816210687 | # Reference - https://www.geeksforgeeks.org/strongly-connected-components/
# This is used to find all the strongly connected components and does DFS
# 2 times.
from collections import defaultdict
class Graph:
def __init__(self, vertices):
self.V = vertices
self.graph = defaultdict(list)
d... | yeboahd24/Data-Structure | data_structures/graphs/kosaraju_algorithm.py | kosaraju_algorithm.py | py | 1,391 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "collections.defaultdict",
"line_number": 13,
"usage_type": "call"
}
] |
20975686920 | import easygui as ez
import os, sys
p = ez.indexbox("Welcome to snek!", "Snek v1.0", ["1P Mode", "2P Mode", "Custom Levels", "About", "Exit"])
if p == 0:
exec(open('1p.pyw').read())
elif p == 1:
exec(open('2p.pyw').read())
elif p == 2:
ez.msgbox("This is still a work in progress. But, you can try ou... | W1THRD/snekgame | menu.pyw | menu.pyw | pyw | 618 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "easygui.indexbox",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "easygui.msgbox",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "easygui.msgbox",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.execv",
"line_num... |
27777233655 | from collections import defaultdict
from functools import reduce
import pretty_table_config as ptb
# Các tham số được sửa
FILE_IN = 'datain.txt'
BEGIN_COST = 20
# Các tham số được sửa
start = None
end = None
graph = defaultdict(list)
parent = {}
MAX_SIZE = int(1E6)
res = []
def f(node: tuple) -> str: # (a,b) -> ba... | haidv-2801/AI | hill_climbing_search/main.py | main.py | py | 2,241 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.defaultdict",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pretty_table_config.get_table",
"line_number": 46,
"usage_type": "call"
}
] |
19137994513 | """
POS tags reader for Old Norse texts.
The tagset is available at http://nlp.cs.ru.is/pdf/Tagset.pdf.
Some changes were made:
cc for coordinating conjunctions
ct for
"""
__author__ = ["Clément Besnier <clemsciences@aol.com>", ]
__license__ = "MIT License"
from collections import defaultdict
class POSElement:
... | cltk/old_norse_texts_heimskringla | pos.py | pos.py | py | 18,410 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "collections.defaultdict",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 88,
"usage_type": "call"
},
{
"api_name"... |
10258361172 | from googletrans import Translator
from gtts import gTTS
from tkinter import *
window = Tk()
window.geometry('1600x800')
window.config(bg="grey")
set_bg = PhotoImage(file="logo.png")
label_1 = Label(window, image=set_bg)
label_1.place(x=0, y=0)
e1 = Entry(window, bg="white",fg="black",font=("Arial",25,"bol... | 20Sunny/language-translator | ai.py | ai.py | py | 1,578 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "googletrans.Translator",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "gtts.gTTS",
"line_number": 34,
"usage_type": "call"
}
] |
36352660442 | '''
This is the module for scanning UPCs
'''
import StringIO
import Image
import zbar
import requests
from pantry.exceptions import NotSupported
class UPCScanner(object):
def __init__(self, *args, **kwargs):
self.args = args
for key, value in kwargs.items():
setattr(self... | jasonbartz/pantry | pantry/upc/upc.py | upc.py | py | 3,446 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "zbar.ImageScanner",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "Image.open",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "requests.codes",
"line_... |
21304184428 | import cupy as cp
import numpy as np
from cupy_test_utils import (
CupyImplementation,
LIB_NAME,
free_memory_pool,
REFLECT_MODE,
cupy_median_filter,
)
from imagingtester import (
USE_CUPY_NONPINNED_MEMORY,
SIZES_SUBSET,
DTYPE,
N_RUNS,
FILTER_SIZE,
)
from numpy_scipy_imaging_filte... | DolicaAkelloEgwel/howdoespycudawork | test_cupy_median_filter.py | test_cupy_median_filter.py | py | 1,961 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "imagingtester.USE_CUPY_NONPINNED_MEMORY",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "cupy.random.uniform",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "cupy.random",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_... |
36924037871 | import re
from collections import defaultdict
from typing import List, Dict, NamedTuple
BAG_PATTERN = re.compile(r"(\d) ([^,.]*) bag")
class Rule(NamedTuple):
amount: int
color: str
def part_1(data: Dict[str, Rule]):
# revert rules
lookups: Dict[str, List] = defaultdict(list)
for color, rules i... | eruvanos/2020_AOC | 07/solution.py | solution.py | py | 1,702 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "re.compile",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "typing.NamedTuple",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number... |
71426475880 | import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import os
import shutil
import cv2
import matplotlib.pyplot as plt
import seaborn as sns
print("Pandas Version:", pd.__version__)
print("Numpy Version:", np.__version__)
print("OpenCV Version:", cv2.__... | aorursy/new-nb-3 | enerrio_data-exploration-distribution-of-image-sizes.py | enerrio_data-exploration-distribution-of-image-sizes.py | py | 3,680 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.__version__",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.__version__",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "cv2.__version__",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "o... |
31876731781 | """
Using the load file operator to load data from s3 into pandas dataframe in-memory.
Passing the dataframe into the {dataframe} operator that will execute
a pandas dataframe operation.
"""
# import libraries
import os
from datetime import date, datetime, timedelta
from airflow.decorators import dag, task
from airf... | owshq-academy/ws-astro-python-sdk | dags/dataframe/dataframe-user-subscription.py | dataframe-user-subscription.py | py | 2,005 | python | en | code | 6 | github-code | 18 | [
{
"api_name": "pandas.DataFrame",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "astro.sql.dataframe",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "astro.sql",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "airflow.operators... |
2294758572 | """
ComputerInfoUI project. Plan is to make a interface where I can display all the information about my CPU/GPU.
By Ben Highsted. Started April 15th 2020.
"""
import psutil
import platform
import os
import time
import string
#At the moment just want to get all the data working in a terminal app, then convert it i... | BenHighsted/ComputerInfoUI | ComputerInfoUI.py | ComputerInfoUI.py | py | 1,059 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "platform.processor",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "psutil.virtual_memory",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "psutil.Process",
... |
26700854267 | from django.contrib import messages
from django.shortcuts import render, redirect
from .models import Messages
from accounts.models import User
from django.db.models import ObjectDoesNotExist
from .choices import object_messages
from office.models import Office
from django.db.models import F
# def apply(request):
# ... | mahdibohloul/wize-project | notifications/views.py | views.py | py | 2,655 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "office.models",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "office.models.Office.objects.all",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "office.models.Office.objects",
"line_number": 28,
"usage_type": "attribute"
},
{
"... |
14405916150 | import os
import json
import requests
host = 'localhost'
port = '56767'
headers = {
"Content-Type": "application/json",
"format": "pandas-split"
}
data = {
"columns": ["Year", "Month", "DayofMonth", "DayofWeek", "CRSDepTime", "CRSArrTime", "UniqueCarrier",
"FlightNum", "ActualElapsedTime... | rapidsai/cloud-ml-examples | mlflow/docker_environment/src/rf_test/test_query.py | test_query.py | py | 626 | python | en | code | 131 | github-code | 18 | [
{
"api_name": "requests.post",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 19,
"usage_type": "call"
}
] |
30346318153 | import unittest
import logging
import numpy as np
import numpy.testing as nptest
from skpar.core.database import Database
from skpar.dftbutils.queryDFTB import DetailedOut, BandsOut, Bandstructure
from skpar.dftbutils.queryDFTB import get_dftbp_data, get_bandstructure
from skpar.dftbutils.queryDFTB import get_effmasses... | dftbplus/skpar | test/test_dftbutils.py | test_dftbutils.py | py | 13,455 | python | en | code | 9 | github-code | 18 | [
{
"api_name": "logging.basicConfig",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.ge... |
34171871969 | from . import views
from django.urls import path
urlpatterns = [
path('', views.home_page, name="home"),
path('projects/', views.project_page, name="project_page"),
path('about/', views.about_page, name="about_page"),
# path('project/<str:pk>/', views.project_details, name="project"),
path('workh... | richarddeanpelser/portfolio | portfolio/urls.py | urls.py | py | 976 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
4862428211 | import csv
import datetime
import sys
from typing import List, Dict, Tuple
from os import makedirs, listdir
from os.path import exists
from Implementation.AbstractDiscretisation import Discretization
from Implementation.ClassicMethods import Binary, EQF, EQW, KMeans, Persist, SAX
from Implementation.ClassicMethods.Exp... | danielrbk/Discretisation | Discretization_Interface.py | Discretization_Interface.py | py | 15,126 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "Implementation.ClassicMethods.Binary.Binary",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "Implementation.ClassicMethods.Binary",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "Implementation.ClassicMethods.EQF.EqualFrequency",
"lin... |
15447088626 | """
This is the user interface where the program interacts with the user.
USAGE: 1. Go to sqlconfig.conf file and change the username and password
values to the ones from you are using in your mysql instance
2. Open a terminal windows and run the following command:
python3 user_interface.py
NOTE... | jkoelmel/zoo_dbms | Python_interface/user_interface.py | user_interface.py | py | 17,378 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.timedelta",
"line_number": 241,
"usage_type": "attribute"
},
{
"api_name": "datetime.date",
"line_number": 242,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"line_number": 256,
"usage_type": "attribute"
},
{
"api_name": ... |
2465027504 | #Escribir un programa que reciba una cadena de caracteres y devuelva un diccionario con
# cada palabra que contiene y su frecuencia.
#Solucion 1:
from collections import Counter
def contador_palabras():
frase = "En efecto, rematado ya su juicio, vino a dar en el más extraño pensamiento que jamás dio loco en el... | ADDiaz99/Ejercicios | Funciones/11_Funciones.py | 11_Funciones.py | py | 1,077 | python | es | code | 0 | github-code | 18 | [
{
"api_name": "collections.Counter",
"line_number": 11,
"usage_type": "call"
}
] |
2006463278 | import json
import requests
from neutron.common import exceptions as n_exc
from neutron.common import log
from neutron.extensions import lbaas_agentscheduler
from neutron.openstack.common import log as logging
from pysnmp.entity.rfc3413.oneliner import cmdgen
LOG = logging.getLogger(__name__)
class StingrayRestCli... | guardian/openstack-lbaas-stingray | rest_client.py | rest_client.py | py | 22,760 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "neutron.openstack.common.log.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "neutron.openstack.common.log",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "neutron.common.log.log",
"line_number": 16,
"usage_type": "attribute"... |
31409761065 | from collections import namedtuple
import regex as re
import sys
import operator
Coord = namedtuple('Coord', ['x', 'y', 'z'])
Particle = namedtuple('Particle', ['num', 'p', 'v', 'a'])
PATTERN = re.compile(r'p=<(.*),(.*),(.*)>, v=<(.*),(.*),(.*)>, a=<(.*),(.*),(.*)>')
def parse(i_line):
i, line = i_line
m = ... | DrGodCarl/AdventOfCode | 2017/src/day20/main.py | main.py | py | 1,937 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.namedtuple",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "regex.compile",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.maxint",... |
21241574684 | """
Author: David Marsden
Last Edited: June 23, 2018
This script runs simulations of relative risk regression. \n
Note: the simulations take a long time. Consider specifying a smaller
number of simulations with the nsims argument. It also generates a figure
of the last simulation ran. The relative risk packag... | MarsdenDavidG/RelativeRiskRegression | RelativeRiskSimulations.py | RelativeRiskSimulations.py | py | 7,669 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.random.seed",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.binomial",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.rando... |
3415552525 | #Method that holds the code for the molecule simulations
#
# Importing useful modules
import numpy as np
import matplotlib.pyplot as plt
import helper
import scipy
import os
import PIL
#The class that contains our cell simulation
class molecule:
'''
Object that represents a bunch of molecules ... | andrewtaitelewis/simulationCode | moleculeSimulation.py | moleculeSimulation.py | py | 12,219 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.random.rand",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.rand",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
8908720755 | import asyncio
import aiohttp
# Example: 1
# use async keyword in front of a function definition
async def async_func():
print("My async function")
# async function with wait keyword
async def main():
await async_func()
# calling main function with asyncio.run
# This function runs the passed coroutine, t... | CodingMantras/python-day-to-day | asyncio_examples.py | asyncio_examples.py | py | 965 | python | en | code | 7 | github-code | 18 | [
{
"api_name": "asyncio.run",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "asyncio.sleep",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "asyncio.sleep",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "asyncio.gather",
"line_nu... |
13389615154 | __author__ = 'zhouxuan-s'
import requests
import json
import xlrd
class ReadExcel(object):
def __init__(self,path):
self.path=path
def getSheet(self):
xl=xlrd.open_workbook(self.path)
sheet=xl.sheet_by_index(0)
return sheet
def getRows(self):
row=self.getSh... | zhouzhouzx/Excel | Test.py | Test.py | py | 2,403 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "xlrd.open_workbook",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_... |
41495606880 | from importlib import import_module
from inspect import signature
from typing import Any, Dict, Optional, Type
from pyspark.ml.base import Transformer
class ClassHelpers:
@staticmethod
def get_first_class_in_file(full_reference: str) -> Type[Transformer]:
module = import_module(full_reference)
... | icanbwell/SparkPipelineFramework | spark_pipeline_framework/utilities/class_helpers.py | class_helpers.py | py | 2,081 | python | en | code | 10 | github-code | 18 | [
{
"api_name": "importlib.import_module",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "typing.Type",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pyspark.ml.base.Transformer",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typin... |
22238451021 | from abc import abstractmethod
from functools import partial
from typing import Callable
from kbc_pul.popularity.logistic_functions import logistic_popularity_function
class AbstractCountToNormalizedPopularityMapper:
"""
Maps a value in R to [0,1]
"""
@classmethod
def is_value_normalized(cls, va... | ML-KULeuven/KBC-as-PU-Learning | kbc_pul/popularity/entity_counting/count_to_normalized_popularity.py | count_to_normalized_popularity.py | py | 1,097 | python | en | code | 7 | github-code | 18 | [
{
"api_name": "abc.abstractmethod",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "functools.partial",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "kbc_pul.populari... |
71201210920 | import sqlite3
from datetime import datetime, timedelta, date
# DB STATIC VARIABLES
DB_NAME = 'database/alma.db'
DB_CREATE_NAME = 'database/alma.sql'
DB_TABLES = [
'ALMA',
'OPTION',
'MENU',
'COURSE',
'MENU_has_OPTION'
]
# CONNECTION
connection = None
# DB FUNCTIONS
def open_connection():
"... | DavidOpDeBeeck/Almapi | almapi/utilities.py | utilities.py | py | 9,023 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "sqlite3.connect",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 131,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 274,
"usage_type": "call"
},
{
"api_name": "datet... |
24922011063 | import numpy as np
import matplotlib.pyplot as plt
def load_data():
data = np.loadtxt('ex2data2.txt', delimiter=',')
X = data[:,:2]
y = data[:,2]
return X, y
def plot_data(X, y):
plot_data_helper(X, y)
plt.show()
def plot_cost(J):
l = list(np.linspace(0, len(J), len(J)))
plt.plot(J, l)
plt.show()
... | ibzimh/Tumor-Classification | utils.py | utils.py | py | 2,032 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.loadtxt",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "numpy.linspace"... |
3966617854 | import unittest
from absl.testing import parameterized
import tensorflow as tf
# TODO(panzf): Enable tests after the side inputs manual API is supported
class SideInputsTest(parameterized.TestCase):
@unittest.skip("Feature not implemented")
@parameterized.parameters(
(1, tf.constant, 2, tf.constant),
... | tensorflow/tensorflow | tensorflow/core/function/integration_test/side_inputs_manual_api_test.py | side_inputs_manual_api_test.py | py | 6,177 | python | en | code | 178,918 | github-code | 18 | [
{
"api_name": "absl.testing.parameterized.TestCase",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "absl.testing.parameterized",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "tensorflow.func.experimental.capture",
"line_number": 20,
"usage_type":... |
18078269009 | from util import csv2dict, tsv2dict, helper_collections, topk_accuarcy
from sklearn.neural_network import MLPRegressor
import joblib
from joblib import Parallel, delayed, cpu_count
from ray.util.joblib import register_ray
from math import ceil
import numpy as np
import os
import ray
import joblib
register_ray()
def o... | venkatraman-arumugam/AdaBL-GL | rVSM_and_DNNLOC/dnn_model.py | dnn_model.py | py | 8,055 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "ray.util.joblib.register_ray",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "math.ceil",
... |
14600464929 | import requests
import telegram
import logging
import time
import configparser
# 配置日志记录器
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s [%(levelname)s] %(message)s",
handlers=[
logging.FileHandler("info.log"),
logging.StreamHandler()
]
)
file = 'config.ini'
# 创建配置文件对象
co... | RYANTANGCN/bing-wallpaper-daliy | main.py | main.py | py | 2,046 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.basicConfig",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.FileHandler",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.Strea... |
18385539639 | from datetime import datetime
from flask import Flask, request, jsonify
import uuid
import json
from database import DAO
app = Flask(__name__)
mock_pessoa = {
"apelido": "josé",
"nome": "José Roberto",
"nascimento": "2000-10-01",
"stack": ["C#", "Node", "Oracle"]
}
MSG_ERROR = "ERROR"
class Pessoa(... | icarocarmona/api_python | backend/app.py | app.py | py | 1,966 | python | pt | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
6128735044 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 14 12:10:33 2020
@author: Zhi X. Chen, Cambridge University, zc252@cam.ac.uk
"""
# %%
from scipy.io import loadmat
import numpy as np
import time
import matplotlib.pyplot as plt
from math import sqrt
from scipy.stats import beta
import os
import ma... | zhixchen/ml-mild-combustion | IntegratedCode.py | IntegratedCode.py | py | 23,969 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "os.path.exists",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 2... |
5350671374 | # Stock Price Checker
import sys
import requests
import time
from bs4 import BeautifulSoup
print("This application will determine the price of a Stock, and send you an email when a specified price tager is reached")
class Stock:
Stock_Code = ""
Stock_Price = 0.0
def FindStock(self):
... | Maazin24/StockTracker | WebApp.py | WebApp.py | py | 2,561 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"... |
14047807045 | import sys
from csv import reader
from pyspark import SparkContext
sc = SparkContext()
lines = sc.textFile(sys.argv[1], 1)
lines = lines.mapPartitions(lambda x: reader(x))
sum_of_value = lines.map(lambda x: (x[2], float(x[12])))
total_sum = sum_of_value.reduceByKey(lambda x, y: x + y)
counts_of_value = lines.map(la... | jolyon129/6513-big-data-project | assignment1/my_submit/zl2501/task3.py | task3.py | py | 623 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pyspark.SparkContext",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "csv.reader",
"line_number": 8,
"usage_type": "call"
}
] |
73193197161 | from PIL import Image
from pagermaid.listener import listener
from pagermaid.enums import Message, Client
from pagermaid.single_utils import safe_remove
@listener(
command="sticker_to_pic", description="将你回复的静态贴纸转换为图片", parameters="(是否发送原图,默认为否)"
)
async def sticker_to_pic(bot: Client, message: Message):
ori... | TeamPGM/PagerMaid_Plugins_Pyro | sticker_to_pic/main.py | main.py | py | 1,272 | python | en | code | 192 | github-code | 18 | [
{
"api_name": "pagermaid.enums.Client",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pagermaid.enums.Message",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pagermaid.enums.Message",
"line_number": 22,
"usage_type": "name"
},
{
"api_name":... |
17546571680 | import requests
headers = {'Authorization': 'Bearer 635812bd9ead41dcb46169a629e4f6e7918715e8'}
endpoint = "http://localhost:8000/api/products/"
data = {
"title": "This field is done",
"price": 32.00
}
get_response = requests.post(endpoint, json=data, headers=headers)
print(get_response.json())
| matiasbarbieri/django-rest-api | py_client/create.py | create.py | py | 307 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.post",
"line_number": 11,
"usage_type": "call"
}
] |
37549505906 | import logging
from logging.handlers import SysLogHandler
logger = logging.getLogger("classificationbanner")
handler = SysLogHandler(facility=SysLogHandler.LOG_DAEMON, address='/dev/log')
logger.addHandler(handler)
formatter = logging.Formatter('classification-banner[%(process)d] (%(module)s.%(funcName)s) %(levelname)... | datamachines/classification-banner | classificationbanner/banner.py | banner.py | py | 5,097 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "logging.handlers.SysLogHandler",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "logging.handlers.SysLogHandler.LOG_DAEMON",
"line_number": 4,
"usage_type": "attribute"
... |
34353051541 | import pyqrcode
import requests
from django.shortcuts import render, HttpResponse, redirect
from django_tables2 import Table, RequestConfig, LazyPaginator
from django.core.exceptions import BadRequest
from django.contrib.auth.decorators import login_required
from django.db.models import Q
from .tables import *
from mai... | otace1/Attendance | users/views.py | views.py | py | 3,699 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django_tables2.RequestConfig",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django_tables2.LazyPaginator",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 21,
"usage_type": "call"
},
{
... |
664126471 | from matplotlib import *
import matplotlib.pyplot as plt
import numpy as np
from subprocess import *
#rom subprocess import run
ok = subprocess.call('./dec.exe encryptx.txt')
print("\n-------- raw out ----------")
print(ok)
print("-------- raw tmp ----------")
file = open("tmp", "r")
string = file.read()
file.close... | Valrobotik/rpi_module_g | python/test2.py | test2.py | py | 615 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "subprocess.call",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.polar",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "matplotlib.pypl... |
70339216040 | from decimal import Decimal
from django.shortcuts import render, HttpResponseRedirect
from .models import Cart, CartItem
from django.urls import reverse
from products.models import Product, Variation
# Create your views here.
def view(request):
try:
the_id = request.session['cart_id']
cart = Cart.ob... | qabdurrazzaq/mychoices-hosted | carts/views.py | views.py | py | 2,694 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "models.Cart.objects.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.Cart.objects",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "models.Cart",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "decimal.... |
23279166119 | from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.core.mail.message import EmailMessage
from common.models import TemplateModel
def send_voting_email(request, voting, exclude_memberships=None):
ctx_dict = {
'voting': voting,
'site': get_curre... | dwebdevcore/BoardDirector_dashboard | apps/voting/voting_utils.py | voting_utils.py | py | 1,296 | python | en | code | 8 | github-code | 18 | [
{
"api_name": "django.contrib.sites.shortcuts.get_current_site",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.SSL_ON",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 12,
"usage_type": ... |
13124787413 | #!/usr/bin/env python
'''module to read data from dtu/template and show in VenusOS'''
# File specific rules
# pylint: disable=broad-except
# system imports:
import logging
import os
import configparser
import sys
# our imports:
#import tests
from dbus_service import DbusService
from dbus_shelly_service import DbusS... | hkaest/dbus-opendtu-DC-load | dbus-opendtu.py | dbus-opendtu.py | py | 5,088 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.version_info",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.pa... |
73084037479 | from django.views import View
from django.http import JsonResponse, request
from .models import Owner, Dog
import json
# Create your views here.
class SampleOwnerView(View):
def post(self, request):
try:
data = json.loads(request.body)
Owner.objects.create(name=data['name'],email=da... | cj4207/practice | owners/views.py | views.py | py | 2,180 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.views.View",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.http.request.body",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.http... |
31738570594 | import boto3
from requests_aws4auth import AWS4Auth
import requests
import JaSONx
import os
import time
from utility import binary_to_dict, createFileList
from PyQt5 import QtCore
import httpReq
import os
import sys, os, base64, datetime, hashlib, hmac
dict_credentials = {}
dict_response = {}
r = ''
def readCredenti... | Beezusburger/JaSONx | Versione-3.3.0.0/activation.py | activation.py | py | 2,626 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "PyQt5.QtCore.QDir.homePath",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore.QDir",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtCore",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "os.pat... |
71849838761 | import numpy as np
from numpy import linalg as LA
from pylab import *
import cvxpy as cp
#if using termux
import subprocess
import shlex
#end if
# ax+by <= d
A = np.array(( [3, 3], [3, 2])).T #
B = np.array([18,15]).reshape(2,1) #Total available Floor & Fat
# objective function coeffs
c = np.array([30,25]) ... | Gangagopinath/ASSIGNMENT | assignment7/opt1.py | opt1.py | py | 1,134 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cvxpy.Variable",
"line_number... |
6216996537 | import json
from django.core.exceptions import ObjectDoesNotExist
import dataflow.batch.settings as settings
from dataflow.batch.models.bkdata_flow import ProcessingJobInfo
from dataflow.shared.log import batch_logger
class ProcessingJobInfoHandler(object):
@staticmethod
def create_proc_job_info(args, proce... | Tencent/bk-base | src/api/dataflow/batch/handlers/processing_job_info.py | processing_job_info.py | py | 5,116 | python | en | code | 85 | github-code | 18 | [
{
"api_name": "dataflow.batch.settings",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "dataflow.batch.settings",
"line_number": 19,
"usage_type": "argument"
},
{
"api_name": "dataflow.batch.models.bkdata_flow.ProcessingJobInfo.objects.create",
"line_number": 2... |
13502385328 | # -*- coding: utf-8 -*-
import discord
from discord.ext import commands
class AdminCommands(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command(hidden=True)
@commands.has_permissions(kick_members=True)
async def kick(self, ctx, member : discord.Member,*,... | ThePotatoPvP/Potabot | src/AdminCommands.py | AdminCommands.py | py | 3,911 | python | en | code | 0 | github-code | 18 | [
{
"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": "discord.Member",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "... |
12981472211 | #!/usr/local/bin/python3
import sys, os, math
from collections import deque
class AOC2022:
def __init__(s, filename):
s.f = filename
s.S1 = 0
s.S2 = 0
s.blizzards = [set(), set(), set(), set()] # <>^v
for r, line in enumerate(open(s.f).read().splitlines()[1:]):
... | mortenjc/aoc2022 | 2022/day24/solution.py | solution.py | py | 2,297 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "math.gcd",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 66,
"usage_type": "attribute"
}
] |
17619365776 | import numpy as np
import pandas as pd
import statistics
from sklearn.model_selection import train_test_split
import streamlit as st
import models
import seaborn as sns
from matplotlib import pyplot as plt
from sklearn.tree import DecisionTreeRegressor,plot_tree
from sklearn.metrics import r2_score, mean_squared_error... | HishamParol/Machine-Learning-Project-streamlit | python-scripts/airbnbRegression.py | airbnbRegression.py | py | 1,993 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "seaborn.catplot",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "streamlit.pyplot",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "seaborn.catplot",
... |
20213004590 | from django.conf.urls import url
from . import views
# url namespace
app_name = 'post' # reverse하는 모든 namespace URL에 앱네임을 지정해줘야 한다, 단 render 함수는 제외
urlpatterns = [
url(r'^$', views.post_list, name='post_list'),
# /post/3/$, /post/35/$
# 정규표현식에서 매칭된 그룹을 위치인수로 변환하는 방법
# url(r'(^\d+)/$', views.post_deta... | YunhoJung/instagram | django_app/post/urls.py | urls.py | py | 1,653 | python | ko | code | 0 | github-code | 18 | [
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.... |
16877845749 | # source: https://github.com/PyTorchLightning/pytorch-lightning-bolts (Apache2)
import logging
from collections import Counter
from typing import Any, Dict, Optional, Tuple
import segmentation_models_pytorch as smp
import torchmetrics
import numpy as np
import pandas as pd
import pytorch_lightning as pl
import torch... | cwerner/deadtrees | deadtrees/network/segmodel.py | segmodel.py | py | 16,172 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "deadtrees.utils.utils.get_logger",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "deadtrees.utils.utils",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "t... |
70014758119 | import logging
from microserviceutil.migrations.migrate_mongo_pro_to_dev import MigrateMongoProToDev
class Migrations:
try:
JOBS = {
"mongo_pro_to_dev": MigrateMongoProToDev
}
def __init__(self, args):
# check the number of arguments
if len(args) >= 2:... | Squallium/python-util-microservice | microserviceutil/migrations/migrations.py | migrations.py | py | 606 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "microserviceutil.migrations.migrate_mongo_pro_to_dev.MigrateMongoProToDev",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "logging.error",
"line_number": 22,
"usage_type": "call"
}
] |
3428787325 | import sys
import socket
import threading
import argparse
MAIN_PORTS = list(range(1, 1024))
def port_scan(host, port, protocol):
s = socket.socket(socket.AF_INET, protocol)
s.settimeout(10)
if s.connect_ex((host, int(port))) == 0:
print(f"Port {port}/{protocol} open")
def multi_process(host, po... | ArantesVini/port-scanner-python | port_scanner.py | port_scanner.py | py | 2,885 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "socket.socket",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "threading.Thread",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentP... |
13562372403 | import serial
import socket
arduino= serial.Serial('/dev/ttyACM0' , 9600)
while True:
a=arduino.readline()
s=socket.socket()
s.connect(("169.254.139.148", 8888))
s.send(a)
s.close()
arduino.close()
| sroura15/PAE | Codi Electrònica/Codi Referència/Codi Raspberry/cliente.py | cliente.py | py | 226 | python | es | code | 0 | github-code | 18 | [
{
"api_name": "serial.Serial",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"line_number": 7,
"usage_type": "call"
}
] |
24931049564 | from django.core.files.storage import Storage
from fdfs_client.client import Fdfs_client
from django.conf import settings
class FastDFSStorage(Storage):
"""自定义Django存储系统的类"""
# 在创建client对象的时候,我们通过原始的/etc/fdfs/client.conf找不到conf'文件,所以我们需要奖这个文件复制到当前项目中
#client = Fdfs_client('./client.conf')的存在 耦合性太强,所以仿照Fil... | cancan519/dailyfresh24 | 天天生鲜/utils/fastdfs/storage.py | storage.py | py | 3,683 | python | zh | code | 1 | github-code | 18 | [
{
"api_name": "django.core.files.storage.Storage",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.CLIENT_CONF",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 13,
"usage_type": "name"
}... |
11675751592 | from ultralytics import YOLO
# Load a model
model = YOLO("yolov8n.yaml") # build a new model from scratch
#%%
# Use the model
model.train(data=r"C:\Users\kamra\DataspellProjects\yolov8_test\datasets\typhoon\data.yaml", epochs=100) # train the model
metrics = model.val() # evaluate model performance on the validati... | malore350/typhoon-project | main.py | main.py | py | 400 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "ultralytics.YOLO",
"line_number": 4,
"usage_type": "call"
}
] |
17875884243 | from PyQt5 import QtWidgets, uic
from PyQt5.QtWidgets import QDialog
import sys
import os
import pickle
import math
import time
import SenderGBN
class Sender(QDialog):
def __init__(self):
super(Sender, self).__init__()
uic.loadUi("Sender.ui", self)
self.pushButton.clicked.connect(self.sen... | wa26532977/COSC635Project_2 | GUI/Sender_app.py | Sender_app.py | py | 2,732 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "PyQt5.uic.loadUi",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PyQt5.uic",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
... |
1996138986 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Model.py
from scipy.optimize import minimize
import wx
from math import exp
from Corridor import *
from Line import *
from OD import *
from Parameters import *
class Model():
""" This class contains all the objects and data needed to run the model.
It enables to clea... | etiennecrb/TransitNetworkMacroSim | model/Model.py | Model.py | py | 7,545 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "wx.ProgressDialog",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "scipy.optimize.minimize",
"line_number": 208,
"usage_type": "call"
}
] |
11830830263 | # -*- coding: utf-8 -*-
"""
For Managing NiFi Templates
"""
from __future__ import absolute_import
import json
import io
from os import access, R_OK, W_OK
from os.path import isfile, dirname
import logging
import six
import xmltodict
from lxml import etree
import nipyapi
log = logging.getLogger(__name__)
__all__ =... | Chaffelson/nipyapi | nipyapi/templates.py | templates.py | py | 9,939 | python | en | code | 228 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "six.string_types",
"line_number": 70,
"usage_type": "attribute"
},
{
"api_name": "nipyapi.utils.rest_exceptions",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": ... |
23955394535 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0016_delete_defaultavatar'),
]
operations = [
migrations.AddField(
model_name='profilesettings',
... | danielliude/reismann_pub | profiles/migrations/0017_profilesettings_is_provider.py | 0017_profilesettings_is_provider.py | py | 485 | python | en | code | 0 | github-code | 18 | [
{
"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": 14,
"usage_type": "call"
},
{
... |
32416840741 | import wx
import conf.config as config
import utils.wordActivitiesUtils as nGUtils
import utils.bottomMenu as bottomMenu
from os.path import join
import matchImageCharAnswerList
import Image
class matchPairs():
def __init__(self, parent, id, mainWin, mainPanel, currentLesson):
self.mainWin = main... | foss-np/e-barnamala | eBarnamala/activities/matchPairs.py | matchPairs.py | py | 2,420 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "utils.wordActivitiesUtils.nextMatchImageCharQuestion",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "utils.wordActivitiesUtils",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "wx.Panel",
"line_number": 18,
"usage_type": "call"
},
... |
7804058803 | import datetime
from django.test import TestCase
from django.utils import timezone
from django.urls import reverse
from .models import Question
# Create your tests here.
class QuestionModelTests(TestCase):
def test_was_published_recently_with_future_question(self):
"""
was_published_recently() ... | tamuatsu/djangoPractice | polls/tests.py | tests.py | py | 5,538 | python | ja | code | 0 | github-code | 18 | [
{
"api_name": "django.test.TestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.utils.timezone.now",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.utils.timezone",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "... |
3165552001 | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('README.md') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='preseries_api',
version='0.1.0',
description='Preseries API for Python & Examples',
long_description=readme,
auth... | preseries/api_examples | setup.py | setup.py | py | 836 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "setuptools.setup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 23,
"usage_type": "call"
}
] |
26944525224 | ## Exercise 12 :
# Implement Batch Gradient Descent with early stopping
# for Softmax Regression (without using Scitkit-Learn).
from sklearn import datasets
import soft_max_scratch
import numpy as np
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
## Converts class lab... | FezTheImmigrant/OReillyBookCodeAlong | Chapter 4 - Training/chapter_4_exercise_12.py | chapter_4_exercise_12.py | py | 1,533 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "numpy.zeros",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "numpy.random.... |
37921699607 | import struct
import matplotlib.pyplot as plt
import numpy as np
def read(file):
with open(file, "rb") as f:
buff = f.read()
print(len(buff))
data = struct.unpack("%dB" % (108000 * 10), buff)
data = np.array(data).reshape(10, 600, 180)
return data
if __name__ == "__main__... | skyline-nju/VM-MPI | VM_MPI/snap.py | snap.py | py | 501 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "struct.unpack",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.imshow",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot"... |
72143115879 | import io
import os
import textwrap
from PIL import Image, ImageDraw, ImageFont
from userge import Message, userge
@userge.on_cmd(
"slet",
about={
"header": "Get a Sticker",
"description": "Generates Sticker with provided text",
"usage": "{tr}slet [text | reply]",
"examples":... | code-rgb/USERGE-X | userge/plugins/fun/slet.py | slet.py | py | 2,527 | python | en | code | 130 | github-code | 18 | [
{
"api_name": "userge.Message",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "PIL.Image.new",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "PIL.ImageDraw.Draw",
"line... |
7045390028 | import pygame
from Util.window import Window
def text_ob(text, font, color):
textforScreen = font.render(text, True, color)
return textforScreen, textforScreen.get_rect()
def game_over():
""""Create Game Over Screen"""
WIN = Window.WIN
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
end = Tru... | IUS-CS/project-scrumger-games | src/Engine/gameover.py | gameover.py | py | 777 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "Util.window.Window.WIN",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "Util.window.Window",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pygame.event.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pygam... |
19827845087 | """Clear Statement --> For each user we need to get all possible combinations of 3 sequences
Then from those possible 3 sequences we need to return the 3 sequence which has been visited by maximum
number of users.
1) Create a dictionary
{
Joe:[home,about,career],
Mary:[home,about,career],
James:[home,cart,... | anantvir/Leetcode-Problems | Array_Manipulations/Analyze_User_Website_Visit_Pattern.py | Analyze_User_Website_Visit_Pattern.py | py | 1,685 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "collections.defaultdict",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 35,
"usage_type": "call"
}
] |
23996137275 | # url_data
# https://docs.python.org/3/library/urllib.parse.html
import requests
from datetime import datetime
from urllib.parse import urlparse
class urlObject:
def __init__(self, url,AR=False):
super().__init__()
self.url = url
'''
Parse url, decomposing in element... | jsjose/final_project | final_project/libs/url_data.py | url_data.py | py | 2,101 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "urllib.parse.urlparse",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "request... |
33648451865 | # -*- coding: utf-8 -*-
"""
Skeleton for first part of the blob-detection coursework as part of INF250
at NMBU (Autumn 2017).
"""
__author__ = "Yngve Mardal Moe"
__email__ = "yngve.m.moe@gmail.com"
import numpy as np
import matplotlib.pyplot as plt
def threshold(image, th=None):
"""Returns a binarised version o... | ConAltDelete/INF205_H22 | testing/M2/Outsu_sceleton.py | Outsu_sceleton.py | py | 3,268 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.shape",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "numpy.shape",
"line_numb... |
16971457827 | import motor.motor_asyncio
import datetime
from TG_ROBOT import MONGO_DB_URI
class Database:
def init(self, uri, database_name):
self._client = motor.motor_asyncio.AsyncIOMotorClient(uri)
self.db = self._client[database_name]
self.col = self.db.users
async def add_chat_list... | tobio-shoyo/Rem_Robot-1 | TG_ROBOT/utils/database.py | database.py | py | 3,197 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "motor.motor_asyncio.motor_asyncio.AsyncIOMotorClient",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "motor.motor_asyncio.motor_asyncio",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "motor.motor_asyncio",
"line_number": 8,
"usage_... |
9821171441 | # 1) smoothing to remove noise from the image
# 2) homogeneous filter is the most simple filter each output pixel is the mean of its kernel neighbours
# 3) in image processing a kernel, convolution matrix or mask is a small matrix , it is used to blurring,sharpening
# ,embossing,edge detection and more.
# 4) in ... | Gurdit559/myOpenCV | ExploreOpenCV/blurring_smoothing.py | blurring_smoothing.py | py | 2,083 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.imread",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2RGB",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "numpy.ones",
"line... |
25096898723 | from pathlib import Path
import yaml
#import ruamel.yaml
import src.common.processing_vars as var
import os.path
#import ruamel.yaml as yaml
def write_database_file(self,d:dict, ignore_existing:bool=False):
yml_path = 'snowflake/data/' + d['DATABASE_NAME_SANS_ENV'] + '/database.yml'
data = self.create_pare... | metaopslabs/snowflake_deployer | src/yaml_writer/functions/write_database_file.py | write_database_file.py | py | 2,337 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "src.common.processing_vars.EMPTY_STRING",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "src.common.processing_vars",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "src.common.processing_vars.EMPTY_STRING",
"line_number": 18,
"usa... |
40382326079 | import numpy as np
import copy
from dataInfo import dataInfo
from createNode import createNode
import xml.etree.cElementTree as ET
from readData import readData
import sys
def getDistOfPnts(subMat):
dict = {}
for key in subMat[:,-1]:
if key in dict:
dict[key] += 1
else:
... | inabiyouni/Decision-Tree | tree_training_model.py | tree_training_model.py | py | 9,298 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.log2",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.log2",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.log2",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.log2",
"line_number": 37,
... |
35009018892 | from colorama import Style, Fore
from common.controllers import Controller
from common.notifications import show_push_notification
from mediagrabber.universal_downloader import UniversalMediaDownloader
class MediaGrabberController(Controller):
@property
def header(self):
return f'{Fore.LIGHTGREEN_EX... | dukensk/smg | mediagrabber/controllers.py | controllers.py | py | 1,704 | python | ru | code | 0 | github-code | 18 | [
{
"api_name": "common.controllers.Controller",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "colorama.Fore.LIGHTGREEN_EX",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "colorama.Fore",
"line_number": 12,
"usage_type": "name"
},
{
"api_n... |
43374956457 | # -*- coding: utf-8 -*-
__license__ = 'GPL v3'
import os, re
try:
from qt.core import (Qt, QVBoxLayout, QLabel, QComboBox, QApplication, QSizePolicy,
QGroupBox, QButtonGroup, QRadioButton, QDialogButtonBox, QHBoxLayout,
QProgressDialog, QSize, QDialog, QCheckBox, QS... | Hopkins1/TradSimpChinese | dialogs.py | dialogs.py | py | 24,736 | python | en | code | 90 | github-code | 18 | [
{
"api_name": "calibre.gui2.tweak_book.widgets.Dialog",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "calibre.gui2.tweak_book.widgets.Dialog.__init__",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "calibre.gui2.tweak_book.widgets.Dialog",
"line_number"... |
28589358007 | import pandas as pd
import sqlalchemy
import requests
import sqlite3
DATABASE_LOCATION = "sqlite:///users.sqlite"
def get_user(url="https://randomuser.me/api/"):
response = requests.get(url)
if response.status_code == 200:
payload = response.json()
result = payload.get("results", [])
... | AdavidGuevara/airflow-randonUserAPI | main.py | main.py | py | 1,714 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "sqlite3.connec... |
35010675835 | import numpy as np
import scipy
np.set_printoptions(threshold=np.inf)
def main():
lines = []
max_x, max_y, max_z = 0, 0, 0
with open("input.txt", "r") as f:
for line in f:
lines.append(line.strip("\n"))
x, y, z = (int(x) for x in line.strip("\n").split(","))
ma... | sjerzykiewicz/advent_of_code | 2022/Day_18/main.py | main.py | py | 1,122 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "scipy.ndimage.generat... |
7151534911 | # Raspberry_Pi
import wave #wavファイルを扱うためのライブラリ
import pyaudio
# import webapi
WAVE_OUTPUT_FILENAME = "sample.wav" #音声を保存するファイル名
iDeviceIndex = 0 #録音デバイスのインデックス番号
def MakeWavFile(FileName = "sample.wav", Record_Seconds = 60):
#生音声取得時の設定
CHUNK = 1024 #1024個のデータをfsというサンプル周波数で取ってきた。
FORMAT = pyaudio.paInt16
CHA... | akamatsu-kenji/Raspberry_Pi | README.py | README.py | py | 1,426 | python | ja | code | 0 | github-code | 18 | [
{
"api_name": "pyaudio.paInt16",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pyaudio.PyAudio",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "wave.open",
"line_number": 35,
"usage_type": "call"
}
] |
43561674658 | import multiprocessing
import sys
import cv2
import random
import numpy as np
import os
import mmap
import torchvision.transforms as transforms
from PIL import Image
import torch
import time
def random_crop(image, crop_height, crop_width):
max_x = image.shape[1] - crop_width + 1
max_y = image.shape[0] - crop_he... | gpzlx1/dataloading | src/performance/raw.py | raw.py | py | 3,187 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.random.randint",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.randint",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.ran... |
2087913785 | from django.db.models import fields
from rest_framework import serializers
from products.models import Products
from rest_framework_simplejwt.tokens import AccessToken, RefreshToken, TokenError
class ProductsSerializer(serializers.ModelSerializer):
class Meta:
model = Products
fields = [
... | KingTwice/Restaurant-BackEnd | products/serializers.py | serializers.py | py | 1,073 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "products.models.Products",
"line_number": 9,
"usage_type": "name... |
41014333599 | from matplotlib import pyplot as plt
from Point import Point
# Constructing cutoff of a polygon by segments using the Cirus-Beck algorithm
def init_points_for_polygon():
points = []
xs = [2, 4, 9, 12, 14, 15, 12, 6, 1]
ys = [3, 1, 1, 3, 7, 12, 14, 13, 7]
for i in range(len(xs)):
x = Point(xs... | Tshmofen/Computational-Geometry-BSU | python_examples/lab10/task.py | task.py | py | 4,156 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "Point.Point",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "Point.Point",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "Point.Point",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "Point.Point",
"line_number": ... |
7959312148 | import os
from werkzeug.contrib.fixers import ProxyFix
from flask import Flask, redirect, url_for, render_template
from flask_dance.contrib.google import make_google_blueprint, google
from raven.contrib.flask import Sentry
os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1'
os.environ['OAUTHLIB_RELAX_TOKEN_SCOPE'] = '1'
a... | leerobertsprojects/Flask | Flask Code/Flask_Dance/google.py | google.py | py | 1,292 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.environ",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask_dance.contrib.google.m... |
15022905214 | import requests
import json, sys
from dewiki import parser
def wiki():
if len(sys.argv) != 2:
print("1 argument required")
else:
url = 'https://en.wikipedia.org/w/api.php'
page = sys.argv[1].replace(" ", "_")
PARAMS = {
"action": "query",
"titles": page... | vladdez/Django-Piscine | 03/ex02/request_wikipedia.py | request_wikipedia.py | py | 1,090 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.argv",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number... |
10215111356 | import logging
import sys
# BUG FIX: https://github.com/tensorflow/tensorflow/issues/26691
try:
# Capirca uses Google's abseil-py library, which uses a Google-specific
# wrapper for logging. That wrapper will write a warning to sys.stderr if
# the Google command-line flags library has not been initialized... | Devansh2005/Util | arimo/util/log.py | log.py | py | 1,673 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.root.removeHandler",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "logging.root",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "absl.logging.logging",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.