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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
20610247281 | import datetime as dt
import logging
import os
from typing import List, Tuple, Optional
from stocker import FundNotFoundException, add_indicators, Stock, StockServer
import matplotlib.pyplot as plt
logger = logging.getLogger()
def setup_loggers(args_parsed):
""" Funkcija namesti izpisovanje v datoteko in na konzol... | aljazmedic/stock-prediction | __init__.py | __init__.py | py | 2,823 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "logging... |
70559866558 | import requests
import pandas as pd
header = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36 OPR/82.0.4227.33"
}
url = "https://api.github.com/users/aytiqaqash/repos"
response = requests.get(url, headers=header).json()
print(respo... | aytiqaqash/ScrapingWithPython | githubApi.py | githubApi.py | py | 382 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 12,
"usage_type": "call"
}
] |
9057883566 | import json
from typing import List
from cluster_migration_core.cluster_management.docker_framework_client import DockerFrameworkClient, DockerVolume
from cluster_migration_core.cluster_management.cluster import Cluster
from cluster_migration_core.cluster_management.cluster_objects import ClusterSnapshot
from cluster_... | opensearch-project/opensearch-migrations | experimental/cluster_migration_core/cluster_migration_core/core/framework_state.py | framework_state.py | py | 3,663 | python | en | code | 22 | github-code | 97 | [
{
"api_name": "cluster_migration_core.cluster_management.docker_framework_client.DockerFrameworkClient",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "cluster_migration_core.core.test_config_wrangling.TestConfig",
"line_number": 32,
"usage_type": "name"
},
{
"api_name... |
302124638 | import io
import logging
import threading
import time
from datetime import datetime
import aiohttp
import pandas
import plotly.express as px
import requests
from aiocache import cached
from aiohttp import ContentTypeError
STARTUP_DEBOUNCE = True
COINS = requests.get("https://api.coingecko.com/api/v3/coins/list").json... | lAmeR1/kaspa_tg_bot | plot.py | plot.py | py | 3,113 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "aiohttp.ClientSession",
... |
31447719319 | # -*- coding: utf-8 -*-
from django.contrib.sites.models import Site
from django.contrib.sites.models import get_current_site
from django.conf import settings
from opps.channels.models import Channel
class URLMiddleware(object):
def process_request(self, request):
"""
if the requested site is id ... | opps/opps | opps/core/middleware.py | middleware.py | py | 1,094 | python | en | code | 313 | github-code | 97 | [
{
"api_name": "django.contrib.sites.models.get_current_site",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.ROOT_URLCONF",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 19,
"usage_type... |
41110667379 | import string
from collections import Counter
with open("input.txt") as f:
data = (l.strip(string.whitespace) for l in f.readlines())
total = 0
group_answers = ""
group_size = 0
for l in data:
if l == "":
c = Counter(group_answers)
total += sum(1 for v in c.values() if v == group_size)
... | kubasobon/aoc2020 | day06/part2.py | part2.py | py | 615 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "string.whitespace",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "collections.Counter",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 23,
"usage_type": "call"
}
] |
22935703855 | # -*- coding: utf-8
from apis.models import Resource, App
from commons.settings import PRIVATE_REGISTRY
import yaml
REDIS_CLIENT_META = '''
appname: hello
build:
base: golang
script:
- go build -o hello
release:
dest_base: ubuntu
copy:
- src: hello
dest: /usr/bin/hello
use_resources:
redis:... | laincloud/console | apis/tests/test_resource.py | test_resource.py | py | 2,321 | python | en | code | 10 | github-code | 97 | [
{
"api_name": "apis.models.App",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "apis.models.App",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "yaml.safe_load",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "yaml.safe_dump",
"... |
25911841894 | #!/usr/bin/env python
"""Sample script of recurrent neural network language model.
This code is ported from the following implementation written in Torch.
https://github.com/tomsercu/lstm
"""
import argparse
import numpy as np
import chainer
import chainer.functions as F
import chainer.links as L
from cha... | benkrause/human-level-text-prediction | main.py | main.py | py | 10,898 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "numpy.prod",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "numpy.random.normal",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "numpy.float32",
... |
42056915231 | #!/usr/bin/env python
import sys
from datetime import datetime
import numpy
def write_date(f):
t = datetime.now()
f.write('File written on ')
f.write(t.strftime('%d%b%Y at %H:%M:%S'))
f.write('\n\n')
def write_calc_only_A(f): # TODO
f.write('calc_only_A : F\n\n')
def write_real_lattice(f, real_... | kcantosh/BerryPI | win2nnkp.py | win2nnkp.py | py | 6,398 | python | en | code | null | github-code | 97 | [
{
"api_name": "datetime.datetime.now",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "numpy.transpose",
"line_number": 126,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.i... |
35981144081 | from functools import reduce
def find_maxprod(s, n):
lst = list(map(int, s))
idx, prod = 0, reduce(lambda x, y: x*y, lst[:n])
cur_prod = prod
for i in range(n, len(lst)):
cur_prod = cur_prod * lst[i] // lst[i-n]
# print(prod, lst[i], lst[i-n], cur_prod)
if cur_prod > prod:
... | chuyg1005/python | code/basic/find_maxprod.py | find_maxprod.py | py | 504 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "functools.reduce",
"line_number": 6,
"usage_type": "call"
}
] |
41576925080 | import json
import requests
import datetime
from json import encoder
import logData
import Account
class OandaInstruments():
def __init__(self,urlBase,token):
acc = urlBase
self.urlBase = "https://"+urlBase+"/v3/"
self.urltype = "instruments/"
self.headerGet = {"Content-Type": "ap... | Correiaprofessional/Oanda | Instruments.py | Instruments.py | py | 2,074 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": ... |
21392598858 | import os
import random
import cv2
import numpy as np
import torch
def seed_everything(seed):
random.seed(seed)
os.environ['PYTHONHASHSEED'] = str(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
torch.backends.cudnn.deterministic = True
torch... | aliray/newclds | raysearching/utils.py | utils.py | py | 463 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "random.seed",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.seed",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"lin... |
18616774361 | """Given an array of integers, return a new array such that each element at index i of the new array is the product of all the numbers in the original array except the one at i.
For example, if our input was [1, 2, 3, 4, 5], the expected output would be [120, 60, 40, 30, 24]. If our input was [3, 2, 1], the expected ou... | rslindee/daily-coding-problem | 002_array_index.py | 002_array_index.py | py | 1,191 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "functools.reduce",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 23,
"usage_type": "call"
}
] |
2233087301 | import logging
from django.db import connection, connections
from usaspending_api.etl.broker_etl_helpers import dictfetchall, PhonyCursor
from usaspending_api.etl.management import load_base
logger = logging.getLogger("script")
class Command(load_base.Command):
"""
This command will derive all FABS office ... | fedspendingtransparency/usaspending-api | usaspending_api/broker/management/commands/derive_office_names.py | derive_office_names.py | py | 5,511 | python | en | code | 265 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "usaspending_api.etl.management.load_base.Command",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "usaspending_api.etl.management.load_base",
"line_number": 11,
"usa... |
27955507481 | # N.B. using keras rather than tensorflow.keras implementation
# since vggface uses keras so to be compatible with it
from keras.models import Model
from keras.layers import Dense, GlobalAveragePooling2D, Dropout
from keras.layers import Input
from keras.optimizers import SGD
from keras_vggface.vggface import VGG... | IsraelAbebe/plant_disease_experiments | Plant_Disease_Detection_Benchmark_models/VGG/finetune.py | finetune.py | py | 2,243 | python | en | code | 22 | github-code | 97 | [
{
"api_name": "keras_vggface.vggface.VGGFace",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "keras.layers.Input",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "keras.layers.GlobalAveragePooling2D",
"line_number": 26,
"usage_type": "call"
},
{
... |
72583679038 | from tree_sitter import Tree
def traverse_tree(tree: Tree):
# https://github.com/tree-sitter/py-tree-sitter/issues/33
cursor = tree.walk()
reached_root = False
while reached_root == False:
yield cursor.node
if cursor.goto_first_child():
continue
if cursor.goto_ne... | daniel57060/master-parser | c_inspectors/__traverse_tree.py | __traverse_tree.py | py | 595 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tree_sitter.Tree",
"line_number": 4,
"usage_type": "name"
}
] |
24123013367 | #!/opt/Tools/anaconda3/envs/hysplit/bin/python
# -----------------------------------------------------------------------------
# Air Resources Laboratory
#
# rundispersion.py - run HYSPLIT dispersion model
#
# 05 Jun 2023 (AMC) -
# 27 Jun 2023 (AMC) - Added 'source description' to inp hash for more flexibility in
# ... | noaa-oar-arl/utilhysplit | ashapp/rundispersion.py | rundispersion.py | py | 15,808 | python | en | code | 9 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "ashapp.ashruninterface.Mo... |
74905893758 | import pickle
from utils import normalize, l2_nearest
import numpy as np
class OOV:
"""Class for Handling OOV words"""
def __init__(self, lexicon, list_all_symbols, freq_tokens):
self.lexicon = lexicon
# Encoding should be "bytes" or latin1"
self.words_with_embeddings, self.embedding... | ArnaudYoh/SNLP | NLPProject/system/oov.py | oov.py | py | 6,557 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pickle.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "utils.normalize",
... |
2850477229 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" system """
import os
import logging as log
import sys
import math
""" package """
import utility
import config
from lib.pydub import AudioSegment
#import pygame
def sound_dict(value):
displacement = 0
sound = AudioSegment.silent(0)
if type(value) is list:
try:
... | Larpon/pyClickTrack | pyClickTrack.py | pyClickTrack.py | py | 3,181 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "lib.pydub.AudioSegment.silent",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "lib.pydub.AudioSegment",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "lib.pydub.AudioSegment.from_wav",
"line_number": 23,
"usage_type": "call"
},
{
... |
11852871621 | import pygame
from sys import exit
from random import randint
def display_score():
score_surf = score_font.render(f'Score: {score}', False, (255, 255, 255))
score_rect = score_surf.get_rect(center = (400, 60))
screen.blit(score_surf, score_rect)
def menu_score():
menu_surf = menu_font.render... | Kartow/catch_apples | game.py | game.py | py | 8,636 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "random.randint",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "pygame.init",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "pygame.display",
... |
25702454987 | from Bio import SeqIO
from Bio.SubsMat.MatrixInfo import pam250
INF = 1000000000
protiens = []
with open('rosalind_loca.fasta', 'r') as f:
for record in SeqIO.parse(f, 'fasta'):
protiens.append(record.seq)
x, y = protiens
dp = [[0 for i in range(len(y)+1)] for j in range(len(x)+1)]
bt = [[0 for i in ... | nutstick/rosalind | loca.py | loca.py | py | 1,575 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "Bio.SeqIO.parse",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "Bio.SeqIO",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "Bio.SubsMat.MatrixInfo.pam250",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "Bio.SubsMat.Mat... |
6204307437 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
init = nn.init.xavier_uniform_
uniform_init = nn.init.uniform
def sparse_dropout(x, keep_prob):
msk = (torch.rand(x._values().size()) + keep_prob).floor().type(torch.bool)
idx = x._indices()[:, msk]
val = x._values()[msk]
... | MTandHJ/RePo | Sequential/MAERec/modules.py | modules.py | py | 13,075 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "torch.nn.init",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.nn.init",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_numb... |
15318102680 | from bs4 import BeautifulSoup as BS4
import requests
import smtplib
from email.mime.text import MIMEText
import time
def find_number_of_meals(day):
if day == 'Saturday' or 'Sunday':
return 2
else:
return 3
def scrape_decider(number_of_meals, date):
if number_of_meals == 2:
brunch... | OscarEReyes/Menu-Bot | Menu Scraper.py | Menu Scraper.py | py | 3,241 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "email.mime.text.MIMEText",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "email.mime.te... |
2918316421 | """
Unit tests for pre-trained BERT tokenizer.
"""
import os
import pickle
import tempfile
import tensorflow as tf
from texar.tf.data.tokenizers.bert_tokenizer import \
BERTTokenizer
from texar.tf.utils.test import pretrained_test
class BERTTokenizerTest(tf.test.TestCase):
def setUp(self):
vocab_t... | asyml/texar | tests/data/tokenizers/bert_tokenizer_test.py | bert_tokenizer_test.py | py | 6,700 | python | en | code | 2,369 | github-code | 97 | [
{
"api_name": "tensorflow.test",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "tempfile.TemporaryDirectory",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path... |
74772916799 | import csv
from collections import OrderedDict
from lorem_text import lorem
import h3
import logging
import requests
import json
from fred_client import FredClient
import numpy as np
import datetime
from Request import db
class CacheStrategy:
def update_keygroup(self, new_file_ids:list, old_file_ids:dict) -> dict... | Corgam/LEO-CDN | satellite/satellite.py | satellite.py | py | 20,650 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "collections.OrderedDict",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 142,
"usage_type": "call"
},
{
"api_name... |
36711764181 |
import os
import SimpleITK as sitk
import numpy as np
from sklearn.metrics import confusion_matrix
if __name__ == '__main__':
import os
import sys
sys.path.append(os.path.dirname(
os.path.dirname(os.path.abspath(__file__))))
from kidney_utils.post_process import post_processing_3d_two_biggest_... | Luanabcruz/Tese-Doutorado-DCCMAPI | kidney-tumor-segmentation-method/tools/dice_pred_nii.py | dice_pred_nii.py | py | 2,271 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
41943529076 | #!/usr/bin/python
from sys import argv,stderr,stdout
import h5py
if len(argv) > 1:
fout=stdout
if len(argv) > 2:
fout = open(argv[2])
#-- end if
f=h5py.File(argv[1], "r")
lons=list(f["/Geography/Longitude"])
lats=list(f["/Geography/Latitude"])
for i in range(len(lons)):
... | jodyxha/QHG4 | QHG4/useful_stuff/make_locfile.py | make_locfile.py | py | 502 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "sys.stdout",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "argument"
},
{
"api_name": "sys.argv",
"line_number": 10,
... |
19391128565 | import torch
import torch.nn as nn
import torch.nn.functional as F
class SelfAttentionBlock(nn.Module):
def __init__(self, n_embed: int, head_size: int, max_seq_length: int) -> None:
super().__init__()
self.key = nn.Linear(n_embed, head_size)
self.query = nn.Linear(n_embed, head_size)
... | TobiasJacob/tinychatgpt | tinychatgpt/models/blocks/SelfAttention.py | SelfAttention.py | py | 1,192 | python | en | code | 0 | github-code | 97 | [
{
"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.Linear",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numbe... |
3408845989 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 17/7/3 下午5:56
# @Author : C.C
# @File : study2.py
import calendar
import datetime
import keyword
cal = calendar.month(2017,2)
print("输出2017年2月份的日历")
print(cal)
datetim = datetime.datetime.now()
print("当前年份为:%s" % datetim.year)
str = "我是"
str = "猪... | cc0819/untitled | study2.py | study2.py | py | 930 | python | zh | code | 1 | github-code | 97 | [
{
"api_name": "calendar.month",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "attribute"
}
] |
73785946878 | import socket
import os
import datetime
from email.utils import formatdate
PORT = 8888
def run_server():
for i in range(3):
server_socket = create_socket(PORT)
log_action("Listening on port: " + str(PORT))
try:
connecting_socket, addr = server_socket.accept()
conne... | KasperOnFire/PythonServer | ServerOnFire.py | ServerOnFire.py | py | 4,970 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "socket.socket",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "socket.SOL_... |
28661239738 | from django import forms
from .models import Tour, Date, Location
from .widgets import CustomClearableFileInput
from django_summernote.fields import SummernoteTextFormField
class TourForm(forms.ModelForm):
class Meta:
model = Tour
fields = '__all__'
image = forms.ImageField(
label='I... | tdawes93/MyWay | products/forms.py | forms.py | py | 1,242 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "models.Tour",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.forms.Image... |
74700124159 | import logging
from collections import OrderedDict
from typing import Any, Dict, List, Tuple, Type
import numpy as np
from scmm.models.embedding.base_embedder import Embedder
from scmm.models.embedding.svd import TruncatedSVDEmbedder
logger = logging.getLogger(__name__)
class MultiLevelEmbedder(Embedder):
def _... | LorenzoCiampiconi/single-cell-multimodal | scmm/models/embedding/multilevel.py | multilevel.py | py | 1,683 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "scmm.models.embedding.base_embedder.Embedder",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 19,
"usage_type": "name"
},
{
"api_nam... |
15396594271 | # -*- coding: utf8 -*-
from datetime import datetime
from schedule.models import Groups, Classes, Exams
from process.models import Term
from django.shortcuts import render
from django.template import RequestContext, Context
def groups_list(request):
groups = Groups.objects.all()
return render(request, 'base... | spbstu/fuit.spbstu.ru | schedule/views.py | views.py | py | 2,468 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "schedule.models.Groups.objects.all",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "schedule.models.Groups.objects",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "schedule.models.Groups",
"line_number": 12,
"usage_type": "name"
... |
1842814072 | from django.shortcuts import render, redirect
from . import forms
from .models import Employee
def emp(request):
if request.method == 'POST':
form = forms.emp_forms(request.POST, request.FILES)
if form.is_valid():
instance = form.save(commit=False)
instance.save()
... | achanyasuresh12/eowner | eOwner/employe/views.py | views.py | py | 474 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 18,
"usage_type": "call"
}
] |
32747850162 | import matplotlib.pyplot as plt
import sys
import csv
'''This data reads in the output from Aggregator.py, and produces a bar chart showing the frequency of all features.
Please specify the inputfile and outputfile on the command line when running this code
'''
data = list(csv.reader(open(str(sys.argv[1]),'r')))
d... | abt1/manga-processing | YesNoBar.py | YesNoBar.py | py | 1,077 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "csv.reader",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
10897130767 | from django.conf.urls import patterns, url
from apps.main import views
urlpatterns = patterns('',
url(r'^$', views.index, name='index'),
url(r'^list/', views.list, name='list'),
url(r'^managewidgets/', views.managewidgets, name='managewidgets'),
) | thess24/simplehomepage | homepage/apps/main/urls.py | urls.py | py | 263 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "apps.main.views.index",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name":... |
16840909033 | import os
import numpy as np
import c_recode
from .recode_header import ReCoDeHeader
from scipy.sparse import coo_matrix
from pathlib import Path
class ReCoDeReader():
def __init__(self, file, is_intermediate=False):
self._source_filename = file
self._current_frame_index = 0
self._c_reader ... | NDLOHGRP/ReCoDe | src/pyrecode/recode_reader.py | recode_reader.py | py | 9,242 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "c_recode.Reader",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "recode_header.ReCoDeHeader",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.uint64",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",... |
18853370698 | import matplotlib.pyplot as plt
import numpy as np
import sfs
from data_lib import params_linear, params_circular, params_real
from skimage.metrics import structural_similarity as ssim
# Do plots using latex
plt.rcParams.update({
"text.usetex": True,
"font.family": "sans-serif",
"font.sans-serif": ["Helvet... | polimi-ispl/deep_learning_soundfield_synthesis_irregular_array | data_lib/results_utils.py | results_utils.py | py | 5,955 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot.rcParams.update",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 8,
"usage_type": "name"
},
{
"... |
32071807351 | from google.cloud import datastore
import requests
from flask import render_template, redirect, session
import flask
import uuid
import string
import random
app = flask.Flask(__name__)
client = datastore.Client()
app.secret_key = str(uuid.uuid4().hex)
ENDPOINT = "https://accounts.google.com/o/oauth2/v2/auth?"
SCOPE =... | allenc1190/osu-classes | cs493/hw6-chanall/main.py | main.py | py | 2,075 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "google.cloud.datastore.Client",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "google.cloud.datastore",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "uuid.... |
4612004978 | import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
src_langs = ['en', 'de', 'it']
tgt_langs = ['de', 'it', 'en']
subset_size = 25000
batch_size = 32
num_epochs = 10
embed_dim = 256
hidden_dim = 512
n_layers = 2
dropout = 0.5
lr = 0.01
make_plots = False
train = True
evaluate = True | 395t/coding-assignment-week-6-seq-1 | src/RNNsearch/hyper_params.py | hyper_params.py | py | 319 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.device",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 3,
"usage_type": "attribute"
}
] |
45070304339 | import pandas as pd
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rcParams['text.usetex'] = True
mpl.rcParams['font.size'] = 18
data = pd.read_csv('fig/l1-v-accuracy.csv')
train_data = data[data['dataset'] == 'train'].sort_values(by="l1")
test_data = data[data['dataset'] == 'test'].sort_values(by="l1")... | Neimhin/msc | machine-learning/week-8/src/l1_v_acc.py | l1_v_acc.py | py | 700 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "matplotlib.rcParams",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplo... |
36365927056 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import stat
import shutil
import argparse
import numpy as np
import tensorflow as tf # pylint: disable=C0411, E0401
from tensorflow.core.protobuf.rewriter_config_pb2 import \
RewriterConfig # pyli... | Ascend/samples | python/level1_single_api/9_amct/amct_tensorflow_ascend/mobilenetv2/src/mobilenetv2_calibration.py | mobilenetv2_calibration.py | py | 8,144 | python | en | code | 78 | github-code | 97 | [
{
"api_name": "amct_tensorflow.set_logging_level",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.path.... |
72589635200 | # # 生成对称矩阵,对角线上元素均为0
# import numpy as np
# X = np.random.rand(5 ** 2).reshape(5, 5) # 创建一个5 * 5方阵
# X = np.triu(X) # 保留其上三角部分
# X += X.T - 2 * np.diag(X.diagonal()) # 将上三角部分”拷贝”到下三角部分
#
# # 写到AP_interference.xlsx
# from openpyxl import Workbook
# wb = Workbook()
# ws = wb.active
# for r in X.tolist():
# ws.append(... | zachary2wave/for_huawei | channel/SpectralClustering.py | SpectralClustering.py | py | 7,962 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "collections.defaultdict",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 191,
"usage_type": "call"
},
{
"api_name": "numpy.triu",
"... |
74653639037 | from rdflib import Namespace, URIRef
from pathlib import Path
import json
SCHEMA_ORG_NAMESPACE = "http://schema.org/"
SCHEMA_ORG = Namespace(SCHEMA_ORG_NAMESPACE)
class RelationHandler():
def __init__(self, relations, client, annotators, props):
self.relations = relations
self.annotators = anno... | mjstrobl/KGP_from_Conversations | modules/relation_handler.py | relation_handler.py | py | 7,770 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rdflib.Namespace",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_numbe... |
73464233280 | import django
from pathlib import Path
import os, sys
BASE_DIR = Path(__file__).resolve().parent.parent
DATA_DIR = (BASE_DIR/'../data').resolve()
sys.path.insert(0, os.path.join(BASE_DIR, 'apps'))
SECRET_KEY = os.getenv('SECRET') or 'example'
DEBUG = bool(os.getenv('DEBUG')) or True
DOMAIN_NAME = os.getenv('DOMAIN_NA... | olegaver-xxx/kolokolnya | src/main/settings.py | settings.py | py | 8,079 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pathlib.Path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path.insert",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_numb... |
8656678183 | import os
import torch
import numpy as np
import json
class wstalDataset():
def __init__(self, datapath, mode, len_snippet, batch):
self.datapath = datapath
self.mode = mode
self.len_snippet = len_snippet
self.batch = batch
self.features = np.load(os.path.join(self.datapath... | MichiganCOG/A2CL-PT | dataset.py | dataset.py | py | 4,599 | python | en | code | 45 | github-code | 97 | [
{
"api_name": "numpy.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 1... |
39679097756 | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
# %%
data = pd.read_csv("data.csv")
# %%
data.drop(["id", "Unnamed: 32"], axis=1, inplace=True)
# malignant = M kotu huylu tumor
# benign = B iyi huylu tumor
# %%
M = data[data.diagnosis == "M"]
B = data[data.diagnosis == "B"]
# scatter plot... | ugurcsen/machine-learning-class | Week_8/DecisionTree.py | DecisionTree.py | py | 1,360 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "matplotlib... |
468659818 | from bs4 import BeautifulSoup as Soup
import requests
import json
import time
ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0"
site = "http://redditlist.com/sfw?page="
pages = range(1, 11)
filename_output = "posts_14112019_new.json"
subreddit_set = set()
for page_index in pages:
... | rahadiankp/bdt19 | mongo-sharding/subredditlist.py | subredditlist.py | py | 2,338 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_nu... |
41812951095 | # Import the 'namedtuple' function from the 'collections' module
from collections import namedtuple
# Set the tuple
#tuple je v podstate object
ovocie = namedtuple("Nazov_identifikacia", "name size expiry")
#typ1 <class '__main__.Nazov_identifikacia'>
#"nazov_identifikacia" je vlastne CLASSNAME
t1 = ovocie(name="Banan... | kovokilla/python | primitivepython.py | primitivepython.py | py | 1,026 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "collections.namedtuple",
"line_number": 5,
"usage_type": "call"
}
] |
18757299954 | from dataclasses import dataclass
from typing import Any, Callable
from .boolean import BooleanNode
__all__ = ("parse",)
"""
WHITESPACE = _{ " " }
number = { ('0'..'9')+ }
name = { ('a'..'z')+ }
threshold = {
"T" ~ number ~ "("
~ (expression ~ ("," ~ expression)*)?
~ ")"
}
brackets = { "(" ~ expression ~ ... | EPICOMM/shamir-sharing-math | secret_sharing/parse.py | parse.py | py | 4,665 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "typing.Callable",
"line_number": 60,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 60,
"usage_type": "name"
},
{
"api_name": "boolean.BooleanNode.... |
42099648608 | """
Running this file will produce plots of the cluster statistics and sample graph
"""
import json
import sys
import os
sys.path.append(os.getcwd())
import numpy as np
import matplotlib
from matplotlib import pyplot as plt
from covid19sim.frozen import decode_message
from collections import defaultdict, Counter
impor... | mila-iqia/COVI-AgentSim | src/covid19sim/plotting/plot_clusters.py | plot_clusters.py | py | 7,538 | python | en | code | 17 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_nu... |
40547962379 | ## custom_django_modules.middleware.*
from django.conf import settings
class SubdomainHandler(object):
"""
Correctly the request to the delegate, based on the subdomain
"""
def process_request(self, request):
req_subdomain = request.get_host().split('.')[0]
if req_subdomain in settings.SUBDOMAIN_UR... | lisp-ceo/django-subdomainer | custom_django_modules/middleware.py | middleware.py | py | 693 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.conf.settings.SUBDOMAIN_URLCONFS.keys",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.SUBDOMAIN_URLCONFS",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 12,
"usag... |
37138457314 |
from django.urls import path, include
from . import views
urlpatterns = [
path('', views.form, name="form"),
path('getProfiles', views.getProfiles, name="getProfiles"),
path('create/', views.create, name="create"),
path('again/', views.again, name="again"),
path('ajax_view/<int:num_id>/', views.aj... | 31519/aws_news | ajax/urls.py | urls.py | py | 351 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"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",
... |
73343510080 | from catalogo import catalogo_bp
from catalogo.dados import listar_cursos_ativos, obter_curso
from flask import render_template, request, session, redirect
@catalogo_bp.route('/')
def index():
return render_template(
'index.html',
cursos=listar_cursos_ativos()
)
@catalogo_bp.route('/sair')
d... | CarlaCCP/desenvolvimentoWeb | Blueprints_Flask/catalogo/controles.py | controles.py | py | 1,036 | python | pt | code | 0 | github-code | 97 | [
{
"api_name": "flask.render_template",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "catalogo.dados.listar_cursos_ativos",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "catalogo.catalogo_bp.route",
"line_number": 7,
"usage_type": "call"
},
{
... |
32049410486 | from scraper_peviitor import Scraper, loadingData
import json
import re
from utils import (translate_city)
from getCounty import get_county
url = " https://jobs.msd.com/gb/en/search-results?qcountry=Romania" # &from=10
company = {"company": "MSD"}
finalJobs = list()
scraper = Scraper()
response = scraper.session.ge... | peviitor-ro/based_scraper_py | sites/msd.py | msd.py | py | 2,060 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "scraper_peviitor.Scraper",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "re.DOTALL",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "re.search",
"l... |
2036679677 | import requests
import json
import pickledb
from zklink_sdk import EthereumSignerWeb3
from web3 import Account
# from zklink_sdk.ethereum_signer import ZkLinkLibrary, ZkLinkSigner
# from zklink_sdk.types import Order, Token
params = {}
private_key = pickledb.load('key.db', False).get("private_key")
address = pickledb.... | zhutianlei24/zkex | 5-post-signup-login.py | 5-post-signup-login.py | py | 1,473 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "pickledb.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pickledb.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "web3.Account.from_key",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "web3.Account",
... |
74912370558 | import datetime as dt
from hamcrest import assert_that, is_
from joj.model import ModelRun
from joj.tests.base import BaseTest
from joj.utils import constants
from joj.utils import output_controller_helper
class TestOutputControllerHelper(BaseTest):
def setUp(self):
self.run_start = None
self.r... | NERC-CEH/jules-jasmin | majic/joj/tests/unit/test_output_controller_helper.py | test_output_controller_helper.py | py | 2,008 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "joj.tests.base.BaseTest",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "joj.utils.constants.JULES_PARAM_RUN_START",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "joj.utils.constants",
"line_number": 18,
"usage_type": "name"
},... |
32786949269 | import requests
import json
# Your Datadog API key
api_key = "YOUR_API_KEY"
# The URL for creating monitors in Datadog
url = "https://api.datadoghq.com/api/v1/monitor"
# Prompting the user for monitor type
monitor_type = input("Enter monitor type (metric alert/service check alert/event alert): ")
# Prompting the us... | vbangale/DatadogMonitorScriptAPI | Datadog_monitor_creation_API_script.py | Datadog_monitor_creation_API_script.py | py | 1,528 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.post",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 45,
"usage_type": "call"
}
] |
13787495366 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
... | hty520848/SecretEarAddon | __init__.py | __init__.py | py | 2,930 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "importlib.reload",
"line_number": 54,
"usage_type": "call"
}
] |
18117018091 | #coding=utf-8
# 아래와 같은 모듈을 import 합니다
# content 에 태깅들 두개로 쪼개서 넣고
# titles 에 원문넣고
# 총 10개 뽑아서 0.5점씩 추가를 한다.
# 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 ( 이거 반대로 스코어링 ))
# 기본은 BM25F 알고리즘 - 이게 뭔지 알아봐야함
import os
from whoosh.index import create_in
from whoosh.fields import *
# indexdir을 색인 폴더로 이용해 봅니다
indexdir = './w... | DevHyung/ETRI-wiseNLU | Whoosh/whoosh_example.py | whoosh_example.py | py | 2,539 | python | ko | code | 0 | github-code | 97 | [
{
"api_name": "os.path.exists",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "whoosh.index.create_in",
... |
33341038113 | import re
import logging
from dependency_management.requirements.PackageRequirement import (
PackageRequirement)
class MavenRequirement(PackageRequirement):
"""
This class is a subclass of ``PackageRequirement``. It specifices the proper
type for ``java`` packages automatically and provide a function... | lugnitdgp/avskr2.0 | ve/Lib/site-packages/dependency_management/requirements/MavenRequirement.py | MavenRequirement.py | py | 2,896 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "dependency_management.requirements.PackageRequirement.PackageRequirement",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "re.compile",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "logging.error",
"line_number": 41,
"usage_type": "call... |
71260600639 | import numpy as np
from asap3.MonteCarlo.Moves.Base import RandSphere
from ase.atoms import Atoms, symbols2numbers
from ase.data import covalent_radii
def RandomBoxAtoms(symbols, cell=[5.0, 5.0, 5.0]):
numbers = symbols2numbers(symbols)
scaled_positions = np.random.uniform(0.0, 1.0, (len(numbers), 3))
re... | auag92/n2dm | Asap-3.8.4/Python/asap3/MonteCarlo/Start.py | Start.py | py | 2,179 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "ase.atoms.symbols2numbers",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random.uniform",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "ase.a... |
71543700478 | import praw
import pandas as pd
data=pd.read_csv('../precog_reddit/reddit-50k.csv')
posts = []
count=0
for url in data['url']:
print(count)
count+=1
reddit = praw.Reddit(client_id='KDMo4mS_QD1eqw', client_secret='RPKj_1mVLobhY7IBbFhHiu0nY4o', user_agent='WebScrapper') # Using credentials to use Reddit API
... | Josh1108/rfp | data_aquisition(4).py | data_aquisition(4).py | py | 607 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "praw.Reddit",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame.from_records",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.DataF... |
5163473777 | from PIL import Image
import numpy as np
import glob
import os
def saveTiffStack(save_path, imgs):
stack = []
for img in imgs:
stack.append(Image.fromarray(img))
stack[0].save(save_path, compression="tiff_deflate",
save_all=True, append_images=stack[1:])
def make_imgs():
imgs = []
#fo... | isseiy/lifegame | try/MakeTiffFromPng.py | MakeTiffFromPng.py | py | 783 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "PIL.Image.fromarray",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
29152673189 | from pyspark.sql import SparkSession
from pyspark import RDD
from pyspark.streaming import StreamingContext
from pyspark.streaming.kinesis import KinesisUtils, InitialPositionInStream, StorageLevel
import time
def run():
APP_NAME = 'kinesis-stream-test'
STREAM_NAME = 'aws-glue-kinesis-test'
ENDPOINT_URL ... | BigMountainTiger/aws-terraform-examples | kinesis/kinesis-streaming-example/pyspark/streaming.py | streaming.py | py | 1,970 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 18,
"usage_type"... |
29242669787 | import tensorflow as tf
import numpy as np
import cv2
from lib.net.DarkNet19 import DarkNet19
from lib.config.Config import config as config
from lib.config.Config import ConfigYOLOv2
from lib.datasets.pascal_voc import pascal_voc
from lib.tools.utils import *
import lib.tools.utils
class YOLOv2():
object_scale ... | LittleSheepy/MyMLStudy | 02DeepLearning/ObjectDetetion/yolo/YOLOv2.py | YOLOv2.py | py | 9,611 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "lib.config.Config.config.batch_size",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "lib.config.Config.config",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "lib.config.Config.config.cell_size",
"line_number": 21,
"usage_type": "... |
15967199722 | from django.urls import path
from . import views
from rest_framework.urlpatterns import format_suffix_patterns
urlpatterns = [
path('posts/', views.PostList.as_view()),
path('posts/<int:pk>/', views.PostDetail.as_view()),
path('posts/collections/<collection>/', views.PostCollectionList.as_view()),
path('posts/<pos... | alex-run-code/blogproject | blog/urls.py | urls.py | py | 497 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"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",
... |
40253216471 | """
Learn to navigate to a URL using Selenium
DISCLAIMER: This code is aimed at Selenium BEGINNERS
For more advanced tutorials and to learn how Qxf2 writes GUI automation, please visit our:
a) Our GUI automation guides: http://qxf2.com/gui-automation-diy
b) Other GitHub repos: https://github.com/qxf2
AUTHOR: Avinash ... | qxf2/selenium-beginners | 01_Navigate_Url.py | 01_Navigate_Url.py | py | 980 | python | en | code | 39 | github-code | 97 | [
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 21,
"usage_type": "name"
}
] |
26925775557 | from collections import deque
import sys
read = sys.stdin.readline
for _ in range(int(read())):
command = read().rstrip()
n = read().rstrip()
nums = read().rstrip()[1:-1].split(',')
R = False
e_flag = False
nums = deque(nums)
if n == '0':
nums = deque()
for s in command:
... | kth321/BOJ | 05400/5430.py | 5430.py | py | 715 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "sys.stdin",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 15,
"usage_type": "call"
}
] |
70828303680 | from PyQt5 import Qt
class SliderDelegate(Qt.QStyledItemDelegate):
def __init__(self, min_value, max_value, parent=None):
super().__init__(parent)
self.min_value = min_value
self.max_value = max_value
self._drag_grabber = None
def sizeHint(self, option, midx):
return Qt... | erikhvatum/RisWidget | ris_widget/qdelegates/slider_delegate.py | slider_delegate.py | py | 5,422 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "PyQt5.Qt.QStyledItemDelegate",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.Qt",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "PyQt5.Qt.QSize",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PyQt5.Qt",
... |
22100493912 | from typing import Any, List
from .constants._sync_mode import ASYNC
import random
from ..native import make_native_object
import sys
matx = sys.modules['matx']
class _SolarizeOpImpl:
""" SolarizeOp Impl """
def __init__(self,
device: Any,
threshold: float = 128.0,
... | bytedance/matxscript | python/matx/vision/solarize_op.py | solarize_op.py | py | 4,014 | python | en | code | 363 | github-code | 97 | [
{
"api_name": "sys.modules",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "typing.Any",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "native.make_native_object",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "typing.List",
... |
29146771338 | #! /bin/python
# -*- coding: utf-8 -*- #
"""
Created 20161014
@author: wcgrizolli
"""
import matplotlib.pyplot as plt
from matplotlib import cm
import numpy as np
import itertools
#import sys
#sys.path.append('/home/grizolli/workspace/pythonWorkspace/wgTools/')
#import wgTools as wgt
import wavepy.utils as wpu
... | APS-XSD-OPT-Group/wavepytools | wavepytools/NRA/pairs.py | pairs.py | py | 1,802 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "numpy.array",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.size",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_n... |
8572908927 | import math
import torch
import torch.nn as nn
from fairseq.models import FairseqEncoder
from sightseq.modules.features_getter import ConvFeaturesGetter
# output dimensionality for supported architectures
OUTPUT_DIM = {
'resnet18': 512,
'resnet34': 512,
'resnet50': 2048,
'resnet101': 2048,
'res... | zhiqwang/sightseq | sightseq/models/text_recognition_encoder.py | text_recognition_encoder.py | py | 4,505 | python | en | code | 122 | github-code | 97 | [
{
"api_name": "fairseq.models.FairseqEncoder",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "fairseq.models.FairseqEncoder",
"line_number": 30,
"usage_type": "argument"
},
{
"api_name": "sightseq.modules.features_getter.ConvFeaturesGetter",
"line_number": 32,
... |
40415980298 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Description of this module/script goes here
:param -f OR --first_parameter: The description of your first input parameter
:param -s OR --second_parameter: The description of your second input parameter
:returns: Whatever your script returns when called
:raises Excep... | rishil321/miscellaneous_projects | pullmohttstats.py | pullmohttstats.py | py | 8,729 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.info",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.firefox.options.Options",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.firefox.firefox_profile.FirefoxProfile",
"line_number": 59,
"u... |
29810195312 | from __future__ import annotations
from collections.abc import Collection
from typing import Any, Literal
import pandas as pd
import plotly.graph_objects as go
from pandas.core.common import flatten
from retentioneering.backend.tracker import (
collect_data_performance,
time_performance,
track,
)
from re... | retentioneering/retentioneering-tools | retentioneering/tooling/funnel/funnel.py | funnel.py | py | 14,031 | python | en | code | 713 | github-code | 97 | [
{
"api_name": "typing.Literal",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "retentioneering.eventstream.types.EventstreamType",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "collections.abc.Collection",
"line_number": 49,
"usage_type": "name"
}... |
22507038904 | # utilities
import re
import numpy as np
import pandas as pd
import nltk
# plotting
import seaborn as sns
from wordcloud import WordCloud
import matplotlib.pyplot as plt
# nltk
from nltk.stem import WordNetLemmatizer
# sklearn
from sklearn.svm import LinearSVC
from sklearn.naive_bayes import BernoulliNB
from sklearn.li... | TahjAnderson23/TweetTopicsSentimentFinder | scripts/sentiment_finder.py | sentiment_finder.py | py | 3,341 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "textblob.TextBlob",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize.RegexpTokenizer",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "nltk.... |
26522611731 | from typing import Dict
from django import template
from lis.models import NormalRange,LaboratoryTest,LaboratoryTestResultType,NormalRange,LaboratoryTestType
from lis.forms import ResultEntryForm,EditSpecimenForm,EditLabTestTypeForm,EditLabTestResultTypeForm
from inpatient_app.models import Bed,WardDischargeSummary,IP... | mulualem1184/HMS | lis/templatetags/custom_dict.py | custom_dict.py | py | 9,418 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.template.Library",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "lis.models.Normal... |
2073930769 | from datetime import datetime
from flask import Flask, request
from flask_sqlalchemy import SQLAlchemy
import raw_data
import json
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] ='sqlite:///:memory:'
db = SQLAlchemy(app)
def get_response(data):
return json.dumps(data), 200, {'Content-Type': 'app... | cxzydna/homework_16 | app.py | app.py | py | 6,353 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "raw_data.users",
... |
73319258560 | import numpy as np
import cv2
import glob
fourcc = cv2.VideoWriter_fourcc(*'XVID')
out = cv2.VideoWriter('animacion_reflexion_total.avi' ,fourcc ,15 ,(1200,1200))
lista = sorted(glob.glob('*'))
for imag in lista:
img = cv2.imread(imag)
# print(imag)
# img = cv2.resize(img,(1000,1000)) #redimensionar
... | knut0815/HiDES | IDL/CODIGO/results/plots/animacion.py | animacion.py | py | 355 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "cv2.VideoWriter_fourcc",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWriter",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_... |
17766072620 | import os
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from pdas.data_utils import load_unified_helper, calc_mesh_bounds
from pdas.prom_utils import load_pod_basis
# mpl.rc("font", family="serif", size="10")
mpl.rc("font", family="sans", size="10")
mpl.rc("axes", labelsize="x-large")
... | cwentland0/pressio-demoapps-schwarz | python/pdas/vis_utils.py | vis_utils.py | py | 9,424 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "matplotlib.rc",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.rc",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.rc",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.rc",
"line_n... |
4940090795 | from django.shortcuts import render
import requests
# Create your views here.
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from nameko.standalone.rpc import ClusterRpcProxy
from .models import Character
from django.http import JsonResponse
f... | facundojmaero/demo-docker | backend-awesome-searchbar/rickAndMorty/views.py | views.py | py | 2,499 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "models.Character.objects.all",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "models.Character.objects",
"line_number": 25,
"usage_type": "attribute"
},
... |
22931294945 | """
Code from lucidrains https://github.com/lucidrains/phenaki-pytorch/blob/main/phenaki_pytorch/phenaki_pytorch.py and modified
"""
import math
import torch
import torch.nn.functional as F
from torch import nn, einsum
from einops import rearrange, repeat
def exists(val):
return val is not None
def default(val... | LAION-AI/phenaki | maskgit.py | maskgit.py | py | 10,246 | python | en | code | 209 | github-code | 97 | [
{
"api_name": "torch.log",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.zeros_like",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.topk",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "torch.full_like",
"line_num... |
24789243059 | import sys
import datetime
print(sys.maxsize)
s=1
for x in range(2147483647):
s = s*2
if(x% 1000000 == 0):
f = open(str(x)+".txt","w")
f.write(str(s))
f.close()
print(x,datetime.datetime.now())
f = open("answer.txt","w")
f.write(str(s))
f.close()
| facedesk/LargeNumbers | 1gb.py | 1gb.py | py | 313 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.maxsize",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "attribute"
}
] |
30189358844 | import markdown
class Article(object):
def __init__(self, md):
if not md.startswith("---"):
return
head = md[4:md.find("---", 3)].split("\n")[:-1]
head = [x.lstrip() for x in head]
for attr in head:
split = attr.find(":")
setattr(self, attr[:sp... | FrostyX/frostyx.cz | blog/content.py | content.py | py | 469 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "markdown.markdown",
"line_number": 17,
"usage_type": "call"
}
] |
18306326836 | import datetime
import sqlite3
from src.database_functions import execute_query
from src.utils import database_cache_path
def main():
date = "2023-01-03"
location = "southeastern-highlands"
db_path = database_cache_path()
assert db_path.exists()
conn = sqlite3.connect(str(db_path))
cursor =... | murraycutforth/Scottish-Winter-Coding | src/print_specific_mwis_forecast.py | print_specific_mwis_forecast.py | py | 507 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "src.utils.database_cache_path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "src.database_functions.execute_query",
"line_number": 18,
"usage_type": "call"
}
] |
24493517876 | import requests,json, time,os,subprocess
from datetime import datetime
url = "https://cdn-api.co-vin.in/api/v2/appointment/sessions/calendarByDistrict?district_id=670&date=16-05-2021"
url2 = "https://cdn-api.co-vin.in/api/v2/appointment/sessions/calendarByDistrict?district_id=670&date=16-05-2021"
flag = True
url_flag... | sachins1211/cowin | other trial versions/cowin.py | cowin.py | py | 2,737 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
3291747516 | import numpy as np
import random
import tensorflow as tf
import keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, SpatialDropout1D
from keras.layers import Activation, Flatten, Input, Masking
from keras.layers import Convolution1D, MaxPooling1D
from keras.utils import np_utils
from ker... | chenhcs/DIFFUSE | demos/model.py | model.py | py | 5,876 | python | en | code | 15 | github-code | 97 | [
{
"api_name": "sys.argv",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "crf.CRF",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "crf.inference",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 40,
... |
39955032659 | from pathlib import Path
from tempfile import TemporaryDirectory
from typing import List, Optional
from unittest.mock import Mock
import pandas as pd # type: ignore
from antarest.core.model import JSON
from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig
from antarest.study.s... | AntaresSimulatorTeam/AntaREST | tests/storage/repository/filesystem/matrix/test_matrix_node.py | test_matrix_node.py | py | 3,087 | python | en | code | 10 | github-code | 97 | [
{
"api_name": "antarest.study.storage.rawstudy.model.filesystem.matrix.matrix.MatrixNode",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "antarest.study.storage.rawstudy.model.filesystem.context.ContextServer",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "... |
739591185 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# irisdc.py
""" Fetches data form a Google Spreadsheet and calculates different variables. """
import argparse
import csv
import json
import sys
import queue
import os
import requests
import mistune
from oauth2client.client import SignedJwtAssertionCredentials
from flas... | civica-digital/iris | app/irisdc.py | irisdc.py | py | 2,495 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "hamlish_jinja.HamlishExtension... |
16664350923 | from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
class CategoryPage():
def __init__(self,driver):
self.driver=driver
... | ciceksepetibootcamp/SenanurCurum_Homework | Week4/python_test/Pages/categoryPage.py | categoryPage.py | py | 1,253 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "selenium.webdriver.support.wait.WebDriverWait",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.support.expected_conditions.visibility_of_element_located",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.sup... |
23919479976 | from typing import List, Dict
class Basic_Adapter:
"""
abstract base class that needs to be subclassed for every special adapter
each special class should have an instantiated transformer_dict in the following structure:
{'db_field_name_for_program': 'key_from_tp_importer', ...}
"""
transform... | skalizzo/TP_Importer | src/tpimporter/adapters/Basic_Adapter.py | Basic_Adapter.py | py | 1,308 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "typing.List",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": ... |
25302438531 | import json
import logging
import collections
import h5py
import sys
sys.path.append('../lofar_data_interface')
import lofarReadSnippet
from stations import stations
logger = logging.getLogger(__name__)
class ObservationDao(object):
@staticmethod
def read_sap_numbers(path):
return lofarReadSnippe... | mesarcik/DL4DI | lofar_data_interface/ObservationDao.py | ObservationDao.py | py | 9,004 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "lofarReadSnippet.read_s... |
25172234417 | from ducho.runner.Runner import MultimodalFeatureExtractor
from datasets import load_dataset
import numpy as np
import os
np.random.seed(42)
def main():
dataset = load_dataset('ashraq/fashion-product-images-small')
dataset = np.array(dataset['train'])[np.random.choice(len(dataset['train']), 100, replace=Fals... | sisinflab/Ducho | demos/demo1/run.py | run.py | py | 1,246 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "numpy.random.seed",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "datasets.load_dataset",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.array",... |
2717798441 | import cv2
import numpy as np
img = cv2.imread('1.jpg',1)
cv2.imshow('src',img )
imgInfo = img.shape
height = imgInfo[0]
width = imgInfo[1] # 获取图像信息 宽度 高度
# 三个位置进行映射 (左上角 左下角 右上角)
matSrc = np.float32([[0,0],[0,height],[width-1,0]])
matDst = np.float32 ([[50,50],[300,height -200],[width-300,100]])
# 组合矩阵
... | kenan666/learngit | 图像几何变换/图像仿射边间.py | 图像仿射边间.py | py | 523 | python | ja | code | 0 | github-code | 97 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": ... |
9270051942 | #!/usr/bin/env python3
import os
import re
import shlex
import subprocess
from pathlib import Path
changed_files = (
subprocess.check_output(shlex.split("git diff --name-only origin/main HEAD"))
.decode()
.split()
)
cov_files = list(
filter(lambda f: re.search(r"(\.cpp|\.c|\.h|\.hpp)$", f), changed_fil... | singagan/mlir-aie | utils/get_git_changed_files.py | get_git_changed_files.py | py | 685 | python | en | code | null | github-code | 97 | [
{
"api_name": "subprocess.check_output",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "shlex.split",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"lin... |
2841664870 | import sys
import glob
import serial
import serial.tools.list_ports
def user_select_port_loop():
"""Boucle d'attente de l'utilisateur pour obtenir le port de la carte arduino
Returns:
str: Port de la carte
"""
liste_ports = serial.tools.list_ports.comports()
ports = [port[0] for port in s... | Valrobotik/Obstacle_visualistor | src/utils/find_serial_port.py | find_serial_port.py | py | 1,230 | python | en | code | null | github-code | 97 | [
{
"api_name": "serial.tools.list_ports.comports",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "serial.tools",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "serial.to... |
12308059970 | import os
import subprocess as subp
from sys import executable
from pyrogram import filters
from pyrogram.enums import ChatType
# from pyrogram.errors import RPCError
from pyrogram.types import (CallbackQuery, InlineKeyboardButton,
InlineKeyboardMarkup, Message)
from configs import *
# fro... | Gojo-Bots/file_sender | Powers/plugins/bot.py | bot.py | py | 19,595 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "pyrogram.enums.ChatType",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "pyrogram.types.Message",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "subprocess.check_output",
"line_number": 50,
"usage_type": "call"
},
{
"api_name":... |
16368469665 | from django.shortcuts import render
from .models import Image
# Create your views here.
def display_images(request):
photos = Image.photo_display
return render(request, 'all-photos/photo.html', { "photos": photos})
def search_results(request):
'''
search function to display search search_results
a... | josphat-mwangi/Django1 | photos/views.py | views.py | py | 1,236 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "models.Image.photo_display",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "models.Image",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "mod... |
40939139488 | from multiprocessing import cpu_count
from PyQt6.QtWidgets import QDialog, QMainWindow
from PyQt6.QtCore import Qt
from ...logika.wielowatkowosc.analizator_zdjec import AnalizatorZdjec
from ..designer.ustawienia_zasobow_designer import Ui_Dialog
class UstawieniaZasobow(QDialog):
'''Okno ustawień zużycia zasobów'... | MariuszAKS/Projekt_IO | gui/zawartosc/widgety/ustawienia_zasobow.py | ustawienia_zasobow.py | py | 1,231 | python | pl | code | 0 | github-code | 97 | [
{
"api_name": "PyQt6.QtWidgets.QDialog",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PyQt6.QtWidgets.QMainWindow",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "logika.wielowatkowosc.analizator_zdjec.AnalizatorZdjec",
"line_number": 12,
"usage_typ... |
24242637709 | """This module contains the classes for Gradescope assignments."""
from __future__ import annotations
import logging
import re
from dataclasses import dataclass
from pathlib import Path
from typing import Any, Dict, TypedDict
import requests
from bs4 import BeautifulSoup
from dataclasses_json import dataclass_json
fr... | FlickerSoul/gapper | src/gapper/connect/api/assignment.py | assignment.py | py | 7,775 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "typing.TypedDict",
"line_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.