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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11845591367 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os, json, subprocess
from tempfile import NamedTemporaryFile
cur_dir = os.path.dirname(os.path.abspath(__file__))
file_path = cur_dir + "/../eval_video.py"
def run_and_check_result(cmd):
cmd_result = subprocess.run(cmd, check=True, stdout=subprocess.PIPE, s... | OpenNetLab/Challenge-Environment | metrics/tests/test_eval_video.py | test_eval_video.py | py | 2,516 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_... |
13480667519 | import requests, os, json
from flask import Flask, render_template, redirect, url_for, request
from dotenv import load_dotenv
from anvil import Anvil, User
load_dotenv()
app = Flask(__name__)
anvil = Anvil()
user = anvil.load_user()
worlds = anvil.load_worlds(user)
anvil.current_world = worlds[0]
@app.route('/', met... | oaster2000/NPC-Writer | app.py | app.py | py | 898 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "anvil.Anvil",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "anvil.load_user",
"line_n... |
17915780851 | import smtplib
import re
import sys
import getpass
import random
import math
import time
import os
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.header import Header
import socket
socket.setdefaulttimeout(10)
"""
created by sayansree paria
verson<1.... | Sayansree/email_spammer | spammer1.0.py | spammer1.0.py | py | 3,987 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "socket.setdefaulttimeout",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpat... |
12608050279 | # Train model
import sys
import time
import numpy as np
import torch.optim as optim
import pickle
import os
import torch.utils.data
import model as m
import argparse
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--doc_len", type=int, default=300)
p... | jingsliu/NLP_HW | HW1/code/eval.py | eval.py | py | 2,761 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.optim.manual_seed",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "torch.optim",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "os.path.i... |
22291138485 | import re
import requests
from bs4 import BeautifulSoup
def scrape_page_title(soup):
""" Function to extract the title of an article from the scrapped code """
title = soup.find('h1', class_='content__headline').get_text()
title = re.sub('\n', '', title)
return title
def scrape_page_topic(soup):
... | mcmxlix/the_guardian_crawler | Crawler/scrape_infos.py | scrape_infos.py | py | 2,969 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "re.sub",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 32,
"usage_type":... |
5131582706 | from django.contrib.auth.models import AbstractUser
from django.db import models
class User(AbstractUser):
ADMIN = 'admin'
MODERATOR = 'moderator'
USER = 'user'
USER_ROLE_CHOICES = [
(ADMIN, 'admin'),
(MODERATOR, 'moderator'),
(USER, 'user'),
]
confirmation_code = mode... | Toksi86/yamdb_final | api_yamdb/users/models.py | models.py | py | 1,428 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.auth.models.AbstractUser",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.db.models",
"line_number": 15,
"usage_type": "name"
},
{
... |
20477618446 | from typing import List, Optional, Union
def _make_mrkdown_block(mrkdown: str):
"""
Wraps the mrkdown in a block kit block.
"""
return {
"type": "section",
"text": {
"type": "mrkdwn",
"text": mrkdown,
},
}
def _make_header_block(heading: str):
... | henryivesjones/slash-slack | slash_slack/blocks.py | blocks.py | py | 1,823 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "typing.Union",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_numb... |
28237496421 | #!/usr/bin/python
from copy import deepcopy
from fodft_tools import *
import argparse
import os
import sys, traceback
from ase import Atoms
spec_path = "/data/schober/code/fhiaims_develop/fhiaims_supporting_work/species_defaults/"
aims_params = {
"xc" : "blyp",
"spin" : "collinear",
... | schober-ch/fodft_tools | fodft.py | fodft.py | py | 6,769 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "os.path",
"lin... |
33280054752 | # %%
import numpy as np
import pandas as pd
import datetime as dt
#from cohorts_pipeline_woof_v4 import df_cleaning
#from cohorts_pipeline_woof_v4 import cohorts_pipeline
import mysql.connector
from mysql.connector import Error
# %%
#df_og = pd.read_csv('./Data/orders.csv', sep=';', decimal=',')
query_orders = 'SELECT ... | rahichan/angela_legacy | WOOOF/WOOOF_COHORTS_BUILDER.py | WOOOF_COHORTS_BUILDER.py | py | 3,732 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "mysql.connector.connector.connect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "mysql.connector",
"line_number": 15,
"usage_type": "name"
},
{
"... |
37975869389 | '''
Get completed data as Dataframe for charts
Calls to MongoDB for data
Test data is a separate module
'''
from datetime import datetime
session = {'defaults':{'trial':{"id":123, 'start_date':datetime.now().timestamp-(30*24*60*60)}}}
from test_data import get_test_data
from chart_frame import three_column_frame
test... | webbhm/MARSFarm-web_VX | gbet_charts/functions/hold/chart_data.py | chart_data.py | py | 1,935 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "test_data.get_test_data",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "chart_f... |
20420593181 | from confluent_kafka.admin import AdminClient, NewTopic
topic = 'Kafka_Image_Processing'
client_id = "admin_hagar"
conf = {'bootstrap.servers': "34.70.120.136:9094,35.202.98.23:9094,34.133.105.230:9094",
'client.id': client_id}
ac = AdminClient(conf)
res = ac.create_topics([NewTopic(topic, num_parti... | HagarIbrahiem/Kafka_ImgProcessing | admin.py | admin.py | py | 373 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "confluent_kafka.admin.AdminClient",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "confluent_kafka.admin.NewTopic",
"line_number": 10,
"usage_type": "call"
}
] |
7153685231 | # solarmap.py
import collections
import heapq
class SolarSystem:
"""
Solar system handler
"""
def __init__(self, key):
self.id = key
self.connected_to = {}
def add_neighbor(self, neighbor, weight):
self.connected_to[neighbor] = weight
def get_connections(self):
... | farshield/shortcircuit | src/shortcircuit/model/solarmap.py | solarmap.py | py | 8,726 | python | en | code | 56 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 109,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
"line_number": 187,
"usage_type": "call"
},
{
"api_name": "heapq.heappop",
"line_number": 190,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
... |
22759981162 | from fastapi import FastAPI
from fastapi.exceptions import RequestValidationError
from starlette.requests import Request
from starlette.responses import JSONResponse
from app import config as settings
from app.api.dependency import init_model
from app.api.v1.endpoint import router
from app.exceptions import APIExcepti... | SW13-Monstera/AI-server | app/main.py | main.py | py | 1,277 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "app.config.PROJECT_NAME",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "app.config",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "app.include_r... |
6767301700 | import json
from flask import Flask, request, Response
app = Flask(__name__)
required_fields = ['title', 'topics', 'ownerId', 'locationString']
tables = [
{
"tableId": 1,
"title": "TableC @ BostonHacks",
"topics": ["#masseffect", "#typescript", "#rickandmorty"],
"ownerId": 42,
... | shawnrc/hackascraps_bu17 | dummy_api.py | dummy_api.py | py | 1,198 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "flask.Response",
... |
30763371491 | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 28 13:39:19 2016
@author: Shahidur Rahman
"""
#import numpy as np;
#list declaration
#a_list = []
#b_list = []
#numpy array declaration
#left = np.array([])
#right = np.array([])
#convert the list to numpy array
#a = np.array(a_list)
#b = np.array(b... | skshahidur/nlp_paper_implementation | Word-Embedding/mwt.py | mwt.py | py | 2,843 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "mmh3.hash128",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "explorers.explore... |
2169470310 | import psycopg
from matplotlib import pyplot as plt
import numpy as np
import datetime
DB_NAME = "########"
DB_USER = "########"
DB_PASSWORD = "########"
conn = psycopg.connect(
dbname=DB_NAME,
user=DB_USER,
password=DB_PASSWORD)
def LoadQuery(fileName):
return open(f"tools/... | AS2/habrolink | tools/Analitics/test_register_karma_hist.py | test_register_karma_hist.py | py | 2,940 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "psycopg.connect",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "numpy.ar... |
42483897749 | import networkx as nx
def hierarchical_layout(G: nx.Graph) -> tuple:
"""Function to create dictionary with positions of nodes with hierarchical
arrangement.
Paramaters:
-----------
G: nx.Graph
NetworkX Graph object
Returns:
(int, int, dict)
Tuple with canvas size for the ... | diegopintossi/graph_network | custom_hierarchical_layout.py | custom_hierarchical_layout.py | py | 6,468 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "networkx.Graph",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "networkx.all_pairs_shortest_path_length",
"line_number": 20,
"usage_type": "call"
}
] |
21998646716 | from typing import List
from collections import defaultdict
class Solution:
def countPairs(self, deliciousness: List[int]) -> int:
maxsum = max(deliciousness) * 2
pairs = 0
dd = defaultdict(int)
for i in deliciousness:
s = 1
while s <= maxsum:
... | hangwudy/leetcode | 1700-1799/1711. 大餐计数.py | 1711. 大餐计数.py | py | 456 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 9,
"usage_type": "call"
}
] |
39672826344 | import protocol
import pytest
class TestBitstream:
@pytest.mark.parametrize(
"s,val",
[
("", []),
("1", [0x10000000]),
("01", [0x01000000]),
("0102", [0x01020000]),
("0102030405", [0x01020304, 0x05000000]),
],
)
def test_... | cmatsuoka/aoc | 2021 - submarine/16 - bitstream protocol/test_protocol.py | test_protocol.py | py | 1,376 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "protocol.Bitstream.from_string",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "protocol.Bitstream",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 7,
"usage_type": "call"
},
{
"api... |
2311755172 | import logging
import pathlib
import requests
import os
from pathlib import Path
from typing import Dict
from PIL.Image import Image
from result import Result, Ok, Err, Some
from definitions import EXT_API_SAVE_QUOTE_URL, EXT_API_OUTPUT_URL
from models import ImRequest
_logger = logging.getLogger(__name__)
class ... | lcapuano-app/quote-image-generator | src/imquote/qt_im_utils.py | qt_im_utils.py | py | 3,700 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "models.ImRequest.parser",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "models.ImReques... |
43972979596 | import argparse
import re
# CPT tools
from wp_tools import CPTLink
def parse_inputs(text,file,galaxy_mode=False):
"""
Parses the inputs of a text box and new line separated pacc file
"""
accs = []
if text:
if re.search(("__cn__"),str(text[0])):
acc = text[0]
spli... | TAMU-CPT/galaxy-tools | tools/wp_analysis/wp_data.py | wp_data.py | py | 3,447 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "re.search",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "argparse.FileType",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "argparse.FileType... |
20844744315 | import os
import random
from PIL import Image
from torch.utils.data import Dataset
from torchvision import transforms
class Images(Dataset):
def __init__(self, folder, size, is_training, downsample=False, preload=False):
"""
I assume that all images in the
folder have size at least `size`... | TropComplique/SRFeat-pytorch | input_pipeline.py | input_pipeline.py | py | 2,160 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "os.listdir",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "tor... |
31406415884 | '''
Emily Lee
SoftDev1 pd6
K#25 -- Getting More REST
2018-11-15
'''
import json
import urllib.request
from flask import Flask,render_template
app=Flask(__name__)
@app.route("/")
def Hello_world():
url_stub="http://www.asterank.com/api/skymorph/search?target="
target="J99TS7A"
req=urllib.request.url... | ecrystale/leeE | 25_rest/app.py | app.py | py | 628 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "urllib.request.request.urlopen",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name":... |
23308286546 | import stanza
from headline_retriever import load_articles, collect_articles, save_articles
from textblob import TextBlob
from datetime import date
NLP = stanza.Pipeline(lang='en', processors='tokenize,mwt,pos,lemma,ner')
END_DATE = date(2020, 3, 27) # the chosen last day to retrieve article headlines
# in place m... | NoahBlume/nlp_project | pre_processor.py | pre_processor.py | py | 2,997 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "stanza.Pipeline",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "textblob.TextBlob",
"line_number": 16,
"usage_type": "call"
}
] |
15826756401 | import pandas, main
from db import db
from config import Style
def add_item_to_list():
while True:
conn = db.create_connection()
cursor = conn.cursor()
main.speak("What is the name of the Item?")
ITEM = main.listen().capitalize()
main.speak("What is the category ... | PhantomCaboose/Python-Virtual_Assistant | features/shopping_list.py | shopping_list.py | py | 3,773 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "db.db.create_connection",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "db.db",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "main.speak",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "main.listen",
"line_number... |
73632775228 | # dependencies module
from crypt import methods
import inspect, ctypes, os, socket
from logging import shutdown
import cv2 as CV
from threading import Thread
from dotenv import load_dotenv
from flask import Flask, render_template, request, Response, make_response, jsonify
from random import randint as rand
from flask_s... | John11Dark/SecurityGuard | Assets/SVG/Smart_Car_Server/app.py | app.py | py | 27,452 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "Python.Motor.Motor",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "Python.servo.Servo",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "Python.ReadVoltages.Adc",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "Python.... |
26213405914 | from typing import Generator, Any
import numpy as np
import pandas as pd
from sklearn.model_selection import GroupKFold
from sklearn.preprocessing import LabelEncoder, OrdinalEncoder
from hw2.datasets.base import Dataset
class TrainDataset(Dataset):
def reduce_by_members(self, size: int, inplace: bool = False) ... | Sushentsev/recommendation-systems | hw2/datasets/train.py | train.py | py | 3,215 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "hw2.datasets.base.Dataset",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "sklearn.model_selection.GroupKFold",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "typing.Generator",
"line_number": 36,
"usage_type": "name"
},
{
"api... |
9803009738 | from __future__ import division
from pydub.utils import make_chunks
import re
import sys
from google.cloud import speech
import pyaudio
from six.moves import queue
from io import BytesIO
from pydub import AudioSegment
from multiprocessing import Process
# You can choose voices from https://cloud.google.com/text-to-spe... | EHowardHill/speak-easy | basic-runtime.py | basic-runtime.py | py | 7,631 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re.search",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "google.cloud.texttospeech.TextToSpeechClient",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "google.cloud.texttospeech",
"line_number": 28,
"usage_type": "name"
},
{
"... |
25945686355 | #!/usr/bin/env python
# coding=utf-8
# author = ruiruige
# email = whx20202@gmail.com
import web
from jx3wj.common.rest.rest_base import resources
from jx3wj.common.rest.dto.dto import deco_dump_to_str
from jx3wj.common.log import log as logging
from jx3wj.common.db.crud import select
from jx3wj.common.db.do.item imp... | ruiruige/myifttt | myifttt/mgmt/items/items.py | items.py | py | 1,893 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "jx3wj.common.log.log.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "jx3wj.common.log.log",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "web.application",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "j... |
41464656819 | #! python3
# -*- coding: utf-8 -*-
import datetime
start_bench_no_bench = datetime.datetime.now()
__version__ = "8.2.8-alpha"
import os
import sys
import copy
import platform
import pkgutil
FRACKING_INPUT_DEBUG = False
# todo version diff
# todo export script as json?
# todo compare jsons?
# tod... | egigoka/test | acl_edit/commands8.py | commands8.py | py | 50,047 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "date... |
34181662048 | import json
import time
from collections import defaultdict
current = 2370
maxGame = 2426
import datetime
import matplotlib.pyplot as plt
MERCY_ULT_TIME = 20
from pathlib import Path
ult_timers = {
'doomfist':4,
'genji':6,
'mccree': 6,
'pharah': 3,
'reaper': 3,
'soldier':6,
'mercy':6,
'... | Cheraws/AnalyzingOWL | stat_collector.py | stat_collector.py | py | 14,816 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.timedelta",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "co... |
19382433412 | """Support for Atome devices connected to a Linky Energy Meter."""
import asyncio
from .const import DATA_COORDINATOR, DOMAIN
PLATFORMS = ["sensor"]
DATA_LISTENER = "listener"
async def async_setup(hass, config):
"""Set up the KeyAtome component."""
# hass.data[DOMAIN] = {DATA_COORDINATOR: {}, DATA_LISTENE... | jugla/keyatome | custom_components/keyatome/__init__.py | __init__.py | py | 1,759 | python | en | code | 22 | github-code | 6 | [
{
"api_name": "const.DOMAIN",
"line_number": 19,
"usage_type": "argument"
},
{
"api_name": "const.DATA_COORDINATOR",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "const.DOMAIN",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "const.DOMAIN",
... |
24347880200 | import pytest
import zipfile
from io import BytesIO
from PIL import Image
from pathlib import Path
from zesje.raw_scans import create_copy, process_page
from zesje.scans import _process_scan, exam_metadata
from zesje.database import db, Exam, Student, Submission, Scan, Problem, ProblemWidget, ExamLayout, Copy, Page
... | zesje/zesje | tests/test_raw_scans.py | test_raw_scans.py | py | 3,269 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "zesje.database.Exam",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "zesje.database.ExamLayout.unstructured",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "zesje.database.ExamLayout",
"line_number": 15,
"usage_type": "name"
},
... |
24639710236 | import pandas as pd
from matplotlib import pyplot as plt
# plt.rcParams["figure.figsize"] = [12, 6]
plt.rcParams.update({'font.size': 11})
plt.rcParams["font.family"] = "Times New Roman"
############################ Model 1 ####################3
resnet50 = pd.read_csv(r'Dataset/resnet50.csv')
resnet50VAccu = resnet50... | Mehedi-Bin-Hafiz/Rotten-fruit-detection-by-deep-learning | Graph/lineGraph.py | lineGraph.py | py | 842 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.rcParams.update",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 4,
"usage_type": "name"
},
{
"... |
3231216071 | #
# License: See LICENSE.md file
# GitHub: https://github.com/Baekalfen/PyBoy
#
__pdoc__ = {
"GameWrapperPokemonGen1.cartridge_title": False,
"GameWrapperPokemonGen1.post_tick": False,
}
import logging
from pyboy.utils import WindowEvent
from .base_plugin import PyBoyGameWrapper
logger = logging.getLogger(_... | muddi900/PyBoy | pyboy/plugins/game_wrapper_pokemon_gen1.py | game_wrapper_pokemon_gen1.py | py | 2,149 | python | en | code | null | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cython.compiled",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "base_plugin.PyBoyGameWrapper",
"line_number": 25,
"usage_type": "name"
}
] |
25442839211 | from src.server.server import Server
import logging
logger = logging.getLogger('fmu_logger')
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s_%(name)s_%(levelname)s - %(message)s')
ch.setFormatter(formatter)
logger.addHandler(ch)
class W... | jwayneroth/mpd-touch | web/web.py | web.py | py | 607 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG... |
5086805014 | DOCUMENTATION = '''
---
module: cisco_asa_network_objectgroup
author: Patrick Ogenstad (@networklore)
version: 1.0
short_description: Creates deletes or edits network object-groups.
description:
- Configures network object-groups
requirements:
- rasa
options:
category:
description:
- Th... | networklore/ansible-cisco-asa | library/cisco_asa_network_objectgroup.py | cisco_asa_network_objectgroup.py | py | 10,509 | python | en | code | 30 | github-code | 6 | [
{
"api_name": "sys.exc_info",
"line_number": 127,
"usage_type": "call"
},
{
"api_name": "sys.exc_info",
"line_number": 140,
"usage_type": "call"
},
{
"api_name": "sys.exc_info",
"line_number": 154,
"usage_type": "call"
},
{
"api_name": "rasa.ASA",
"line_number... |
8708427284 | #/!/bin/python
import struct
import sys
import binascii
Signature = '\x89PNG\r\n\x1a\n'
#fichier_source, fichier_cible, fichier_dest, cle_chiffrement, algo = sys.argv[1:6]
fichier_source = 'date.txt'
fichier_cible = 'ressource.PNG'
fichier_dest = 'cyber.PNG'
cle_chiffrement = 'test12345'
algo = 'aes'
i... | buzagi/projet-pong | 1.py | 1.py | py | 1,547 | python | fr | code | 2 | github-code | 6 | [
{
"api_name": "Crypto.Cipher.DES3",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "Crypto.cipher.AES",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "struct.pack",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "struct.pack",
"l... |
89150854 | # --usage: print usage
def usage():
print('Usage: python3 marvin-data/marvin.py --building|--setup|--testing')
exit(1)
# --building: build the project
def building():
import json
import subprocess
with open('project-data/definition.json', 'r') as json_file:
with open('marvin-data/build_logs... | Lqvrent/SharedMarvin | Marvin/marvin.py | marvin.py | py | 5,567 | python | en | code | 16 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "subprocess.TimeoutExp... |
7055484203 | from time import sleep
from onvif import ONVIFCamera
exec(open("./fix_zeep.py").read())
class Camera(object):
def __init__(self, ip, login, password, port = 80):
# Подключение
self.mycam = ONVIFCamera(ip, port, login, password)
# Создание сервиса для управления движением
self.... | Maden23/CameraAudioKeyboard | ptzcamera.py | ptzcamera.py | py | 3,524 | python | ru | code | 1 | github-code | 6 | [
{
"api_name": "onvif.ONVIFCamera",
"line_number": 9,
"usage_type": "call"
}
] |
71226766908 | import unittest
from typing import Optional
from unittest import TestCase
from parameterized import parameterized
from robotlib.mathutils import Clipper, LinearExtrapolator
class TestClipper(TestCase):
@parameterized.expand([
# [min_value, max_value, x, expected_y]
[-5, 10, 0, 0],
[-5, 1... | austin-bowen/robotlib | test/python/robotlib_tests/test_mathutils.py | test_mathutils.py | py | 3,217 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "robotlib.mathutils.... |
20501710133 | from tensorflow.keras.preprocessing.image import img_to_array
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.callbacks import ModelCheckpoint, CSVLogger, TensorBoard, ReduceLROnPlateau
from tensorflow.keras import layers, models
fro... | aleksioprime/facerecognition | training_cnn.py | training_cnn.py | py | 8,710 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow.keras.models.Sequential",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.models",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "tensorflow.keras.layers.Conv2D",
"line_number": 23,
"usage_type": "call"
},
... |
1501952186 | from numpy import *
import matplotlib.pyplot as plt
import functions
data = loadtxt("kplr006603043-2011145075126_slc.tab")
data_new = []
for i in data:
if i[0] > 1691.5 and i[0] < 1693.1:
data_new.append(i)
data = array(data_new)
mag = data[:,3]
flux = 10**((mag-median(mag))/-2.5)
o = open("lc2.dat","w"... | chelseah/LCFIT | primitive_lcfit_scripts/data/formatlc.py | formatlc.py | py | 467 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "functions.write_table",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "mat... |
8397560124 | import copy
import numpy as np
from scipy.spatial.distance import cdist
class Server:
def __init__(self, parameters):
super().__init__()
self.k = parameters['kernel_size']
self.alpha = 1.0
self.d_out = parameters['d_out']
# centers, spreads, w and b can be broadcast to clie... | VeritasXu/FDD-EA | libs/Server.py | Server.py | py | 3,052 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "numpy.random.randn",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.randn",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.random"... |
36646568157 | """Evaluate explanation technique on the CLEVR XAI dataset.
This module computes the saliency maps for the relation network
and evaluates how well the explanation technique matches the
ground truth heatmaps.
"""
# from lrp_relations import enable_deterministic # noqa isort:skip
import dataclasses
import pickle
from... | berleon/A-Rigorous-Study-Of-The-Deep-Taylor-Decomposition | lrp_relations/gt_eval.py | gt_eval.py | py | 8,038 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "savethat.Args",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "dataclasse... |
3989607811 | from typing import Any, Dict, List, Self, Union
from attrs import define as _attrs_define
from attrs import field as _attrs_field
from ..constants.trading import (
ConditionalCloseOrderType,
OrderType,
SelfTradePreventionStrategy,
TimeInForce,
Trigger,
TypeOrder,
)
from ..security import get_n... | tlg7c5/kraken-connector | kraken_connector/schemas/add_standard_order_request_body.py | add_standard_order_request_body.py | py | 13,908 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "constants.trading.OrderType",
"line_number": 103,
"usage_type": "name"
},
{
"api_name": "constants.trading.TypeOrder",
"line_number": 104,
"usage_type": "name"
},
{
"api_name": "security.get_nonce",
"line_number": 107,
"usage_type": "call"
},
{
"api... |
21904300234 | import os
from pathlib import Path
import click
import numpy as np
import tensorflow as tf
from waymo_open_dataset.dataset_pb2 import Frame
from waymo_open_dataset.utils import frame_utils, transform_utils, range_image_utils
from waymo_open_dataset import dataset_pb2
from utils import save_frame, save_points
from vis... | friskit-china/waymo-open-dataset-visualizer | main.py | main.py | py | 11,384 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "tensorflow.convert_to_tensor",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "tensorflow.res... |
8167059453 | import sys
import os
import numpy as np
from numpy.linalg import svd
from numpy.linalg import eig
from skimage import io
from skimage import transform
face_folder = sys.argv[1]
if face_folder[len(face_folder)-1] != '/':
face_folder += "/"
target = sys.argv[2]
image_data = []
for file in os.listdir(face_folder):
... | muachilin/Machine-Learning | hw4/pca.py | pca.py | py | 1,052 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numbe... |
11783428086 |
# coding: utf-8
# In[1]:
#get_ipython().system(u'jupyter nbconvert --to script lstm_model.ipynb')
import os
import sys
import time
import pandas as pd
import datetime
#import pandas.io.data as web
from pandas_datareader import data
import matplotlib.pyplot as plt
from matplotlib import style
import glob
import numpy... | thongnbui/MIDS_capstone | code/lstm_model.py | lstm_model.py | py | 10,757 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.random.seed",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_... |
38199809243 | import sys
from PyQt5.QtWidgets import QMainWindow, QApplication, QDesktopWidget, QFileDialog
from PyQt5.QtGui import QPalette, QColor
import numpy as np
from typing import *
import json
import qtmodern.styles
import qtmodern.windows
from MyModules.MyWindow import Ui_MainWindow
from MyModules.Orbits import Satellite
... | Keith-Maxwell/OrbitViewer | OrbitViewer.py | OrbitViewer.py | py | 6,219 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "MyModules.MyWindow.Ui_MainWindow",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QDesktopWidget",
"line_number": 45,
"usage_type": "call"
}... |
19499771211 | # -*- coding: utf-8 -*-
from typing import List
import math
class Solution:
def nearestValidPoint(self, x: int, y: int, points: List[List[int]]) -> int:
smallest_distance = math.inf
index = -1
for ix, c in enumerate(points):
cx = c[0]
cy = c[1]
if x ... | michaeldye/mdye-python-samples | src/mdye_leetcode/solution_1779.py | solution_1779.py | py | 591 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "math.inf",
"line_number": 10,
"usage_type": "attribute"
}
] |
5995774734 | #!/usr/bin/python
from pylab import *
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from pyhdf.SD import SD,SDC
import healpy as hp
import os
def modisfile(month,day=None,year=2016,datadir="/home/kawahara/exomap/sot/data/aux/"):
import pandas as pd
if day is None:
dat=pd... | HajimeKawahara/sot | src/sot/dymap/analyzeMYD.py | analyzeMYD.py | py | 2,825 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line... |
42420664031 | import requests, json
url = 'https://sandbox.techops.engineering/Demand/v1/Surveys/BySurveyNumber/4592039'
params = ""
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}
response = requests.get(url, data=params, headers=headers)
print(response.content.decode()... | ajay-ar30/lucidcodesproject | week5/survey_get.py | survey_get.py | py | 398 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
}
] |
11983564091 | # -*- coding: utf-8 -*-
import sys
from ccm import *
from PyQt5.QtWidgets import QMainWindow, QApplication
class CCMWindow(QMainWindow):
def __init__(self):
super().__init__()
self.ui = Ui_CCMTask()
self.ui.setupUi(self)
self.ui.retranslateUi(self)
self.show()
if __name__... | yyFFans/DemoPractises | CCMtask/startui.py | startui.py | py | 581 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QApplication",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": ... |
29915222521 | # -*- coding: utf-8 -*-
"""User views."""
from flask import Blueprint, render_template, request, flash, redirect, url_for
from flask_login import login_required, current_user
from food_journal.user.models import User
from food_journal.user.forms import EditProfileForm
blueprint = Blueprint("user", __name__, url_prefi... | ariesunique/food-journal | food_journal/user/views.py | views.py | py | 2,403 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Blueprint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask_login.login_required",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "food_... |
27108312423 | import math
import plotly
import dash_bootstrap_components as dbc
from dash import html, dcc
import dash
from django_plotly_dash import DjangoDash
from geopy.geocoders import ArcGIS
import plotly.graph_objects as go
import plotly.express as px
import multiprocessing
import re
import pandas as pd
class Mapa:
def __... | victoralmeida428/master-edition | apps/geoloc/dash.py | dash.py | py | 2,470 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django_plotly_dash.DjangoDash",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "dash.html.Div",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "dash.html",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "dash.dcc.Graph"... |
26776110880 | """Exceptions interface.
Exceptions allow for ignoring detected issues. This is commonly done to suppress false
positives or to ignore issues that a group has no intention of addressing.
The two types of exceptions are a list of filenames or regular expressions. If using
filename matching for the exception it is requ... | sscpac/statick | statick_tool/exceptions.py | exceptions.py | py | 10,625 | python | en | code | 66 | github-code | 6 | [
{
"api_name": "typing.Optional",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "yaml.safe_load",
"line_num... |
20594488232 | import torch
import torch.nn as nn
def domain_loss(visual_domain_logits, textual_domain_logits):
criterion = nn.CrossEntropyLoss()
batch_size = visual_domain_logits.shape[0]
visual_domain_labels = torch.zeros(batch_size).long().cuda()
textual_domain_labels = torch.ones(batch_size).long().cuda()
lo... | CCNU-DigitalLibrary/CCNU-DigitalLibrary | MCM-HC/lib/models/losses/domain_loss.py | domain_loss.py | py | 467 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.CrossEntropyLoss",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.zeros",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.ones",
"line_nu... |
7177357229 | import json
import os
from eth_hash.auto import (
keccak,
)
from eth_utils import (
encode_hex,
)
from eth.tools.fixtures.fillers import (
fill_test,
)
from eth.tools.fixtures.fillers.formatters import (
filler_formatter,
)
from eth.tools.fixtures.helpers import (
get_test_name,
)
PARENT_DIR = os... | ethereum/py-evm | tests/fillers/build_json.py | build_json.py | py | 1,932 | python | en | code | 2,109 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
71184192189 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function, unicode_literals)
from multiprocessing import cpu_count
from eventlet import monkey_patch
from eventlet.greenpool import GreenPool
from contextlib import closing
monkey_patch()
import requests
try:
reques... | ddboline/programming_tests | python/stock_parser_greenpool.py | stock_parser_greenpool.py | py | 1,591 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "eventlet.monkey_patch",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests.packages.urllib3.disable_warnings",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.packages",
"line_number": 14,
"usage_type": "attribute"
},
... |
13842647368 | # only links are new should be crawled for additional links
# looks for all links that begin with /wiki/ (don't restrict to article links)
# collects the title, the 1st paragraph of content and the link to edit the page if available
from urllib.request import urlopen
from bs4 import BeautifulSoup
import re
pa... | ViolaZhou7/2016-09-python | crawlNewLinks.py | crawlNewLinks.py | py | 1,111 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 21,
"usage_type": "call"
}
] |
39607784723 | import os
import logging
from django.core.management.base import BaseCommand
from django.core.management.base import CommandError
from core import batch_loader
from core.management.commands import configure_logging
configure_logging('process_coordinates_logging.config',
'process_coordinates_%s.log'... | open-oni/open-oni | core/management/commands/process_coordinates.py | process_coordinates.py | py | 1,291 | python | en | code | 43 | github-code | 6 | [
{
"api_name": "core.management.commands.configure_logging",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.getpid",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name":... |
36294164710 | import argparse
import os
import torch
from net.models import LeNet
from net.quantization import apply_weight_sharing
import util
parser = argparse.ArgumentParser(description='This program quantizes weight by using weight sharing')
parser.add_argument('model', type=str, help='path to saved pruned model')
parser.add_... | mightydeveloper/Deep-Compression-PyTorch | weight_share.py | weight_share.py | py | 977 | python | en | code | 383 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "torch... |
10253684387 | from __future__ import division
import time
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
import cv2
from util import *
from darknet import Darknet
import pandas as pd
import colorsys
import random
import pickle as pkl
import argparse
def arg_parse():
"""
Parse argu... | pokotsun/pytorch-yolov3-scratch | detect_video.py | detect_video.py | py | 4,780 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "darkn... |
37016298011 | """ASE LAMMPS Calculator Library Version"""
from __future__ import print_function
import os
import ctypes
import operator
import sys
import numpy as np
from numpy.linalg import norm
from lammps import lammps
from ase.calculators.calculator import Calculator
from ase.data import atomic_masses
from ase.atoms import s... | libAtoms/pymatnest | lammpslib.py | lammpslib.py | py | 38,515 | python | en | code | 26 | github-code | 6 | [
{
"api_name": "numpy.matrix.transpose",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.matrix",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.nor... |
9152769558 | from django.urls import path
from . import views
urlpatterns = [
path('',views.Home.as_view(),name='Home'),
path(r'stock/<str:Name>',views.Show_Details.as_view()),
path('ajax/get-info',views.get_info),
path('ajax/get-nifty',views.get_nifty),
path('ajax/get-topstocks',views.get_topstocks),
path('... | Pggeeks/Live-StockScrenner-Django | stockapp/urls.py | urls.py | py | 379 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
33350944365 | #%%
import os
import gc
import sys
import pickle
from time import time
import datatable as dt
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import torch
import torch.nn as nn
from torch import optim
from sklearn.metrics import roc_auc_score
from sklearn.model_selection i... | scaomath/kaggle-riiid-test | sakt/debug_sakt_2.py | debug_sakt_2.py | py | 20,260 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "seaborn.set",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "seaborn.set_context",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_n... |
30201145239 | from uuid import uuid1
import click
from awsscripter.stack.helpers import catch_exceptions, confirmation
from awsscripter.stack.helpers import simplify_change_set_description
from awsscripter.stack.helpers import write, get_stack_or_env
from awsscripter.stack.stack_status import StackStatus, StackChangeSetStatus
@c... | xformation/awsscripter | awsscripter/cli/stack/update.py | update.py | py | 2,044 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "awsscripter.stack.helpers.get_stack_or_env",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "uuid.uuid1",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "awsscripter.stack.stack_status.StackChangeSetStatus.READY",
"line_number": 42,
"usa... |
17940251781 | from sklearn.linear_model import LogisticRegression
import numpy as np
def logistic(train_feature_dir, train_label_dir, test_feature_dir, test_label_dir):
train_feature = np.load(train_feature_dir)
train_label = np.load(train_label_dir)
test_feature = np.load(test_feature_dir)
test_label = np.load(te... | jingmouren/antifraud | antifraud/methods/LR.py | LR.py | py | 1,063 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 10,
... |
43242806041 | from preggy import expect
from tornado.testing import gen_test
from tests.base import TestCase
from thumbor.config import Config
from thumbor.context import Context
from thumbor.importer import Importer
class HealthcheckHandlerTestCase(TestCase):
@gen_test
async def test_can_get_healthcheck(self):
re... | thumbor/thumbor | tests/handlers/test_healthcheck.py | test_healthcheck.py | py | 1,446 | python | en | code | 9,707 | github-code | 6 | [
{
"api_name": "tests.base.TestCase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "preggy.expect",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "preggy.expect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "preggy.expect",
"... |
15892112680 | from argparse import ArgumentParser
import os
import logging
from sys import stdin, stdout
import yaml
import gc
import torch
from probing.inference import Inference
class NotAnExperimentDir(ValueError):
pass
def find_last_model(experiment_dir):
model_pre = os.path.join(experiment_dir, 'model')
if os.... | juditacs/probing | src/probing/batch_inference.py | batch_inference.py | py | 4,385 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
41465348149 | from commands import *
from pyfiglet import Figlet
from datetime import timedelta
fterm = f = Figlet(font="term", justify="center", width=Console.width())
# fonts = Str.nl(File.read("pyfiglet_fonts.txt").strip())
def now():
return Time.datetime()
ends = []
for arg in OS.args[1:]:
ends.append(arg)
if not ... | egigoka/test | time_until.py | time_until.py | py | 2,474 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "pyfiglet.Figlet",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pyfiglet.Figlet",
"line_number": 92,
"usage_type": "call"
}
] |
811951116 | # Top View of Binary Tree
# Given a pointer to the root of a binary tree, print the top view of the binary tree.
# The tree as seen from the top the nodes, is called the top view of the tree.
# For example :
# 1
# \
# 2
# \
# 5
# / \
# 3 6
# \
# 4
# Top View : 1 2... | Saima-Chaity/Leetcode | Tree/TopViewOfBinaryTree.py | TopViewOfBinaryTree.py | py | 882 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 23,
"usage_type": "call"
}
] |
71168709947 | import os
import subprocess
from django.conf import settings
from django.utils.dateparse import parse_date
from rest_framework import status
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framewor... | maxcrimea/ARSY | web/fileconverter/views.py | views.py | py | 3,589 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.generics.ListCreateAPIView",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "serializers.ConvertedModelSerializer",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "rest_framework.permissions.IsAuthenticated",
"line_number": 18... |
8400225965 | # Importamos tkinter
from tkinter import *
# Cargamos el modulo de Imagenes Pillow Python
from PIL import Image, ImageTk
# Creamos la ventana raiz
ventana = Tk()
ventana.title("Imagenes | Curso de master en Python")
ventana.geometry("700x500")
Label(ventana, text="Hola!!, Soy Lcdo. José Fernando Frugone Jaramillo").pa... | jfrugone1970/tkinter_python2020 | 21-tkinter/03-imagenes.py | 03-imagenes.py | py | 500 | python | es | code | 1 | github-code | 6 | [
{
"api_name": "PIL.Image.open",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "PIL.ImageTk.PhotoImage",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk",
"li... |
74221859388 | # Thanks to Ethan (@sherbondy) for the awesome idea of using CSG!
# Much slower than the other version, but it uses like 1/3 of the geometry
# Refactored version. slightly slower but more readable.
import bpy
import mathutils
bpy.ops.object.select_all(action='DESELECT')
pos = bpy.context.scene.cursor_location
bpy.o... | elfakyn/Blender-iterated-fractals | menger_csg2.py | menger_csg2.py | py | 1,646 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "bpy.ops.object.select_all",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bpy.ops",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "bpy.context",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "bpy.ops.mesh.pr... |
20445647795 | import os
import importlib.util
import time
print("Checking Dependencies")
if importlib.util.find_spec("tkinter") is None:
print("tkinter NOT INSTALLED,RUN pip install tkinter")
os.system("pause")
exit()
print("Dependencies OK")
time.sleep(5.5)
from os import path
from tkinter import filedial... | JohnavonVincentius/FileRename | filerename.py | filerename.py | py | 1,010 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "importlib.util.util.find_spec",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "importlib.util.util",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "importlib.util",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "os... |
18425266806 | # from flask import Flask
from flask import Flask, render_template, request, redirect, url_for, session
import pymysql.cursors
import json
import pickle
from flask import jsonify
import sklearn
from flask_sqlalchemy import model
# Loading in the training models that we will be using later
bike_model = pickle.load(open... | Winnie901/Software-Engineering-Project-Git5 | app.py | app.py | py | 5,366 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pickle.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pymysql.cursors.connect",
"li... |
41681774832 | import cv2
import numpy as np
import time
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif']=['SimHei']
plt.rcParams['axes.unicode_minus']=False
m=2
# 初始化隶属度矩阵U
def Initial_U(sample_num, cluster_n):
# sample_num为样本个数, cluster_n为分类数
U = np.random.rand(cluster_n,sample_num)
# 对 U 按列求和,然后取倒数
... | LAS1520/Image-Processing | final pj/codes/FCM.py | FCM.py | py | 2,715 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 6,
"usage_type": "attribute"
},
{
"ap... |
14524764116 | import random
from itertools import combinations
from ltga.Mutation import Mutation
class LTGA(object):
def buildTree(self, distance):
clusters = [(i,) for i in range(len(self.individuals[0].genes))]
subtrees = [(i,) for i in range(len(self.individuals[0].genes))]
random.shuffle(clusters)... | Duzhinsky/scheduling | ltga/LTGA.py | LTGA.py | py | 2,220 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "random.shuffle",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "random.choice",
... |
8954419715 | import requests,urllib
import os,sys,re,zipfile,shutil,io
from bs4 import BeautifulSoup
cwd = os.getcwd()
# taking the movie input
movie_name = [s for s in re.split("[^0-9a-zA-Z]",input("enter the movie name : \n"))]
movie_name = list(filter(lambda a: a != '', movie_name))
m1 = ' '.join(map(str,movie_name))
encod... | styx97/movie_subs | movie_subs.py | movie_subs.py | py | 1,880 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "os.getcwd",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 40,
... |
5104206621 | import os
import cv2
import numpy as np
import faceRecognition as fr
import HumanDetection as hd
import time
from playsound import playsound
#variabel status ruangan. 0 = empty, 1 = uknown, 2 = known
status = 0
#variabel timestamp
tsk = [0,0,0,False] #untuk durasi status known, mendeteksi ruang kosong (isempty)
tsu = ... | AfifHM/Smart-CCTV-Using-Face-and-Human-Detection | FullProgram/Source Code/forVideo.py | forVideo.py | py | 5,897 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "cv2.face.LBPHFaceRecognizer_create",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.face",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "HumanDetection.initiate",
"line_number": 26,
"usage_type": "call"
},
{
"api_name... |
71091610109 | root_path = '/mnt/d/KLTN/CNN-Based-Image-Inpainting/'
train_glob = root_path + 'dataset/places2/train/*/*/*.jpg'
test_glob = root_path + 'dataset/places2/test/*.jpg'
mask_glob = root_path + 'dataset/irregular_mask1/*.png' #2 for partialconv
log_dir = root_path + 'training_logs'
save_dir = root_path + 'models'
checkpoi... | realphamanhtuan/CNN-Based-Image-Inpainting | traingatedconv.py | traingatedconv.py | py | 1,142 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_nu... |
7874634889 | import numpy as np
import json
import os
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
class LatentConverter():
def __init__(self, places_path):
place_list = []
place2idx = {}
with open(places_path, encoding='utf-8') as f:
for p_idx, place in enumerate(json.load(f)):
place = tu... | e841018/DinnerSelector | preprocessing/LSI.py | LSI.py | py | 4,229 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.std",
"line_number": 36,
... |
19400757649 | import os
import sys
import unittest
import logging
from datetime import datetime
import json
from flask import Flask, request
from flask_restful import Resource
import settings as CONST
curpath = os.path.dirname(__file__)
sys.path.append(os.path.abspath(os.path.join (curpath, "../")))
from app_models import Custom... | bbcCorp/py_microservices | src/flask_api_customers/customers.py | customers.py | py | 5,316 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_num... |
23500788401 | from alipy.index import IndexCollection
from alipy.experiment import State
from alipy.data_manipulate import split
from sklearn.preprocessing import StandardScaler
def cancel_step(select_ind, lab, unlab):
lab = IndexCollection(lab)
unlab = IndexCollection(unlab)
unlab.update(select_ind)
lab.di... | weiweian1996/VERSION2.0 | GUI/Function/index_handle.py | index_handle.py | py | 1,941 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "alipy.index.IndexCollection",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "alipy.index.IndexCollection",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "alipy.index.IndexCollection",
"line_number": 20,
"usage_type": "call"
},
{
... |
25926762211 | from random import randint
import numpy
def fill_unassigned(row):
'''
>>> a = numpy.array([1, 0, 5, 5, 0, 2])
>>> fill_unassigned(a)
>>> a
array([1, 3, 5, 5, 4, 2])
'''
usednums, c = set(row), 1
for i, x in enumerate(row):
if x != 0:
continue
while c in used... | gitter-badger/tierbots | tierbots/worldgen/maze.py | maze.py | py | 3,577 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.where",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_num... |
30515350804 | import typing as _
from pathlib import Path
from jinja2 import Environment, FileSystemLoader
from pypugjs.ext.jinja import PyPugJSExtension
asset_folder = ''
def _get_asset(fname: str) -> Path:
return Path(asset_folder, fname)
def _data_with_namespace(data: 'Data', namespace: _.Dict) -> 'DataWithNS':
retur... | OnoArnaldo/py-report-generator | src/reportgen/utils/pug_to_xml.py | pug_to_xml.py | py | 3,635 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "typing.Dict",
"line_num... |
16151353249 | from tqdm import tqdm
import time
import argparse
N = int(1e9)
T = 1e-2
MAX_LEN = 100
def parse_args():
parser = argparse.ArgumentParser(description='i really wanna have a rest.')
parser.add_argument('-n', '--iters', type=int, default=N, help='rest iters.')
parser.add_argument('-f', '--frequency', type=... | I-Doctor/have-a-rest | have-a-rest.py | have-a-rest.py | py | 871 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 34,
"usage_type": "call"
}
] |
844258019 | # coding: utf-8
"""Train an ESN with a recursive least squares filter."""
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)
import logging
import hyperopt
import hyperopt.mongoexp
import numpy as np
from esn import RlsEsn
from esn.activation_functions import l... | 0x64746b/python-esn | examples/superposed_sinusoid/rls.py | rls.py | py | 3,499 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "hyperopt.hp.quniform",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "hyperopt.hp",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "hyperopt.hp.q... |
27593505084 | import logging
from logging.handlers import TimedRotatingFileHandler
import os
server_logger = logging.getLogger('server')
PATH = os.path.dirname(os.path.abspath(__file__))
PATH = os.path.join(PATH, 'server.log')
formatter = logging.Formatter(
'%(asctime)s %(levelname)-8s %(funcName)s %(message)s',
datefmt='%... | ide007/DB_and_PyQT | Lesson_1/logs/server_log_config.py | server_log_config.py | py | 902 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"li... |
31065262082 | from tensorflow.keras.backend import clear_session
from tensorflow.keras.models import load_model
from tensorflow.keras.callbacks import ModelCheckpoint, Callback as keras_callback
from tensorflow.keras.preprocessing.image import ImageDataGenerator
import numpy as np
from static.models.unet_model import unet
from scipy... | GoldbergLab/tongueSegmentationServer | NetworkTraining.py | NetworkTraining.py | py | 7,819 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "tensorflow.keras.backend.clear_session",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "scipy.io.loadmat",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.preprocessing.image.ImageDataGenerator",
"line_number": 87,
"usa... |
73919945469 | import unittest
from bs4 import BeautifulSoup
from src import get_html_script as ghs
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from models.models import JobDataModel
from models import domain_db_mappings as dbm
from models.databa... | ctiller15/Board-scrape-tool | tests/functional_tests.py | functional_tests.py | py | 5,831 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "src.get_html_script.scrape_site",
"line_number": 27,
"usage_type": "ca... |
75316088506 | import re
import wx
from wx import GridSizer
from wx.lib.agw.supertooltip import SuperToolTip
from boaui.units import area, charge, inertia, length, mass, pressure, volume, tnt, density, torque
from .label import SmartLabel
from . import LayoutDimensions, SmartToolTip
from ..units import KEY_IMPERIAL, KEY_METRIC
f... | JoenyBui/boa-gui | boaui/textbox/smart.py | smart.py | py | 36,235 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "wx.TextCtrl",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "wx.TextCtrl.__init__",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "wx.TextCtrl",
"line_number": 73,
"usage_type": "attribute"
},
{
"api_name": "wx.EVT_KEY_UP"... |
7918280184 | import os
import sys
import argparse
import netaddr
from netaddr import EUI
def _parse_args( args_str):
parser = argparse.ArgumentParser()
args, remaining_argv = parser.parse_known_args(args_str.split())
parser.add_argument(
"--username", nargs='?', default="admin",help="User name")
par... | sandip-d/scripts | vmi_scale.py | vmi_scale.py | py | 3,983 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 61,
"usage_type": "attribute"
},
{
"api_name": "os.system",
"line_number": 77,
"usage_type": "call"
}
] |
31267028151 | ## Archived on the 22/09/2021
## Original terrain.py lived at io_ogre/terrain.py
import bpy
def _get_proxy_decimate_mod( ob ):
proxy = None
for child in ob.children:
if child.subcollision and child.name.startswith('DECIMATED'):
for mod in child.modifiers:
if mod.type == 'DE... | OGRECave/blender2ogre | archived_code/terrain.py | terrain.py | py | 7,840 | python | en | code | 187 | github-code | 6 | [
{
"api_name": "bpy.context",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "bpy.types",
"line_number": 80,
"usage_type": "attribute"
},
{
"api_name": "bpy.context.scene.collection.objects.link",
"line_number": 104,
"usage_type": "call"
},
{
"api_na... |
26159783505 | # Bootstrap dropdown doesn't have select tag
# inspect the dropdown, find all the li under ui tag
# Loop through it and click the right li
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service
# Launch the browser
service_obj = Servic... | skk99/Selenium | day13/BootstrapDropdown.py | BootstrapDropdown.py | py | 915 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.chrome.service.Service",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 11,
"usage_type": "name"
},
{... |
71839381629 | # coding=utf-8
from __future__ import print_function
from ActionSpace import settings
from om.util import update_from_salt, syn_data_outside, fmt_salt_out, check_computer
from om.models import CallLog
from django.contrib.auth.models import User, AnonymousUser
from om.proxy import Salt
from channels.generic.websockets ... | cash2one/ActionSpace | om/worker.py | worker.py | py | 12,465 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "channels.generic.websockets.JsonWebsocketConsumer",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.models.User.objects.get_or_create",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects",... |
15147278540 | from django.urls import path
from . import views
app_name = 'cis'
urlpatterns = [
path('cis/<status>/', views.CIListView.as_view(), name='ci_list'),
path('ci/create/', views.CICreateView.as_view(), name='ci_create'),
path('ci/upload/', views.ci_upload, name='ci_upload'),
path('ci/<int:pk>', views.CIDe... | DiegoVilela/internalize | cis/urls.py | urls.py | py | 1,043 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
73652428349 | # 给你一个下标从 0 开始的整数数组 nums 。
# 现定义两个数字的 串联 是由这两个数值串联起来形成的新数字。
# 例如,15 和 49 的串联是 1549 。
# nums 的 串联值 最初等于 0 。执行下述操作直到 nums 变为空:
# 如果 nums 中存在不止一个数字,分别选中 nums 中的第一个元素和最后一个元素,将二者串联得到的值加到 nums 的 串联值 上,然后从 nums 中删除第一个和最后一个元素。
# 如果仅存在一个元素,则将该元素的值加到 nums 的串联值上,然后删除这个元素。
# 返回执行完所有操作后 nums 的串联值。
from typing import List
class... | xxxxlc/leetcode | competition/单周赛/332/findTheArrayConcVal.py | findTheArrayConcVal.py | py | 1,115 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 15,
"usage_type": "name"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.