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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
72865635422 | from typing import Any, Optional, Tuple, Union
import torch
import torch.nn as nn
from torch.autograd import Function
from ..utils import ext_loader, is_tuple_of
ext_module = ext_loader.load_ext(
'_ext', ['riroi_align_rotated_forward', 'riroi_align_rotated_backward'])
class RiRoIAlignRotatedFunction(Function):... | Ascend/ModelZoo-PyTorch | PyTorch/contrib/cv/semantic_segmentation/MMseg-swin/mmcv/mmcv/ops/riroi_align_rotated.py | riroi_align_rotated.py | py | 5,008 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "utils.ext_loader.load_ext",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "utils.ext_loader",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.autograd.Function",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typi... |
20060873291 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import torch.nn as nn
# Do not change these imports; your module names should be
# `CNN` in the file `cnn.py`
# `Highway` in the file `highway.py`
# Uncomment the following two imports once you're ready to run part 1(f)
from cnn import CNN
from highway import Highwa... | kitu2007/NLP-CS224N | model_embeddings.py | model_embeddings.py | py | 2,993 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "torch.nn.Embedding",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line... |
9965860023 | '''
This could be improved by using networkx during part 1 instead of walking back and forth repeatedly
- may be a task for a later date.
'''
class Node():
def __init__(self, x,y, path, closed, result, goal=False):
self.x = x
self.y = y
self.path = path
self.closed = closed
s... | p-mckenzie/Advent_of_Code_2019 | day15.py | day15.py | py | 5,196 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "networkx.Graph",
"line_number": 112,
"usage_type": "call"
},
{
"api_name": "networkx.dijkstra_path",
"line_number": 136,
"usage_type": "call"
},
{
"api_name": "intComputer.IntcodeComputer",
"line_number": 150,
"usage_type": "call"
}
] |
16066774739 | # -*- coding: utf-8 -*-
import chainer
from chainer import cuda
import csv
import sys
import time
import random
import copy
import math
import os
import numpy as np
import argparse
import configparser
sys.path.append(os.getcwd())
from src.lib.trainer import NSNTrainer, NDNTrainer
from src.lib.utils import createOpba... | funalab/QCANet | src/tools/train.py | train.py | py | 4,968 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number"... |
28437240079 | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
class Model:
def __init__(self, converter, policies, mutator, crossover, scaler=None):
self._converter = converter
self._policies = policies
self._scaler = scaler
self._mutator = mutator
... | GeorgeFucker/Genetic-Algorithms | src/models/model.py | model.py | py | 5,690 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.arange",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "numpy.ceil",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "numpy.log2",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "numpy.random.choice",
"line_nu... |
73587176864 | # coding=utf-8
__author__ = 'pengchong.lee'
import re
import os
from passlib import hash
ALGORITHM_MAPPER = {
1: hash.md5_crypt,
5: hash.sha256_crypt,
6: hash.sha512_crypt
}
def crypt(word, salt):
standard_salt = re.compile('\s*\$(\d+)\$([\w\./]*)\$')
match = standard_salt.match(salt)
i... | dscdtc/violentPython | 1.unixCracker/crypt.py | crypt.py | py | 768 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "passlib.hash.md5_crypt",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "passlib.hash",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "passlib.hash.sha256_crypt",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name"... |
33702436259 | from django.shortcuts import render,redirect
from .models import Image,Category,Location
from django.http import Http404
# Create your views here.
def gallery(request):
images = Image.objects.all()
locations = Location.objects.all()
return render(request,'all-gallery/gallery.html',{'images':images,'locatio... | mazimpakar/Gallery | gallery/views.py | views.py | py | 1,428 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "models.Image.objects.all",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "models.Image.objects",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "models.Image",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "models.L... |
5585133156 | from torch import nn as nn
from torch.nn import functional as F
class MLP(nn.Module):
def __init__(self, d_in: int, d_out: int, arch_spec: list, f_act=None):
"""
A standard multi-layer perceptron.
:param d_in: number of input features.
:param d_out: number of output features.
... | phymucs/MetaBO | metabo/policies/mlp.py | mlp.py | py | 1,544 | python | en | code | null | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.ModuleList",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
40564332898 | from typing import List
a = [[1, 2, 3],
[4, 5, 1]]
def min_val(arr):
path = []
bottom = len(a)-1
right = len(a[0])-1
x, y = 0, 0
while x != bottom or y != right:
value = arr[x][y]
path.append(value)
if x+1 <= bottom:
value_below = arr[x+1][y]
if... | JoshHill15/algos | arrays/max_of_min_altitudes.py | max_of_min_altitudes.py | py | 2,972 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 59,
"usage_type": "name"
}
] |
513517534 | import os
import jinja2
import webapp2
from stream import Stream
JINJA_ENV=jinja2.Environment(loader=jinja2.FileSystemLoader(
os.path.dirname(__file__)),
extensions=['jinja2.ext.autoescape'],
autoescape=True)
class viewAllStreamsPage(webapp2.RequestHandler):
def get(self):
template=JINJA_ENV.get_template('viewAllS... | XIONGZHENGxz/connexus | viewAllStream.py | viewAllStream.py | py | 574 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "jinja2.Environment",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "jinja2.FileSystemLoader",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
7877943899 | #!/usr/bin/env python
import sys
from scapy.all import *
from prettytable import PrettyTable
from mac_vendor_lookup import MacLookup
from argparse import ArgumentParser
from scapy.layers.l2 import Ether
from scapy.layers.l2 import ARP
from sys import exit,stderr,argv
class NetworkScanner():
def __init__(self,hos... | utkarsh0210/Practice | netscan.py | netscan.py | py | 1,691 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "scapy.layers.l2.Ether",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "scapy.layers.l2.ARP",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "prettytable.Pretty... |
43361626383 | #!/usr/bin/env python
import sympy
import mpmath
import numpy as np
max_order = 6
max_angular = 10
expansion_points = np.arange(-50, 50, dtype=np.float64)
offset = - int(expansion_points[0])
num_points = len(expansion_points)
z,z0 = sympy.symbols('z z0', assume='real')
a = sympy.symbol... | peter-reinholdt/pyboys | make_taylor.py | make_taylor.py | py | 1,252 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "numpy.arange",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.float64",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sympy.symbols",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sympy.symbols",
"line... |
16343201736 | import decimal
import math
from rest_framework import generics
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.status import HTTP_201_CREATED, HTTP_400_BAD_REQUEST, HTTP_200_OK
from products.models import Product
from products.serializers import ProductS... | PavelKimm/beverages | products/views.py | views.py | py | 2,994 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "rest_framework.generics.ListAPIView",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.generics",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "rest_framework.generics.CreateAPIView",
"line_number": 13,
"usage_type":... |
2264153247 | from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException
from selenium.common.exceptions import StaleElementReferenceExceptio... | tomer-feld/data_mining | web_scraper.py | web_scraper.py | py | 12,763 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 123,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 123,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 125,
"usage_type": "call"
},
{
"api_na... |
72035618142 | import tensorflow as tf
import pickle_utils as pu
import itertools as it
import numpy as np
import collections
import os
import sys
from tqdm import tqdm
import common
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)),
'..', 'GRUD-baseline'))
from read_tfrecord... | rhaps0dy/ts-baselines | clean_ventilation/unsupervised_interpolation.py | unsupervised_interpolation.py | py | 12,692 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.path.insert",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
69819642144 | # Set of all $D_{i*}$, $D_{*j}$, $d_{ij}$ that were deleted.
# Input: D - dataframe
import pymongo
import pandas as pd
import pprint
def get_invalid_items():
'''All $d_{ij}$ that were deleted'''
ents_id = relations.find({'prov:relation_type': 'wasInvalidatedBy'}, {'prov:entity': 1, '_id': 0}).distinct('prov:entity'... | GiuliaSim/Provenance | queries/invalidation.py | invalidation.py | py | 2,719 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"line_number": 91,
"usage_type": "call"
}
] |
71309717022 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | openstack/openstacksdk | openstack/tests/unit/test_fakes.py | test_fakes.py | py | 2,805 | python | en | code | 245 | github-code | 7 | [
{
"api_name": "openstack.tests.unit.base.TestCase",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "openstack.tests.unit.base",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "openstack.test.fakes.generate_fake_resource",
"line_number": 21,
"usage... |
7647340953 | import gym
import torch
import scipy.signal
from torch import nn
import numpy as np
env = gym.make("CartPole-v1")
device = torch.device("cpu")
num_episodes = 1<<16
max_episode_len = 500
hidden_size = 256
action_size = 2
state_size = 4
discount = 0.95
action_space = [0, 1]
device = torch.device("cpu")
T = 1
def di... | lakhalouahid/rl-stage-projets | policy_gradient/cartpole/vac-common-cartpole.py | vac-common-cartpole.py | py | 3,649 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "gym.make",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "scipy.signal.signal.lfilter",
"l... |
23642791117 | from twilio.rest import Client
# Your Account SID from twilio.com/console
#account_sid = "AC5b090aa799d85cde150b69de7fd0a53c"
account_sid = "AC83e3d8cbb8187654043b9b713cb422ea"
# Your Auth Token from twilio.com/console
auth_token = "aecde4da36f1e5db3d703b6e57b2d2fc"
client = Client(account_sid, auth_token)
message ... | ybolotnyy/PythonPractice | send_text.py | send_text.py | py | 445 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "twilio.rest.Client",
"line_number": 9,
"usage_type": "call"
}
] |
41923162241 | from cv2 import cv2 as cv
import argparse
import glob
import os
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument("--video_dir")
args = parser.parse_args()
params = vars(args)
videoList = glob.glob(os.path.join(params['video_dir'], '*.mp4'))
videoList += glob.glob(os.path.join(params['video_di... | Sciroccogti/CSL-video-caption | dataset/video_info.py | video_info.py | py | 963 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
649120292 | from geograpy import extraction
import datefinder
def get_response(user_in, seq2seq_models, wv_model):
return seq2seq_models.answer(user_in, wv_model=wv_model)
def find_dates(message):
available_dates, flag = datefinder.find_dates(message), True
date_departure, date_return = None, None
for flight_da... | songhuiwinnie/happy | src/response.py | response.py | py | 953 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datefinder.find_dates",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "geograpy.extraction.Extractor",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "geograpy.extraction",
"line_number": 23,
"usage_type": "name"
}
] |
6811805439 | import six
from kmip.core import enums
from kmip.core import exceptions
from kmip.core import objects
from kmip.core import primitives
from kmip.core import utils
from kmip.core.messages.payloads import base
class GetAttributeListRequestPayload(base.RequestPayload):
"""
A request payload for the GetAttribute... | OpenKMIP/PyKMIP | kmip/core/messages/payloads/get_attribute_list.py | get_attribute_list.py | py | 15,721 | python | en | code | 240 | github-code | 7 | [
{
"api_name": "kmip.core.messages.payloads.base.RequestPayload",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "kmip.core.messages.payloads.base",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "six.string_types",
"line_number": 50,
"usage_type":... |
24514975198 | import random
class Solution:
def __init__(self):
pass
def swap(a, l, r):
a[l], a[r] = a[r], a[l]
def partition(self, arr, start, end):
r = random.randint(start, end)
self.swap(arr, start, r)
pivot = arr[start]
left = start
for i in range(start+1, e... | TobiahRex/algorist | toolbox/sorting/algos/quick_sort.py | quick_sort.py | py | 1,021 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "random.randint",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 36,
"usage_type": "call"
}
] |
35128994369 | from pymongo import MongoClient
import time
import logging
import config
from tweepy import OAuthHandler, Stream
from tweepy.streaming import StreamListener
import json
# Create a connection to MongoDB
client = MongoClient(host='mongodb', port=27017) # host = name of mongodb container, port = port of container
mongo_... | shakila-farjana/Dockerized-data-pipeline | tweet_collector/tweet_collector.py | tweet_collector.py | py | 1,870 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tweepy.OAuthHandler",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "config.CONSUMER_API_KEY",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "... |
44302518444 | from xml.etree import ElementTree
from classes import XmlCodebook
file_path = "R:\\project\\DSY\\XML Codebook\\M48NT2AT.xml"
my_tree = ElementTree.parse(file_path)
myCB = XmlCodebook(my_tree)
def listUniqueAttrVals(xml_element_list, attr_name):
attr_list = list()
for xml_element in xml_element_li... | dyee-air/xml2data | work.py | work.py | py | 498 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "classes.XmlCodebook",
"line_number": 8,
"usage_type": "call"
}
] |
11329348394 | # # # -*- coding: utf-8 -*-
# # # @Author : 翟会德
# # # @Time : 2019-06-09 11:26
# # # @File : requests_study.py
# # # @Software: PyCharm
# # import random
# # import requests
# # import json
# # from requests import Request, Session
# # from contextlib import closing
# #
# # import config
# #
# #
# # def is_json(... | singerZhai/zhaihuide | Demo/demo.py | demo.py | py | 4,180 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "queue.Queue",
"line_number": 162,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 166,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 166,
"usage_type": "name"
},
{
"api_name": "time.slee... |
24846461149 | import random
import requests
import os
import pandas as pd
from timeit import default_timer as timer
def float_seconds_to_time_str(seconds, decimal_places_to_round_to):
if seconds < 60.0:
time = f"{round(seconds, decimal_places_to_round_to)} seconds"
elif seconds / 60.0 < 60.0:
time = f"{roun... | SpectreSpect/steam-review-vote-prediction | scripts/data_loading_2.py | data_loading_2.py | py | 4,868 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 47... |
19733365789 | #!/usr/bin/env python
# -*- encoding:utf-8 -*-
import argparse
import flask
import sys
import lib.vehicles.api as vehicles_api
def make_app():
'''Create the Flask application.
'''
app = flask.Flask(__name__)
app.config['JSON_AS_ASCII'] = False
app.register_blueprint(vehicles_api.blueprint, url_p... | erlkonig/trim | application.py | application.py | py | 1,001 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "lib.vehicles.api.blueprint",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "lib.vehicles.api",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "argparse... |
74483477662 | '''
code adapted from https://github.com/haroldsultan/MCTS/blob/master/mcts.py by Jan H. Jensen 2018
'''
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import Descriptors
from rdkit.Chem import rdmolops
import time
import numpy as np
import random
import pickle
#import networkx as nx
import s... | jensengroup/GB-GM | GB-GM-MCTS.py | GB-GM-MCTS.py | py | 10,208 | python | en | code | 20 | github-code | 7 | [
{
"api_name": "rdkit.rdBase.DisableLog",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "rdkit.rdBase",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "rdkit.Chem.Descriptors.MolLogP",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "r... |
33328200620 | from flask import Flask, render_template
import pandas as pd
import matplotlib.pyplot as plt
from io import BytesIO
import base64
import matplotlib
from helper import *
matplotlib.use('Agg')
app = Flask(__name__)
data = load_data()
@app.route("/")
def index():
# generate value for cards
percent_fraud = float(pd.... | indrafauzanjr/Capstone---Final-Project | app.py | app.py | py | 1,443 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "matplotlib.use",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.crosstab",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
... |
21812921397 | from collections import deque
queue = deque(["Eric", "John", "Michael"])
queue.append("Terry") # Terry arrives
queue.append("Graham") # Graham arrives
queue.popleft() # The first to arrive now leaves
'Eric'
queue.popleft() # The second to arrive now leaves
'John'
#prin... | absimpson/Python-Examples | data_structures.py | data_structures.py | py | 2,370 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.deque",
"line_number": 2,
"usage_type": "call"
}
] |
8791782570 | from datetime import datetime
from anarchyutil import k8s_ref
import kubernetes
import logging
import os
import threading
import time
import uuid
from anarchygovernor import AnarchyGovernor
operator_logger = logging.getLogger('operator')
class AnarchySubject(object):
"""AnarchySubject class"""
@staticmethod... | pabrahamsson/anarchy-operator | operator/anarchysubject.py | anarchysubject.py | py | 15,923 | python | en | code | null | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "kubernetes.client",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "anarchyutil.k8s_ref",
"line_number": 140,
"usage_type": "call"
},
{
"api_name": "kuberne... |
35303013009 |
from time import sleep
import requests
import json
def main():
URL = "http://127.0.0.1:8000/items/"
body = {
"name": "sepatu",
"description": "sepatu gunung",
"price": 120,
"tax": 2.3
}
resp = requests.post(URL, json.dumps(body))
print(resp.json())
if __nam... | arizka85/FastApi-Japan | Section4/test_client_api.py | test_client_api.py | py | 417 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.post",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 31,
"usage_type": "call"
}
] |
9891026855 | # coding: utf-8
"""
Add location_id column to instruments table.
"""
import os
import flask_sqlalchemy
from .utils import table_has_column
MIGRATION_INDEX = 127
MIGRATION_NAME, _ = os.path.splitext(os.path.basename(__file__))
def run(db: flask_sqlalchemy.SQLAlchemy) -> bool:
# Skip migration by condition
... | sciapp/sampledb | sampledb/models/migrations/instruments_add_location_id.py | instruments_add_location_id.py | py | 613 | python | en | code | 21 | github-code | 7 | [
{
"api_name": "os.path.splitext",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAl... |
4151513794 | import pandas as pd
import json
import boto3
import time
def lambda_handler(event, context=None):
athena = boto3.client('athena', region_name='ap-south-1')
s3_athena_dump = "s3://prod-and-staging-athena-query-results/prod-athena-dumps/"
database = "avileap_prod"
s3_dumps = 'prod-athena-dumps'
buck... | indraNeel177/AWS_lambda_backup | lambda_mumbai_re/DelayCodes.py | DelayCodes.py | py | 3,121 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "boto3.client",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "boto3.resource",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"li... |
34928575822 | from netCDF4 import *
import pyproj
import numpy as np
import time
import datetime as dtm
def time_block_report(message,told):
""" This routine is for reporting incremental timing of parts of the script"""
tnew=time.time()
diff = tnew - told
print("%s : %s" % (message,diff))
return tnew
# Fo... | CADWRDeltaModeling/schimpy | schimpy/cencoos_download.py | cencoos_download.py | py | 10,602 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "time.time",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pyproj.Proj",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 43... |
39291594516 | from PIL import Image
import sys
from pprint import pprint
sys.setrecursionlimit(1500)
def open_image(file_params: dict) -> Image:
try:
image = Image.open(file_params["full_path"])
return image
except FileNotFoundError:
print(fr"файл {file_params['old_name']}.{file_params['format']}... | FofuHupopo/ASI | tools/processing_images/cut_images.py | cut_images.py | py | 3,488 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.setrecursionlimit",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "PIL.Image",
"line_n... |
22851562585 | import json
from collections import Counter
from collections import defaultdict
def extract_sorted_reaction_dict(
reaction_src_file_path: str = "data/knowledge_base/"
"reactions.json",
reaction_target_file_path: str = "data/knowledge_base/"
... | gsus84/distsupvis_adr | src/kb_preprocessing/reaction_name_extraction.py | reaction_name_extraction.py | py | 1,543 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "json.dump",
... |
39099891574 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from forward import *
import time as tm
import os
import numpy as np
from numpy import genfromtxt
import matplotlib.pyplot as plt
#path = 'Data'
#os.mkdir(path)
start_time = tm.strftime('%H:%M:%S')
#Dato experimentales
path = '/home/ramiro/Documentos/CIC-2022-kira/Imág... | rirastorza/Intro2MI | problema_directo/script_test0.py | script_test0.py | py | 6,167 | python | es | code | 0 | github-code | 7 | [
{
"api_name": "time.strftime",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.Circle",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 55,
"usage_type": "name"
},
{
"api_name": "matplotlib.p... |
31891412584 | import json
import boto3
import os
import re
s3 = boto3.resource('s3')
comprehend = boto3.client('comprehend')
firehose = boto3.client('firehose')
entity_should_be_filtered = re.compile('^[\d#@]+$')
def lambda_handler(event, context):
print(event)
for record in event['Records']:
s3_bucket = record['... | ysano/twitter-dashboard | tweet_analysis/lambda_function.py | lambda_function.py | py | 3,039 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "boto3.resource",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number":... |
25153567685 | from pathlib import Path
from setuptools import find_packages, setup
version = (Path("src/netspresso_trainer") / "VERSION").read_text().strip()
readme_contents = Path("README.md").read_text()
requirements = Path("requirements.txt").read_text().split('\n')
requirements_optional = Path("requirements-optional.txt").re... | Nota-NetsPresso/netspresso-trainer | setup.py | setup.py | py | 1,471 | python | en | code | 10 | github-code | 7 | [
{
"api_name": "pathlib.Path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number":... |
43798810419 | import argparse
import subprocess
from Davinci import Davinci
parser = argparse.ArgumentParser(
prog='BashGPT',
description='What the program does')
parser.add_argument('-q', '--question', action='store_true')
parser.add_argument('-s', '--show', action='store_true')
args, unk... | struharv/bash_gpt | bash_gpt.py | bash_gpt.py | py | 1,007 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "Davinci.Davinci",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "Davinci.Davinci",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "subprocess.run... |
24886816679 | """
Description:
Static reference to main window, including method to center window on screen
Author:
Edson Kropniczki - (c) jul/2019 - all rights reserved
License:
just keep this header in your copy and feel free to mess up with this code as you wish;
source code also public... | webargus/LabProg | Tools.py | Tools.py | py | 1,473 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime.now",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "da... |
10672482672 | from tqdm import tqdm
DECRYPT_KEY = 811589153
with open("./day_20.in") as fin:
lines = fin.read().strip().split("\n")
nums = list(map(int, lines))
for i in range(len(nums)):
nums[i] = (i, nums[i] * DECRYPT_KEY)
n = len(nums)
og = nums.copy()
def swap(nums, a, b):
assert (0 <= a < n) and (... | womogenes/AoC-2022-Solutions | day_20/day_20_p2.py | day_20_p2.py | py | 927 | python | en | code | 19 | github-code | 7 | [
{
"api_name": "tqdm.tqdm",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 25,
"usage_type": "call"
}
] |
43698239442 | from fastapi import FastAPI
app = FastAPI()
@app.get("/")
async def root():
return "¡Hola FastAPI, mi primera API!"
@app.get("/url")
async def url_():
return {"url_myweb":"https://trebool.wordpress.com/"}
# Inicia el server: uvicorn main:app --reload
# Detiene el server: CTRL+C
# Documentación con Swagger... | carmenbvg/Python_Backend_with_FastAPI | FastAPI/main.py | main.py | py | 408 | python | es | code | 0 | github-code | 7 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 3,
"usage_type": "call"
}
] |
18628873161 | import random
import requests
API_URL = 'http://cryptlygos.pythonanywhere.com' #DON'T Change this
my_id = 26628 # CHANGE this into your ID number
#server communication. Try to get p and t
endpoint = '{}/{}/{}'.format(API_URL, "q1", my_id )
response = requests.get(endpoint)
p = 0
t = 0
if response.ok:
res = res... | basakamasya/Cryptography | HW2/Q1_student.py | Q1_student.py | py | 2,461 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "requests.put",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "requests.put",
"line_number": 79,
"usage_type": "call"
}
] |
27674950475 | from __future__ import unicode_literals
from decimal import Decimal
from django.conf import settings
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.utils.timezone import now
from django.utils.translation import pgettext_lazy
from django_prices... | glosoftgroup/glosoftgroup-django-pos | saleor/allocate/models.py | models.py | py | 10,089 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "django.db.models.Manager",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "django.db.models.Sum",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "d... |
70673698464 | import pandas as pd
from scipy.spatial import distance
female = pd.read_csv('/data/female/female_data_t.csv')
female = female.drop('성별', axis=1)
female = female.dropna(how='all')# if in row has null drop
female.set_index('고객번호',inplace=True)
female.to_csv('/female/female_data_total.csv', index=True, encoding ='utf-8... | pouoq34/clustering-human-body | euclidean.py | euclidean.py | py | 976 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "scipy.spatial.distance.euclidean",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "scipy... |
16379312297 | """
URL configuration for the leeway application.
See :mod:`~opendrift_leeway_webgui.core.urls` for the other namespaces of this project.
For more information on this file, see :doc:`django:topics/http/urls`.
"""
from django.conf import settings
from django.conf.urls.static import static
from django.urls import includ... | digitalfabrik/opendrift-leeway-webgui | opendrift_leeway_webgui/leeway/urls.py | urls.py | py | 1,508 | python | en | code | 8 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "views.IndexRedirectView.as_view",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "views.IndexRedirectView",
"line_number": 20,
"usage_type": "name"
},
{
"api_name... |
23380354810 | from openpyxl import load_workbook
from Common import read_path
class DoExcel():
def __init__(self,filename,sheet):
self.filename=filename
self.sheet=sheet
def get_lilte(self):
wb=load_workbook(self.filename)
sheet=wb[self.sheet]
get_lilte=[]
for i in range(1... | SHIHUN1/untitled7 | Common/doexcel.py | doexcel.py | py | 1,015 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 31,
"usage_type": "call"
}
] |
2320325832 | import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = (12, 8)
import gc
import os
import ast
import sys
import configparser
import glob
import librosa
import librosa.display
from scipy.stats import mode
from keras.models import Sequential
from keras.models import Model
from keras.layers import Input, LSTM
... | khusss/ailabseoul | test.py | test.py | py | 4,858 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 2,
"usage_type": "name"
},
{
"api_name": "os.listdir",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "os.path.jo... |
7407651193 | import pycuda.autoinit
import pycuda.gpuarray as gpuarray
import pycuda.driver as cuda
import numpy as np
free_bytes, total_bytes = cuda.mem_get_info()
exp = 10
print(free_bytes)
print(total_bytes)
while True:
fill_floats = free_bytes // 4
if fill_floats < 0:
raise RuntimeError("Could'nt find allocat... | Raghvender1205/CUDA_GPUProgramming | PyCUDA/Fill_with_Nan.py | Fill_with_Nan.py | py | 595 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pycuda.driver.mem_get_info",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pycuda.driver",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "pycuda.gpuarray.empty",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pycuda.g... |
7687911533 | '''
This script exemplifies usage of Seaborn Library heatmap figures.
For more details, see: https://seaborn.pydata.org/
'''
import seaborn as sb
import matplotlib.pyplot as plt
# Seaborn library has some example built-in data sets. You can use sb.get_dataset_names() to list the available data sets.
# Lets use one of... | mustafaozen/python-libraries | Seaborn Library/DataVisualization_heatmap.py | DataVisualization_heatmap.py | py | 811 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "seaborn.load_dataset",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "seabo... |
72863941662 | import random
import numpy as np
import torch.utils.data as data
import utils.utils_image as util
class DatasetPlain(data.Dataset):
'''
# -----------------------------------------
# Get L/H for image-to-image mapping.
# Both "paths_L" and "paths_H" are needed.
# -----------------------------------... | Ascend/ModelZoo-PyTorch | PyTorch/contrib/cv/others/SwinIR/data/dataset_plain.py | dataset_plain.py | py | 3,347 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "utils.utils_image.get_image_paths",
"line_number": 27,
"usage_type": "call"
},
{
"ap... |
36713961048 | """
=====================================================
Black and White box tests for /isPrime/{number} route
=====================================================
"""
import requests
from test_util import get_is_prime_route, get_random_primes
PRIME_ROUTE = get_is_prime_route()
def test_valid_primes():
"""
... | mjdall/FlaskStressTest | prime_server_test/test_is_prime.py | test_is_prime.py | py | 1,840 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "test_util.get_is_prime_route",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "test_util.get_random_primes",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": ... |
40571752065 | # import libraries
from bs4 import BeautifulSoup
import csv
from urllib.request import urlopen
def page_scrape(args):
c = 0
i = 0
while c <= 200:
str, = args[i]
html = urlopen(str)
soup = BeautifulSoup(html, 'html.parser')
name_box = soup.find('h1', attrs={'id': 'event-heading'})
detail... | leinadjmc/bigdatahackathon | HTML scraper.py | HTML scraper.py | py | 1,622 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 28,
"usage_type": "call"
}
] |
42903863558 | import sqlalchemy.orm
from flask import Blueprint, render_template, request, g
from src.website.models import Grades, GradesMultiple
from src.website.forms import CourseForm
from src.website.views import render_default
bp = Blueprint('courses', __name__, url_prefix='/courses')
@bp.before_request
def get_url():
g... | asiddiqi18/GradeDistroTamuApp | src/website/views/courses.py | courses.py | py | 1,424 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Blueprint",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.g.url",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "flask.g",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "flask.request.url",
"line... |
24113984968 | from uuid import UUID
import uuid
from fastapi import APIRouter, Cookie
from fastapi.param_functions import Depends
from starlette.websockets import WebSocketDisconnect
from bridge import BridgeListener
from cache import use_bridge, use_connections
from status import ConnectedUsers, Connection, keep_connection
from s... | Liviere/gamelog-api | app/routers/websockets.py | websockets.py | py | 1,281 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "status.Connection",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "status.ConnectedUsers",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "bridge.Brid... |
43410301842 | import dataset
import tensorflow as tf
import matplotlib.pyplot as plt
from argparse import ArgumentParser
class linear_estimator:
def __init__(self,trainable_weights,trainable_bias):
self.trainable_weights=tf.Variable(trainable_weights,dtype=tf.float32)
self.trainable_bias=tf.Variable(trainable_bias,dtype=tf.fl... | TheUnsolvedDev/ML-with-TF-2 | linear_regression.py | linear_regression.py | py | 1,980 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tensorflow.Variable",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tensorflow.float32",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.Variable",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tensorf... |
23774353640 | import sys
import cv2
from random import randrange
import numpy as np
import imutils
import time
class Block:
def __init__(self, _type="S"):
self.pos_x = 1
self.pos_y = 1
self.type = _type
self.mask = self.createMask()
def setPosition(self, _x, _y):
self.pos_x =... | krebsalad/Tetris_Challenge | run.py | run.py | py | 9,816 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "time.time",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 65,
"usage_type": "attribute"
},
{
"api_name": "cv2.rectangle",
"line_numb... |
39207453920 |
from telegram.ext import Updater, CommandHandler
# -*- coding: utf-8 -*-
import telebot
import time
TOKEN='895180391:AAHqS-rECfYK2Ibs0jEayVTn4xnH6psayac'
# REQUEST_KWARGS={
# 'proxy_url': 'https://185.36.191.39:5588',
# # Optional, if you need authentication:
# 'urllib3_proxy_kwargs': {
# 'usernam... | pristupaanastasia/mashine_can_see | hak.py | hak.py | py | 1,328 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "telebot.TeleBot",
"line_number": 19,
"usage_type": "call"
}
] |
25459603608 | from django.http import HttpResponse
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect
from .models import PrePassangerData,PostPassangerData,CancelTicketRequest
from train.models import trainRecord
from train import models as tra... | mr2space/railline | booking/views.py | views.py | py | 9,532 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "stripe.api_key",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "railline.settings.STRIPE_SECRET_KEY",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 19,
"usage_type": "call"
},
{
"... |
41350609134 | from flask import Flask, jsonify
import random
app = Flask(__name__)
#add new terms as new lines, makes it easier to merge in git
words = ['amigo',
'bra',
'brah',
'bro',
'broski',
'brotha',
'brother',
'bud',
'buddy',
'compadre',
... | ReshefElisha/BroApi | BROApi.py | BROApi.py | py | 752 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_numb... |
35878514360 | import sys, signal
# code to handle Ctrl+C, convenience method for command line tools
def signal_handler( signal, frame ):
print( "You pressed Ctrl+C. Exiting...")
sys.exit( 0 )
signal.signal( signal.SIGINT, signal_handler )
import logging, glob, os, warnings, qtmodern.styles, qtmodern.windows
from PyQt5.QtWid... | tanimislam/nprstuff | nprstuff/cli/rest_email.py | rest_email.py | py | 5,841 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "sys.exit",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "signal.signal",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "signal.SIGINT",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "warnings.simplefilter",
"l... |
28660101051 |
from docx import Document
import os
dict = {}
for filename in os.listdir("documents"):
if filename.endswith(".docx") :
print("reading :" + filename)
document = Document("documents/" + filename)
docText = '\n\n'.join([
paragraph.text for paragraph in document.paragraphs
... | gauravmahajan28/Marathi_Stopword_Removal | docxreader.py | docxreader.py | py | 788 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.listdir",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "docx.Document",
"line_number": 9,
"usage_type": "call"
}
] |
16259510453 | from setuptools import setup
with open("tomsup/about.py") as f:
v = f.read()
for l in v.split("\n"):
if l.startswith("__version__"):
__version__ = l.split('"')[-2]
def setup_package():
setup(version=__version__)
if __name__ == "__main__":
setup_package()
| KennethEnevoldsen/tomsup | setup.py | setup.py | py | 297 | python | en | code | 58 | github-code | 7 | [
{
"api_name": "setuptools.setup",
"line_number": 12,
"usage_type": "call"
}
] |
856715716 | from bs4 import BeautifulSoup
from uiuc_apartments.shared import AgencyBase, Apartment
import re
class MHM(AgencyBase):
url = "https://www.mhmproperties.com/apartments/?_sft_types=apartments"
name = "MHM"
def get_all(self):
apartments = []
page = self.session.get(self.url).text
sou... | uiuc-apartments/uiuc-apartments.com | function_build/uiuc_apartments/agencies/mhm.py | mhm.py | py | 2,567 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "uiuc_apartments.shared.AgencyBase",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "uiuc_ap... |
28439147138 | from setuptools import setup, find_packages
import os
with open("README.md", encoding='utf-8') as f:
long_description = f.read()
setup(
name = 'ComplexAssembler',
version = '1.0',
description = "Macrocomplex builder",
scripts = ['ComplexAssembler/assemble.py'],
long_description = long_descript... | anasf97/SBI-Project | setup.py | setup.py | py | 850 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "setuptools.setup",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 25,
"usage_type": "call"
}
] |
30656936467 | from .helper import LMSException
from .binIO import BinaryMemoryIO
from typing import Callable, Any
from abc import ABC
__all__ = ["LMSAdapter"]
class LMSAdapter(ABC):
"""
An interface that can be implemented to adapt features specific to some games, such as special message tags, styles,
attributes, and ... | SunakazeKun/pymsb | pymsb/adapter.py | adapter.py | py | 13,701 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "abc.ABC",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "binIO.BinaryMemoryIO",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"li... |
3616190343 | import requests
from api.api_phpread import change_key_names, get_json_from_page
from api.gd_target_api import search_level
request_session = requests.Session()
async def post_name_demonlist(name_level:str,timeout=3):
name_level = name_level.strip()
headers = {'User-Agent': '','Content-Type':'applicat... | MigMatos/Geometry-Dash-API-in-Python | api/api_demonlist.py | api_demonlist.py | py | 1,180 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.Session",
"line_number": 5,
"usage_type": "call"
}
] |
37591092038 | from django.db import models
# Create your models here.
class SeedStarsUser(models.Model):
name = models.CharField(
max_length=100,
help_text="Name : "
)
email = models.EmailField(
unique=True,
help_text="Email ... | jpmbrito/seedstarsChallenge | django_app/seedstars/models.py | models.py | py | 476 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.db.models.Model",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "... |
25631672145 | from collections import deque
import functools
numberOfTestCases = int(input())
numberOfPeopleInQueue = []
maxAmountThatCanBeWithdrawn = []
theAmountEachPersonNeeds = []
solution = []
queue = deque()
def sorter(i, j):
ki = int(i[1][0]/i[1][1])
kj = int(j[1][0]/j[1][1])
if ki < kj:
return -1
el... | zabdulre/Algorithms- | google-kickstart-f-2020/roundf-2020-atm.py | roundf-2020-atm.py | py | 1,729 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.deque",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "functools.cmp_to_key",
"line_number": 34,
"usage_type": "call"
}
] |
14954771682 | from numpy import linalg
import tlehelp as tlehelp
import measurements
import numpy as np
import skyfield.api as sf
import argparse
import sys
class BruteForceSolver:
"""
The brute force solver uses the tle database and the measurements to take an expensive but effective approach to solving the satellite
"... | cromulencellc/hackasat-qualifier-2022 | crosslinks/challenges/challenge_1/solver/cost_solver.py | cost_solver.py | py | 4,447 | python | en | code | 15 | github-code | 7 | [
{
"api_name": "tlehelp.available",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tlehelp.available",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "skyfield.api.load.tle_file",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "skyfie... |
5150485586 |
#!/usr/bin/env python
import sys
import argparse
import os
import subprocess
import os.path
prog="cutadapt.py"
version = """%prog
Copyright (C) 2017 Wang Genomic Lab
VerTect is free for non-commercial use without warranty.
Please contact the authors for commercial use.
Written by Atlas Khan, ak4046@cumc.columbia.e... | Iamprashanth-1/covid_virtec | VerTect_cutadapt.py | VerTect_cutadapt.py | py | 1,607 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"l... |
41384059341 | import numpy as np
import pyqtgraph.opengl as gl
from pyqtgraph.Qt import QtCore, QtGui
# 创建二维数据网格
x = np.linspace(-5, 5, 50)
y = np.linspace(-5, 5, 50)
X, Y = np.meshgrid(x, y)
Z = np.sin(np.sqrt(X**2 + Y**2))
# 创建GLViewWidget并添加到图形窗口
app = QtGui.QApplication([])
w = gl.GLViewWidget()
w.opts['distance'] = 20
w.show(... | jastrun/robotAppDesign | widget/darwsurface.py | darwsurface.py | py | 570 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.linspace",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.meshgrid",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_numbe... |
17573338823 | from pathlib import Path
from typing import List
import pytest
from PIL.Image import Image
from py_config import resources_dir, model_dir
from src.segmentation.segmentor import ImageSegmentor
from tests.markdown_file_creator import MarkdownFileCreator
@pytest.fixture(scope='session')
def segmentor():
model_path... | Badisches-Landesmuseum/xcurator | data-enrichment/1-artefact-object-color/tests/segmentation/test_segmentor.py | test_segmentor.py | py | 2,522 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "py_config.model_dir",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "src.segmentation.segmentor.ImageSegmentor",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 12,
"usage_type": "call"
},
{
"api_... |
21323392414 | from typing import List
class Solution:
def findDifference(self, nums1: List[int], nums2: List[int]) -> List[List[int]]:
set_1 = set(nums1)
set_2 = set(nums2)
n1 = [nums1[i] for i in range(len(nums1))]
n2 = [nums2[i] for i in range(len(nums2))]
for i in range(len(nums1)):
... | m318021/LeetCode-Solution | LeetCode/2215-Find-the-Difference-of-Two-Arrays/2215-2.py | 2215-2.py | py | 830 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 3,
"usage_type": "name"
}
] |
73377623262 | from flask import Flask, redirect, url_for, render_template,request
import requests
from urllib.request import urlopen
from bs4 import BeautifulSoup
def queueData():
data=[]
URL = 'https://www.studytonight.com/data-structures/queue-data-structure'
page = requests.get(URL)
content = page.content
soup... | Deekshan001/Flask-project | server.py | server.py | py | 4,850 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"l... |
40457193040 | import pandas as pd
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import IntegrityError
import os
from app.models.movie import MovieModel
from app.models.producer import ProducerModel
from app.models.producer_movie import ProducerMovieModel
from flask import Fl... | bkpedrosuper/golden-raspberry-awards-backend | app/db_files/db_utils.py | db_utils.py | py | 3,298 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.basicConfig",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "flask_sq... |
41454187645 | from django.conf.urls import url
from . import views
app_name = 'user_profile'
urlpatterns = [
url(r'^$', views.profile, name='profile'),
url(r'^avatar/$', views.avatar, name='avatar'),
url(r'^bookings/$', views.bookings, name='bookings'),
url(r'^bookings/(?P<id>[\w-]+)/$', views.bookingItems, name='b... | sofiaRoum/thesis | user_profile/urls.py | urls.py | py | 336 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.co... |
26300110399 | import curses
import traceback
from game import Game
from soundplayrrr import BeatLoop
def runner(stdscr):
stdscr.timeout(0)
stdscr.nodelay(1)
curses.nl()
curses.curs_set(0)
game = Game(stdscr)
game.draw()
curses.init_pair(1, curses.COLOR_BLUE, curses.COLOR_BLACK)
curses.init_pair(2... | sideb0ard/Experimental-Jet-Set-Trashed-Willy | main.py | main.py | py | 920 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "curses.nl",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "curses.curs_set",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "game.Game",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "game.draw",
"line_number": 15... |
28909025578 | import os
from datetime import datetime
import pathway as pw
from llm_app.model_wrappers import OpenAIChatGPTModel
# api_key = os.environ["HF_API_KEY"]
api_key = os.environ["OPENAI_API_KEY"]
# model = HFApiTextGenerationTask(api_key=api_key)
model = OpenAIChatGPTModel(api_key=api_key)
def prompt(index, embedded_q... | sethigeet/instigpt-prototype | api/prompt.py | prompt.py | py | 1,236 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "llm_app.model_wrappers.OpenAIChatGPTModel",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 19,
"usage_type": "call"
},
{
"ap... |
72737848862 | import sys
import os
sys.path.append(os.path.abspath(''))
from utils.evaluate import evaluate_pair_precision, evaluate_entity_precision
import json
import random
import re
import jieba
import pkuseg
from datetime import datetime
from utils.configure import STOPWORDS_PATH, TRAIN_DATA_PATH, PKUBASE_MENTION2ENT_COLLE... | Tenggou/CCKS2020_task1_KBQA | preprocess/train_filter_prepare.py | train_filter_prepare.py | py | 7,878 | python | en | code | 13 | github-code | 7 | [
{
"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.abspath",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
6604236969 | #This intial code does not work, since its out of bounds
# This also has a lot of redundancies.
# read about all the libiraries like urllib.parse.
from flask import Flask,redirect,request
import requests
from urllib.parse import quote#
import requests
import base64
import json
app = Flask(__name__)
app.config... | saiarvind1997/noob | Spotify/main_3.py | main_3.py | py | 5,361 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "urllib.parse.quote",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "flask.redirect",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get"... |
11624532949 | __author__ = 'yingboli'
import colorsys
import numpy as np
import glob
from PIL import Image
from skimage.color import convert_colorspace
import matplotlib.pyplot as plt
path='../data/image/'
folder=['1301','1304']
for i in xrange(len(folder)):
list=glob.glob(path+folder[i]+'/*.jpg')
list.sort()
for j in ... | lantuzi/python-video-mmr | b_2_hsv.py | b_2_hsv.py | py | 777 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "glob.glob",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "skimage.color.convert_colorspace",... |
27527756309 | import random as r
from collections import Counter
import time
from typing import List
console_output = False
def show(x="", delay=0):
"""Print something for human interaction if `console_output` is set `True`."""
if console_output:
print(x)
time.sleep(delay)
def roll(num_dice=6):
"""Ro... | pgoellnitz/tenk | tenk/game.py | game.py | py | 4,254 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "time.sleep",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
... |
11615440658 | from twilio.rest import Client
import os
import time
import schedule
def send_msg():
account_sid = os.environ.get("ACCOUNT_SID")
auth_token = os.environ.get("AUTH_TOKEN")
client = Client(account_sid, auth_token)
client.messages.create(
from_='whatsapp:+14155238886',
bod... | tushar2007/Whatsapp | main.py | main.py | py | 506 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.environ.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_nu... |
36517833299 | from urllib.request import Request, urlopen, ssl, socket
from urllib.error import URLError, HTTPError
import json
from datetime import datetime
def getexpirydate(base_url,port):
out=[]
hostname = base_url
context = ssl.create_default_context()
data ={}
with socket.create_connection((hostname, port)... | giridhararao/SSL-certificate-expiry-date-checker | checker.py | checker.py | py | 991 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "urllib.request.ssl.create_default_context",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "urllib.request.ssl",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "urllib.request.socket.create_connection",
"line_number": 11,
"usage_type": "ca... |
4301483934 | import tensorflow as tf
import pandas as pd
from IPython import clear_output
from helper import make_input_fn, convert_to_training_data
clear_output()
r_train = convert_to_training_data('test-img.jpg')['R']
df_train = convert_to_training_data('download.jfif')
# extracting the last 10% of sample data to be used as eva... | kamalhisyam/rally-workshop | train_model.py | train_model.py | py | 1,527 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "IPython.clear_output",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "helper.convert_to_training_data",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "helper.convert_to_training_data",
"line_number": 8,
"usage_type": "call"
},
{
... |
24349666568 | import os
import shutil
from argparse import ArgumentParser
def main(experiment: str):
if experiment == "main":
with open("results.csv", "w") as fp:
fp.write(
"Seed,Fold,Baseline,Topk,Explainer,Lambda_1,Lambda_2,Accuracy,Comprehensiveness,Cross Entropy,"
"Log O... | alibaba/sreworks-ext | aiops/ContraLSP/mortalty/reset.py | reset.py | py | 1,294 | python | en | code | 13 | github-code | 7 | [
{
"api_name": "os.path.exists",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "shutil.rmtree",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
... |
24289832954 |
from google.cloud import bigquery
import os
import json
PROJECT_ID = 'data-test-sde'
KEY_FILE_PATH = 'key/data-test-sde-app-key.json'
DATASET_RAW = 'raw'
def get_biquery_client():
'''
return client connection to bigquery
'''
client = bigquery.Client.from_service_account_json(KEY_FILE_PATH, project=PR... | emailayuen/data-test-sde-alan-B | warehouseInsertLambdaFunction.py | warehouseInsertLambdaFunction.py | py | 1,644 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "google.cloud.bigquery.Client.from_service_account_json",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "google.cloud.bigquery.Client",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "google.cloud.bigquery",
"line_number": 14,
"usag... |
74909421662 | import pyautogui
import webbrowser
import time, sys, random
def initializePyAutoGUI():
# Initialized PyAutoGUI
# https://pyautogui.readthedocs.io/en/latest/introduction.html
# When fail-safe mode is True, moving the mouse to the upper-left corner will abort your program.
pyautogui.FAILSAFE = True
f... | spegla/portfolio | PythonBot/EVEOnline/automining.py | automining.py | py | 3,771 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pyautogui.FAILSAFE",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pyautogui.moveTo",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pyautogui.click",
... |
29504691260 | import torch
import torchvision
import torch.nn as nn
import torch.optim as optim
import numpy as np
import matplotlib.pyplot as plt
import os
from models import CNN
from PIL import Image
BATCH_SIZE = 100
WEIGHT_DECAY = 0.005
LEARNING_RATE = 0.0001
EPOCH = 11
PATH = "Dataset"
transform = torchvision.transforms.Compo... | koichi-github/splatoon-app | CNN/MNIST/detect.py | detect.py | py | 1,111 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "torchvision.transforms.ToTensor",
"line_number": 18,
"usage_type": "call"
},... |
35354687967 | from flask import Flask, request, jsonify
import numpy as np
from models import superresolution, detect_layout, lp_ocr, layout_parse_text
from config import exec_net, lp_model
from helper import plot_layout, to_rgb
app = Flask(__name__)
@app.route("/")
def index():
return '''
<h1>Welcome to Computer Vision M... | mohammad-oghli/CV-Models-Service | models-API/server.py | server.py | py | 2,600 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"li... |
40067914922 | # https://www.acmicpc.net/problem/9019 문제 제목 : DSLR , 언어 : Python, 날짜 : 2020-01-11, 결과 : 성공
# 처음 봤을때는 그냥 BFS돌리면 풀리겠구나 했는데 생각치도 못한곳에서 발목을 잡혔다.
# 맨처음에는 함수 D,S,L,R을 각각 선언했다. 함수 L,R의 리턴값을 구하는 과정에서 스트링을 쓰면 편리하다고 생각해서
# 정수형 > 문자열 > 정수형 이런식의 형변환이 이루어 지게끔 코드를 작성했다. 하지만 이 부분이 문제였다.
# 그래서 결국 질문게시판을 돌아다니며 다른분들의 L, R 부분의 코드를 참고해 코... | SpicyKong/problems | BOJ/Q_9019.py | Q_9019.py | py | 3,497 | python | ko | code | 3 | github-code | 7 | [
{
"api_name": "sys.stdin.readline",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.readline",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
... |
4836492654 | import cv2
import numpy as np
img = cv2.imread("Resources/imag.png")
width,height = 250,350
pts1 = np.float32([[111,219],[287,188],[154,482],[352,440]])
pts2 = np.float32([[0,0],[width,0],[0,height],[width,height]])
# to change the orientation of image we use below func.
matrix = cv2.getPerspectiveTransfor... | Shyam9899/Virtual-Paint-Using-OpenCV | WarpPerspective.py | WarpPerspective.py | py | 466 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.getPerspectiveTransform",
... |
71540710303 | import torch
from torch import nn
from transformers import BertModel, BertTokenizer
class TextClassificationModel(nn.Module):
def __init__(self, num_class):
super(TextClassificationModel, self).__init__()
# Load BERT model and tokenizer
self.bert = BertModel.from_pretrained("prajjwal1/bert... | MilesZoltak/cs224u_final_proj | model.py | model.py | py | 800 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "transformers.BertModel.from_pretrained",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tr... |
15754355354 | from tortoise import fields
from tortoise.models import Model
from tortoise.contrib.pydantic import pydantic_model_creator
class HostUser(Model):
id = fields.IntField(pk=True)
host_email = fields.CharField(max_length=50, unique=True)
host_id = fields.CharField(max_length=100, unique=True)
created_at ... | kiash1/zoom-client | app/models/tortoise/models.py | models.py | py | 1,212 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tortoise.models.Model",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "tortoise.fields.IntField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tortoise.fields",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "tortoise.... |
23186795856 | #!/usr/bin/env python
""" yaml test """
from itertools import chain
from collections import namedtuple
import yaml
Stack = namedtuple("stack", ["file_name", "name", "parameters"])
KEY_REQUIRE = "require"
KEY_STACKS = "stacks"
KEY_NAME = "name"
KEY_PARAMETERS = "args"
def scope_pick(scope, part):
""" get part o... | JugosD/aws-cf-sync | yaml_test.py | yaml_test.py | py | 1,338 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.namedtuple",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 46,
"usage_type": "call"
}
] |
14625781942 | from bbpyp.common.model.equatable_state import EquatableState
from collections import Iterable
class DuckType(EquatableState):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def create_properties(_self, **key_word_args):
for key, value in key_word_args.items():... | BloggerBust/bbpyp | bbpyp/common/model/duck_type.py | duck_type.py | py | 1,300 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "bbpyp.common.model.equatable_state.EquatableState",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "collections.Iterable",
"line_number": 11,
"usage_type": "argument"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.