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
18430213970
from utils import AttrDict from single_factor_test.config import parse_config from data_source import data_source from single_factor_test.factor_list import * from single_factor_test.selfDefinedFactors import * from utils.disk_persist_provider import DiskPersistProvider from datetime import datetime from utils.tool_fun...
wanhanwan/FactorLib
generate_stocks/templates.py
templates.py
py
5,276
python
en
code
6
github-code
7
[ { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 17, "usage_type": "call" }, { "api_name": "utils.disk_persist_provider.DiskP...
24558749657
from typing import Dict, List from langchain_community.agent_toolkits.base import BaseToolkit from langchain_community.tools import BaseTool from langchain_community.tools.clickup.prompt import ( CLICKUP_FOLDER_CREATE_PROMPT, CLICKUP_GET_ALL_TEAMS_PROMPT, CLICKUP_GET_FOLDERS_PROMPT, CLICKUP_GET_LIST_PR...
langchain-ai/langchain
libs/community/langchain_community/agent_toolkits/clickup/toolkit.py
toolkit.py
py
3,594
python
en
code
68,990
github-code
7
[ { "api_name": "langchain_community.agent_toolkits.base.BaseToolkit", "line_number": 22, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 32, "usage_type": "name" }, { "api_name": "langchain_community.tools.BaseTool", "line_number": 32, "usage_type": "na...
74259353184
from django.db import models # Create your models here. from django.utils import timezone # class Product(models.Model): # PRODUCT_ from django.utils import timezone class Product(models.Model): PRODUCTS_CHOICES = ( ('家用机器人', '家用机器人'), ('智能监控', '智能监控'), ('人脸识别解决方案', '人脸识别解决方案'), ...
HUANYUESS/MyHengDaProject
productsApp/models.py
models.py
py
2,137
python
zh
code
0
github-code
7
[ { "api_name": "django.db.models.Model", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 10, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 16, "usage_type": "call" }, { "api_name"...
72160717982
import asyncio from typing import Tuple, Any, List, Optional import aiohttp import pandas as pd import pytz from pandas import DataFrame, Timestamp from tqdm import tqdm from finclaw.data_store.schema import OHCL, STOCK_SYMBOL from finclaw.data_store.store import PriceStore from finclaw.vendor.fmp import fmp_client i...
Bobrinik/finclaw
finclaw/vendor/fmp/fmp.py
fmp.py
py
3,356
python
en
code
0
github-code
7
[ { "api_name": "aiohttp.ClientSession", "line_number": 16, "usage_type": "attribute" }, { "api_name": "finclaw.vendor.fmp.fmp_client.get_symbols", "line_number": 20, "usage_type": "call" }, { "api_name": "finclaw.vendor.fmp.fmp_client", "line_number": 20, "usage_type": "na...
72864488542
import torch.nn as nn import torch.nn.functional as F class Basic3DBlock(nn.Module): def __init__(self, in_planes, out_planes, kernel_size): super(Basic3DBlock, self).__init__() self.block = nn.Sequential( nn.Conv3d(in_planes, out_planes, kernel_size=kernel_size, stride=1, padding=((ke...
Ascend/ModelZoo-PyTorch
PyTorch/contrib/cv/pose_estimation/VoxelPose/lib/models/v2v_net.py
v2v_net.py
py
4,255
python
en
code
31
github-code
7
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
34026982065
import cv2 from mtcnn import MTCNN # load image img = cv2.imread("test.jpg") # initialize MTCNN detector detector = MTCNN() # detect faces using MTCNN results = detector.detect_faces(img) # iterate over each detected face for result in results: # extract bounding box coordinates x1, y1, width, height = resu...
Maddy-robos/faceDetect_Sample
another_main.py
another_main.py
py
824
python
en
code
0
github-code
7
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "mtcnn.MTCNN", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.rectangle", "line_number": 20, "usage_type": "call" }, { "api_name": "cv2.circle", "line_number": 28...
42431098748
bl_info = { "name": "come back cursor", "author": "1C0D", "version": (1, 1, 1), "blender": (2, 90, 0), "location": "Text Editor > only > Text editor", "description": "stay home cursor", "wiki_url": "", "category": "Text Editor", } """ Use shortcut shift+Right Mouse to toggle...
1C0D/come-back-cursor-Blender-addon
come_back_cursor.py
come_back_cursor.py
py
4,387
python
en
code
0
github-code
7
[ { "api_name": "bpy.types", "line_number": 19, "usage_type": "attribute" }, { "api_name": "bpy.context", "line_number": 26, "usage_type": "attribute" }, { "api_name": "bpy.context", "line_number": 61, "usage_type": "attribute" }, { "api_name": "bpy.context", "l...
71081867103
import wx import objdlg import servers import app import conjurerconfig as cfg class NOHTree(wx.TreeCtrl): """ This wxTreeCtrl derivative displays a tree view of nebula's namespace. Set 'passive' to True if you don't want this control to access its parent or do anything else than ...
xuebai5/TheZombieEngine
zombie/code/conjurer/conjurer/gui/nohtree.py
nohtree.py
py
11,788
python
en
code
3
github-code
7
[ { "api_name": "wx.TreeCtrl", "line_number": 10, "usage_type": "attribute" }, { "api_name": "wx.TR_DEFAULT_STYLE", "line_number": 22, "usage_type": "attribute" }, { "api_name": "wx.TreeCtrl.__init__", "line_number": 26, "usage_type": "call" }, { "api_name": "wx.Tre...
10336603840
import os import json import state import views state = state.State() APP_PATH = os.getcwd() state.app_path = APP_PATH USERS_JSON_PATH = os.path.join(APP_PATH, 'users.json') state.users_json_path = USERS_JSON_PATH USERS_DATA_PATH = os.path.join(APP_PATH, 'users') state.users_data_path = USERS_DATA_PATH if not os.p...
thalyssa/fanfiction-site
main.py
main.py
py
1,329
python
en
code
2
github-code
7
[ { "api_name": "state.State", "line_number": 6, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 8, "usage_type": "call" }, { "api_name": "state.app_path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_numbe...
27367402720
# 63. Unique Paths II # A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). # The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram below). # Now consider if some ob...
missingmeow/leetcode
63.UniquePathsII.py
63.UniquePathsII.py
py
1,479
python
en
code
0
github-code
7
[ { "api_name": "typing.List", "line_number": 10, "usage_type": "name" } ]
39824569501
from django.db import models from core.models import CartItem, Order class SubOrder(models.Model): class OrderStates(models.TextChoices): PENDING = "pending" PICKUP = "pickup" SCHEDULED = "scheduled" DELIVERED = "delivered" order = models.ForeignKey(Order, on_delete=models.CAS...
AliIbrahim996/KTH
core/models/SubOrder.py
SubOrder.py
py
711
python
en
code
0
github-code
7
[ { "api_name": "django.db.models.Model", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 5, "usage_type": "name" }, { "api_name": "django.db.models.TextChoices", "line_number": 6, "usage_type": "attribute" }, { "api_n...
27697051513
''' Created on April , 2021 @author: ''' ## Import libraries in python import argparse import time import json import logging import sys import os import math import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import random import importlib from scipy.stats import randint, exp...
mohyunho/TL_RUL
main.py
main.py
py
8,068
python
en
code
15
github-code
7
[ { "api_name": "pandas.options", "line_number": 36, "usage_type": "attribute" }, { "api_name": "tensorflow.compat.v1.logging.set_verbosity", "line_number": 37, "usage_type": "call" }, { "api_name": "tensorflow.compat", "line_number": 37, "usage_type": "attribute" }, { ...
21417927175
# create a s3 bucket import boto3 import logging from botocore.exceptions import ClientError s3 = boto3.resource('s3') # describe which resource you are trying to work this def create_bucket(bucket_name, region_name): try: if region_name == None: s3_client = boto3.client('s3') s3_c...
aerielellisk5/awsboto3_practice
s3/creates3.py
creates3.py
py
957
python
en
code
0
github-code
7
[ { "api_name": "boto3.resource", "line_number": 6, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 12, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 15, "usage_type": "call" }, { "api_name": "botocore.exceptions.ClientErr...
30780270335
'''quick version of block patch prediction, set batchsize = 128, seamlessly stitch image patches.''' import time import numpy as np from tqdm import tqdm import os import matplotlib.pyplot as plt from matplotlib import cm import torch import pandas as pd from PIL import Image import cv2 from torch.optim.lr_scheduler im...
RanrWang/SRSA-Net
quick-block-test.py
quick-block-test.py
py
6,280
python
en
code
1
github-code
7
[ { "api_name": "time.time", "line_number": 21, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 2...
7976101994
# -*- coding:utf-8 -*- """ __author__ = "zhangyu" """ import logging from thriftpy.protocol import TBinaryProtocol from thriftpy.thrift import TClient from thriftpy.transport import TSocket, TBufferedTransport from hbasepy.load import hbase_thrift from hbasepy.tables import Table logger = logging.getLogger(__name__...
0xqq/hbase-py
hbasepy/connection.py
connection.py
py
4,000
python
en
code
0
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "thriftpy.transport.TBufferedTransport", "line_number": 27, "usage_type": "name" }, { "api_name": "thriftpy.protocol.TBinaryProtocol", "line_number": 28, "usage_type": "name" }, ...
2768974793
from django.urls import path from .views import * urlpatterns = [ path('dashboard/', o_dashboard, name="o_dashboard"), path('register_pg_details/', o_register_pg_details, name="o_register_pg_details"), path('register_facilities/', o_register_facilities, name="o_register_facilities"), path('register_rul...
princedalsaniya/PGF-django
owner/urls.py
urls.py
py
1,067
python
en
code
0
github-code
7
[ { "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", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
22789407533
from django.test import SimpleTestCase from django.utils.translation import get_language_info from ads.forms import AdDetailEntryChoiceForm ############################################################################### # Unit tests # ========================================================== # Fields # ---------...
mikhkhann/sale-ads
src/sale_ads/apps/ads/tests/test_forms/test_ad_detail_entry_choice_form.py
test_ad_detail_entry_choice_form.py
py
851
python
en
code
0
github-code
7
[ { "api_name": "django.test.SimpleTestCase", "line_number": 18, "usage_type": "name" }, { "api_name": "ads.forms.AdDetailEntryChoiceForm", "line_number": 21, "usage_type": "call" }, { "api_name": "django.utils.translation.get_language_info", "line_number": 24, "usage_type"...
18132301849
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import json import uuid import pkgutil from flask import url_for, g, current_app as app def versioning(filename, appname=None, endpoint=None): return url_for('static', filename=filename) if not endpoint: endpoint = 'static' ...
qisanstudio/qstudio-core
src/studio/core/flask/helpers.py
helpers.py
py
2,424
python
en
code
0
github-code
7
[ { "api_name": "flask.url_for", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.g", "line_number": 17, "usage_type": "argument" }, { "api_name": "pkgutil.get_loader", "line_number": 24, "usage_type": "call" }, { "api_name": "flask.current_app.name",...
27016677833
import re import random import feedparser import logging import pdb import requests import urllib.request as urllib2 import ssl if hasattr(ssl, '_create_unverified_context'): ssl._create_default_https_context = ssl._create_unverified_context # logging.basicConfig(level=logging.DEBUG) # filename='example.log', logg...
trevorgrayson/humane-api
feeds/models.py
models.py
py
3,448
python
en
code
0
github-code
7
[ { "api_name": "ssl._create_default_https_context", "line_number": 10, "usage_type": "attribute" }, { "api_name": "ssl._create_unverified_context", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" ...
219766761
import torch import torchvision import numpy as np import random def extract_logits(out, task_ids, n_classes, device): """ Extract logits corresponding to task_ids from out. Args: out: Predictions task_ids: Task ids n_classes: Number of classes per task """ indices = ( ...
sanketvmehta/lifelong-learning-pretraining-and-sam
img_exps/vision_utils.py
vision_utils.py
py
2,562
python
en
code
11
github-code
7
[ { "api_name": "torch.arange", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.arange", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 43, "usage_type": "attribute" }, { "api_name": "torchvision.models.resnet18",...
36350356493
import os import pwd import grp # project from azure_li_services.logger import Logger from azure_li_services.runtime_config import RuntimeConfig from azure_li_services.defaults import Defaults from azure_li_services.users import Users from azure_li_services.status_report import StatusReport from azure_li_services.pat...
SUSE-Enceladus/azure-li-services
azure_li_services/units/user.py
user.py
py
5,824
python
en
code
7
github-code
7
[ { "api_name": "azure_li_services.logger.Logger.setup", "line_number": 28, "usage_type": "call" }, { "api_name": "azure_li_services.logger.Logger", "line_number": 28, "usage_type": "name" }, { "api_name": "azure_li_services.status_report.StatusReport", "line_number": 29, "...
7685867228
#!/usr/bin/env python3 import sys import numpy as np import matplotlib.pyplot as plt def loadplot(fnames, label_offset = 4, special = False, subset = False, logx = False): fig, ax = plt.subplots() for fname in fnames: multis = [] x = [] y = [] file = open(fna...
michalbali256/data-structures
splay/plot.py
plot.py
py
4,241
python
en
code
0
github-code
7
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "numpy.log2", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.mean", ...
7064339943
from helper import display_task_name, display_example """ Solution to Ellen's Alien Game exercise. https://exercism.org/tracks/python/exercises/ellens-alien-game """ class Alien: """Create an Alien object with location x_coordinate and y_coordinate. Attributes ---------- (class)total_aliens_created:...
vslayer34/Exercism-Python
14_Classes/01_Ellen's Alien Game.py
01_Ellen's Alien Game.py
py
2,845
python
en
code
0
github-code
7
[ { "api_name": "helper.display_task_name", "line_number": 63, "usage_type": "call" }, { "api_name": "helper.display_task_name", "line_number": 73, "usage_type": "call" }, { "api_name": "helper.display_task_name", "line_number": 81, "usage_type": "call" }, { "api_na...
8895143132
import random from django.http import HttpResponse from iscore_app.serializers import MatchesReaderSerializer from iscore_app.models import Matches, RankedPlayers, RankingListCategories, Ranking_Lists, TournamentCategories, Entries, Tournaments, Players, Score from rest_framework.decorators import api_view from rest_f...
lizagilman/iscore
iscore_app/draws.py
draws.py
py
9,345
python
en
code
0
github-code
7
[ { "api_name": "iscore_app.models.Matches.objects.filter", "line_number": 15, "usage_type": "call" }, { "api_name": "iscore_app.models.Matches.objects", "line_number": 15, "usage_type": "attribute" }, { "api_name": "iscore_app.models.Matches", "line_number": 15, "usage_typ...
17056057062
import sys sys.path.append("../Basic Functions") import numpy import matplotlib.pyplot from LoadData import LoadDataAndLabel # w = (X.T * X)^(-1) * (X.T * Y) def StandRegres(dataArray, labelList): dataMat = numpy.mat(dataArray) labelMat = numpy.mat(labelList) if numpy.linalg.det(dataMat.T * dataMat) == 0:...
VictorYXL/Machine_Learning
Regression/Regression.py
Regression.py
py
3,964
python
en
code
1
github-code
7
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "numpy.mat", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.mat", "line_number": 1...
30131030859
#!/usr/bin/env python # -*- coding: utf-8 -*- from PyQt5.QtWidgets import QTreeView, QStyledItemDelegate, QStyleOptionViewItem, QStyle from PyQt5.QtCore import Qt, QAbstractItemModel, QModelIndex, QRectF, QSize, QItemSelectionModel from PyQt5.QtGui import QTextDocument, QAbstractTextDocumentLayout # TODO (1) allow mo...
AminSdiri/german_active_vocab
german_active_vocab/EditDictModelView.py
EditDictModelView.py
py
13,800
python
en
code
0
github-code
7
[ { "api_name": "PyQt5.QtWidgets.QTreeView", "line_number": 10, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QTreeView.ExtendedSelection", "line_number": 17, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets.QTreeView", "line_number": 17, "usage_type": "...
43816814643
import pandas as pd from datetime import datetime, timedelta from confluent_kafka import avro from confluent_kafka.avro import AvroProducer def get_kafka_producer(): key_schema = avro.load("key_schema.avsc") value_schema = avro.load("value_schema.avsc") producer_config = { "bootstrap.servers":...
MohamedMandouh/nyc-pipeline
kafka/producer.py
producer.py
py
2,538
python
en
code
0
github-code
7
[ { "api_name": "confluent_kafka.avro.load", "line_number": 9, "usage_type": "call" }, { "api_name": "confluent_kafka.avro", "line_number": 9, "usage_type": "name" }, { "api_name": "confluent_kafka.avro.load", "line_number": 10, "usage_type": "call" }, { "api_name":...
16148800813
import os import sqlite3 from flask import Flask, request, session, g, redirect, url_for, abort, \ render_template, flash app = Flask(__name__) # create the application instance :) app.config.from_object(__name__) # load config from this file # Load default config and override config from an environment variable...
tolidano/cryptolio
cryptolio/cryptolio.py
cryptolio.py
py
1,382
python
en
code
2
github-code
7
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sqlite3.connect", "line_numb...
31588704105
#!/usr/bin/env python3 """ A sample pybowler pipeline that demonstrates replacement of x-unit style tests with pytest-style ones. Not particularly thorough. For simplicity, doesn't really handle boolean/None values well: assertEqual(a, None) --> a == None assertEqual(a, False) --> a == False ...
craigds/decrapify
pytestify.py
pytestify.py
py
16,467
python
en
code
11
github-code
7
[ { "api_name": "bowler.types.Leaf", "line_number": 79, "usage_type": "call" }, { "api_name": "bowler.TOKEN.EQEQUAL", "line_number": 79, "usage_type": "attribute" }, { "api_name": "bowler.TOKEN", "line_number": 79, "usage_type": "name" }, { "api_name": "bowler.types...
74755324704
import os import numpy as np import torch import torch.nn as nn from agent.agent import stochastic_action, wrap_action, dict2obs from agent.reinforce.network import Policy def get_action(policy: nn.Module, obs: np.ndarray): raw_action = stochastic_action(policy, obs) action = wrap_action(raw_action).tolist()...
MKLicht/flight_system
render_env/agent/reinforce/agent.py
agent.py
py
1,273
python
en
code
0
github-code
7
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_number": 10, "usage_type": "attribute" }, { "api_name": "agent.agent.stochast...
16809090845
from dotenv import load_dotenv import os def is_travis(): """ Detect if current environment is travis. Mainly used to disable underiable unit tests which cannot run on Travis (i.e. private database access) :return: """ is_travis_in_OS_env = "TRAVIS" in os.environ return is_travis_in_OS_env d...
dyt811/PythonUtils
env.py
env.py
py
1,802
python
en
code
0
github-code
7
[ { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 19, "usage_type": "call" }, { "api_name": "dotenv.load_dotenv", "line_number": 42, "usage_type": "call" }, { "api_name": "os.getenv", "line_nu...
72958800223
from flask import Flask, jsonify, render_template, request import requests import webbrowser import time app = Flask(__name__) def get_price(): url = "http://api.coincap.io/v2/assets?" response = requests.request("GET", url, headers={}, data = {}) if response.status_code == 200: data=response.json...
CreatorGhost/CryptoPriceUpdate
app.py
app.py
py
728
python
en
code
0
github-code
7
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "requests.request", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 23, "usage_type": "call" }, { "api_name": "flask.render_template", ...
2885368458
from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import os import efl parser = argparse.ArgumentParser(description="fl demo arguments") parser.add_argument('--data_dir', type=str, required=True) parser.add_argument('--data_dir_local', type=s...
alibaba/Elastic-Federated-Learning-Solution
efls-algo/utils/config.py
config.py
py
1,603
python
en
code
125
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "efl.MODE", "line_number": 30, "usage_type": "attribute" }, { "api_name": "efl.MODE", "line_number": 32, "usage_type": "attribute" }, { "api_name": "os.sep.join", ...
74264408542
import numpy as np from keras.datasets import mnist import random import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from sklearn import preprocessing import keras import tensorflow as tf from keras.datasets import mnist from keras.models import Sequential, Model from keras.layers import Dense, D...
tomzhao2016/graduation-project
reversed_mnist.py
reversed_mnist.py
py
26,059
python
en
code
0
github-code
7
[ { "api_name": "matplotlib.use", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 29, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 29, "usage_type": "name" }, { "api_name": "matpl...
26687161043
import numpy as np import torch import torch.functional as F def eval_metrics(output, target): output = (F.sigmoid(output) > 0.5).cpu().data.numpy() target = target.cpu().data.numpy() return np.linalg.norm(output - target) def corr_dist(est, gth, xyz0, xyz1, weight=None, max_dist=1): xyz0_est = xyz0 @ est[...
chrischoy/FCGF
lib/metrics.py
metrics.py
py
996
python
en
code
568
github-code
7
[ { "api_name": "torch.functional.sigmoid", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.functional", "line_number": 8, "usage_type": "name" }, { "api_name": "numpy.linalg.norm", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.linal...
24753209666
from collections import deque q = deque() command = input() while command != 'End': if command == 'Paid': [print(name) for name in q] q.clear() else: q.append(command) command = input() print(f'{len(q)} people remaining.')
kostakazakoff/SoftUni
Python Advanced/lists_as_stacks_and_queues/supermarket.py
supermarket.py
py
263
python
en
code
2
github-code
7
[ { "api_name": "collections.deque", "line_number": 3, "usage_type": "call" } ]
26227329757
import gym import numpy as np import cv2 #from skimage import transform from gym.spaces import Box class ResizeObservation(gym.ObservationWrapper): def __init__(self, env, shape): super().__init__(env) if isinstance(shape, int): self.shape = (shape, shape) else: sel...
392781/deepmow
deepmower/wrappers.py
wrappers.py
py
2,166
python
en
code
4
github-code
7
[ { "api_name": "gym.ObservationWrapper", "line_number": 7, "usage_type": "attribute" }, { "api_name": "gym.spaces.Box", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 16, "usage_type": "attribute" }, { "api_name": "cv2.resize...
9110859607
#!/usr/bin/env python
 # -*- coding: utf-8 -*-
 # Jimmy Lin import os import time import click from subprocess import Popen, PIPE, call interface_list = [] gl_IP = None com_ip_list1 = ["255.255.255.0", "192.168.101.1", "114.114.114.114 8.8.8.8", "buyabs.corp"] com_ip_list2 = ["255.255.255.0", "192.168.101.1", "192.16...
lindong629/SetIP_Mac
tools_change_ip.py
tools_change_ip.py
py
8,834
python
en
code
0
github-code
7
[ { "api_name": "subprocess.Popen", "line_number": 38, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 39, "usage_type": "name" }, { "api_name": "subprocess.Popen", "line_number": 59, "usage_type": "call" }, { "api_name": "subprocess.PIPE", ...
18343980698
# USING THIS # https://www.kaggle.com/mirlei/image-classification-of-dice-with-neural-network import random import os import pickle import numpy as np import matplotlib.pyplot as plt import cv2 from tensorflow.keras.preprocessing.image import ImageDataGenerator from tensorflow.keras.models import Sequential from ...
bklaing2/Dice-Recognizer
src/working-cnn.py
working-cnn.py
py
2,876
python
en
code
0
github-code
7
[ { "api_name": "tensorflow.keras.preprocessing.image.ImageDataGenerator", "line_number": 33, "usage_type": "call" }, { "api_name": "tensorflow.keras.preprocessing.image.ImageDataGenerator", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.ndarray", "line_number"...
27768748089
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import json import os from googlecloudsdk.calliope import cli_tree from googlecloudsdk.core import module_util from googlecloudsdk.core.util import files import six def _ParameterizePath(path): """Return...
twistedpair/google-cloud-sdk
google-cloud-sdk/lib/googlecloudsdk/command_lib/meta/list_cli_trees.py
list_cli_trees.py
py
3,239
python
en
code
55
github-code
7
[ { "api_name": "googlecloudsdk.core.util.files.GetHomeDir", "line_number": 16, "usage_type": "call" }, { "api_name": "googlecloudsdk.core.util.files", "line_number": 16, "usage_type": "name" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { ...
18683092860
from pygame.rect import * from Pkg.Denovo_Learning.Parameters import Parameters import pygame as pg class Target: def __init__(self): self.rect = Rect(Parameters.target_x, Parameters.target_y, Parameters.target_diameter, Parameters.target_diameter) def move(self): self.rect.move_ip(Parameter...
clmnlab/RL
DQN/Pkg/Denovo_Learning/Target.py
Target.py
py
1,151
python
en
code
0
github-code
7
[ { "api_name": "Pkg.Denovo_Learning.Parameters.Parameters.target_x", "line_number": 9, "usage_type": "attribute" }, { "api_name": "Pkg.Denovo_Learning.Parameters.Parameters", "line_number": 9, "usage_type": "name" }, { "api_name": "Pkg.Denovo_Learning.Parameters.Parameters.target_...
31075107783
# -*-coding:utf-8-*- from bs4 import BeautifulSoup import requests if __name__ == '__main__': target = 'http://www.xiaoshuotxt.org/mingzhu/18892/' req = requests.get(url=target) html = req.text bf = BeautifulSoup(html) texts = bf.find_all('div', class_='neir') print(texts)
guozhi666/python
pachong/baisi.py
baisi.py
py
300
python
en
code
0
github-code
7
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 9, "usage_type": "call" } ]
8512509520
import requests import bs4 import glob id = 25505347 while True: url = f"https://news.ycombinator.com/item?id={id}" print(url) resp = requests.get(url) open(f"data/stories/{id}", 'w').write(resp.text) id -= 1
mdamien/hn-network
download_stories.py
download_stories.py
py
230
python
en
code
0
github-code
7
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" } ]
2896628798
# TODO should check if the config file exists before trying to use it. import simplejson # import nose # removing as I don't think it's used. - GDB 18-11-05 import os from jsonschema import validate, ValidationError, Draft4Validator import argparse import configparser import logging # import glob import fnmatch from d...
vz-risk/veris
bin/checkValidity.py
checkValidity.py
py
31,385
python
en
code
538
github-code
7
[ { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 15, "usage_type": "call" }, { "api_name": "importlib.util.spec_fro...
14849385643
#!/usr/bin/env python from pyfirmata import Arduino, util from time import sleep import os port = '/dev/ttyUSB0' board = Arduino(port) sleep(2) it = util.Iterator(board) it.start() analog0 = board.get_pin('a:0:i') analog1 = board.get_pin('a:1:i') analog2 = board.get_pin('a:2:i') digital9 = board.get_pin('d:9:p') d...
tixsalvador/py
arduinopy/rgbled.py
rgbled.py
py
701
python
en
code
0
github-code
7
[ { "api_name": "pyfirmata.Arduino", "line_number": 8, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 9, "usage_type": "call" }, { "api_name": "pyfirmata.util.Iterator", "line_number": 11, "usage_type": "call" }, { "api_name": "pyfirmata.util", ...
30006763528
import numpy as np import casadi as ca # from five_link_model import Biped1 # from five_link_model import Biped2 from hopper_model import Hopper from terrain import Terrain # import helper_functions as hf ################################## #### Remove ddpos ############### ################################# class ...
IvLabs/biped_trajectory_optimization
hopper_path_generation/phase_based/trajopt_formulation.py
trajopt_formulation.py
py
10,795
python
en
code
75
github-code
7
[ { "api_name": "hopper_model.Hopper", "line_number": 24, "usage_type": "call" }, { "api_name": "terrain.Terrain", "line_number": 27, "usage_type": "call" }, { "api_name": "casadi.Opti", "line_number": 29, "usage_type": "call" }, { "api_name": "casadi.dot", "lin...
94684392
from context import functions from enum import Enum import unittest class TestHooks(unittest.TestCase): def tearDown(self) -> None: for event in functions.Event: functions.unset_handler(event) return super().tearDown() def test_functions_contains_handlers_dict_and_Event_enum(self)...
k98kurz/autodox
tests/test_hooks.py
test_hooks.py
py
5,673
python
en
code
2
github-code
7
[ { "api_name": "unittest.TestCase", "line_number": 6, "usage_type": "attribute" }, { "api_name": "context.functions.Event", "line_number": 8, "usage_type": "attribute" }, { "api_name": "context.functions", "line_number": 8, "usage_type": "name" }, { "api_name": "co...
38048539987
# This files contains your custom actions which can be used to run # custom Python code. # # See this guide on how to implement these action: # https://rasa.com/docs/rasa/custom-actions from typing import Any, Text, Dict, List from rasa_sdk import Action, Tracker from rasa_sdk.executor import CollectingDispatcher im...
gamestap99/nd_bot
actions/actions.py
actions.py
py
2,357
python
vi
code
0
github-code
7
[ { "api_name": "rasa_sdk.Action", "line_number": 35, "usage_type": "name" }, { "api_name": "typing.Text", "line_number": 37, "usage_type": "name" }, { "api_name": "rasa_sdk.executor.CollectingDispatcher", "line_number": 40, "usage_type": "name" }, { "api_name": "ra...
74658783903
# -*- coding: utf-8 -*- from __future__ import unicode_literals, division, print_function, absolute_import import re import logging import time import datetime import pydub # https://github.com/jiaaro/pydub from google.cloud import storage from google.cloud.exceptions import NotFound from google.cloud import speech fr...
Jaymon/transcribe
transcribe/speech.py
speech.py
py
6,326
python
en
code
32
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "path.Path", "line_number": 22, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 23, "usage_type": "call" }, { "api_name": "re.I", "line_number": 23, ...
71309565342
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
openstack/openstacksdk
openstack/tests/functional/network/v2/test_subnet_from_subnet_pool.py
test_subnet_from_subnet_pool.py
py
3,144
python
en
code
245
github-code
7
[ { "api_name": "openstack.tests.functional.base.BaseFunctionalTest", "line_number": 20, "usage_type": "attribute" }, { "api_name": "openstack.tests.functional.base", "line_number": 20, "usage_type": "name" }, { "api_name": "openstack.network.v2.subnet_pool.SubnetPool", "line_n...
22945712679
from django.http import HttpResponse, HttpResponseNotFound, HttpResponseRedirect from django.shortcuts import render from django.contrib.auth.decorators import login_required from justchat.models import Room, ChatHistory from django.contrib.auth import get_user_model from django.db.models import Q User = get_user_mode...
amitjamwal85/djangochannel
justchat/views.py
views.py
py
2,205
python
en
code
0
github-code
7
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 8, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 39, "usage_type": "call" }, { "api_name": "django.contrib.auth.decorators.login_required", "line_number": 33, "usage_type"...
71868986145
#!/usr/bin/env python3 import leveldb import msgpack import csv from util.misc import Benchmark, open_file REQUIRED_KEYS = {'title', 'paper_id', 'date'} if __name__ == "__main__": import argparse parser = argparse.ArgumentParser(description="Creates a LevelDB of TSV metadata in infile") parser.add_argumen...
jevinw/rec_utilities
babel_util/scripts/arxivmd_to_leveldb.py
arxivmd_to_leveldb.py
py
1,158
python
en
code
0
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "leveldb.LevelDB", "line_number": 18, "usage_type": "call" }, { "api_name": "util.misc.open_file", "line_number": 22, "usage_type": "call" }, { "api_name": "util.misc...
30663535099
from typing import List from collections import deque class Solution: def maxNumber(self, nums1: List[int], nums2: List[int], k: int) -> List[int]: def maxArray(nums, k): if k == len(nums): return nums arr = [] le = len(nums) for i, n in enum...
yutao-li/leetcode
321(1).py
321(1).py
py
990
python
en
code
0
github-code
7
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "collections.deque", "line_number": 20, "usage_type": "call" } ]
42090585243
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('flavourdb2', '0002_chef_chefbiofoodimage_comuna_menu_menuimage'), ] operations = [ migrations.RemoveField( model...
FlavourApp/Flavour
Flavour/flavourdb2/migrations/0003_auto_20140922_2318.py
0003_auto_20140922_2318.py
py
775
python
en
code
0
github-code
7
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.RemoveField", "line_number": 14, "usage_type": "call" }, ...
12048377266
import shutil import tempfile from http import HTTPStatus from django import forms from django.conf import settings from django.core.cache import cache from django.core.files.uploadedfile import SimpleUploadedFile from django.shortcuts import get_object_or_404 from django.test import Client, TestCase, override_setting...
Sovraska/hw04_tests
yatube/posts/tests/test_views.py
test_views.py
py
14,748
python
en
code
1
github-code
7
[ { "api_name": "tempfile.mkdtemp", "line_number": 15, "usage_type": "call" }, { "api_name": "django.conf.settings.BASE_DIR", "line_number": 15, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 15, "usage_type": "name" }, { "api_name...
23627998750
# from django.contrib.auth.models import User from django.db import models from rest_framework.serializers import ( HyperlinkedIdentityField, ModelSerializer, SerializerMethodField, ) from directories.models import PhoneNumber, Department, Faculty # from users.api.serializers import U...
lyoman/uzapp_backend
directories/api/serializers.py
serializers.py
py
2,404
python
en
code
0
github-code
7
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 18, "usage_type": "name" }, { "api_name": "django.db.models.ForeignKey", "line_number": 19, "usage_type": "call" }, { "api_name": "directories.models.Department", "line_number": 19, "usage_type": "...
22477881176
# Python script to convert between data formats. # It takes as input the json outputs of Alphapose and converts them to the appropriate dictionary form for # the SLT methods. This script assumes that AlphaPose extraction has already been performed. # Developed in the context of the aiD project import gzip import pickl...
konpanousis/aiD_Technologies
SignLanguageTranslation/convert_to_format.py
convert_to_format.py
py
1,468
python
en
code
0
github-code
7
[ { "api_name": "gzip.open", "line_number": 12, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 13, "usage_type": "call" }, { "api_name": "pickle.HIGHEST_PROTOCOL", "line_number": 13, "usage_type": "attribute" }, { "api_name": "json.load", "l...
12803223603
import json import pytest from src.main import app from fastapi.testclient import TestClient headers = {"Accept": "application/json"} client = TestClient(app, headers=headers) def test_get_echo_reply(): response = client.get('/') assert response.status_code == 200 assert response.json() == {"message":...
ForsakenWing/Mock-service
tests/unit_tests/test_units_main.py
test_units_main.py
py
1,415
python
en
code
0
github-code
7
[ { "api_name": "fastapi.testclient.TestClient", "line_number": 10, "usage_type": "call" }, { "api_name": "src.main.app", "line_number": 10, "usage_type": "argument" }, { "api_name": "json.loads", "line_number": 27, "usage_type": "call" }, { "api_name": "pytest.mark...
4043327466
from sklearn.metrics import accuracy_score, roc_auc_score, f1_score, precision_score, recall_score from common import utils import numpy as np from discrimination.discrimination_utils import load_data_demencia, results_to_csv, roc_auc_score_multiclass from discrimination.svm_utils import train_svm config = utils.load...
jvel07/wav2vec2_patho
demencia16k_selected225B.py
demencia16k_selected225B.py
py
1,524
python
en
code
5
github-code
7
[ { "api_name": "common.utils.load_config", "line_number": 8, "usage_type": "call" }, { "api_name": "common.utils", "line_number": 8, "usage_type": "name" }, { "api_name": "discrimination.discrimination_utils.load_data_demencia", "line_number": 9, "usage_type": "call" }, ...
71181280542
from django.shortcuts import render, redirect, get_object_or_404 from django.urls import reverse from notifications.models import Notification from blog.models import BlogDetailPage from visitor_record.utils import count_visits def my_notifications(request): obj = BlogDetailPage.objects.all()[0] data = count_v...
elfzweik/wangfamily
my_notifications/views.py
views.py
py
1,167
python
en
code
0
github-code
7
[ { "api_name": "blog.models.BlogDetailPage.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "blog.models.BlogDetailPage.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "blog.models.BlogDetailPage", "line_number": 8, "usage_type":...
5227995306
from model import GPTLanguageModel import wandb import time import json import torch mode = 'big' if mode == 'test': # TEST hparam config batch_size = 32 # how many independent sequences will we process in parallel? block_size = 8 # what is the maximum context length for predictions? max_iters = 5000 ...
yvokeller/frdm-gpt
src/train_model.py
train_model.py
py
4,682
python
en
code
1
github-code
7
[ { "api_name": "torch.backends.mps.is_available", "line_number": 34, "usage_type": "call" }, { "api_name": "torch.backends", "line_number": 34, "usage_type": "attribute" }, { "api_name": "torch.manual_seed", "line_number": 37, "usage_type": "call" }, { "api_name": ...
3603805590
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Thu Apr 20 12:06:22 2017 @author: Work """ import nltk from nltk.book import * from __future__ import print_function from __future__ import division def unusual_words(text): text_vocab = set(w.lower() for w in text if w.isalpha()) english_vocab = ...
jeffreyong/GA_files
nltk_tutorial2b.py
nltk_tutorial2b.py
py
3,086
python
en
code
0
github-code
7
[ { "api_name": "nltk.corpus.words.words", "line_number": 16, "usage_type": "call" }, { "api_name": "nltk.corpus", "line_number": 16, "usage_type": "attribute" }, { "api_name": "nltk.corpus.gutenberg.words", "line_number": 20, "usage_type": "call" }, { "api_name": "...
14367463930
import string from random import choice from typing import Optional, TYPE_CHECKING from quart import Blueprint, jsonify from litecord.auth import admin_check from ...errors import InternalServerError, NotFound from litecord.types import timestamp_ from litecord.schemas import validate from litecord.admin_schemas impo...
dolfies/patchcord
litecord/blueprints/admin_api/instance_invites.py
instance_invites.py
py
2,904
python
en
code
39
github-code
7
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 13, "usage_type": "name" }, { "api_name": "quart.Blueprint", "line_number": 18, "usage_type": "call" }, { "api_name": "string.ascii_lowercase", "line_number": 19, "usage_type": "attribute" }, { "api_name": "stri...
1826872291
import sys import speechbrain as sb from hyperpyyaml import load_hyperpyyaml from a3d import KWSBrain from a3d.dataset import prep_speechcommands from a3d.dataset import create_datasets_speechcommands def main(hparams, hparams_file, run_opts, overrides): # Create experiment directory sb.create_experiment_dire...
Hguimaraes/A3D
recipes/eval_robustness/eval_ks.py
eval_ks.py
py
1,585
python
en
code
0
github-code
7
[ { "api_name": "speechbrain.create_experiment_directory", "line_number": 11, "usage_type": "call" }, { "api_name": "speechbrain.utils.distributed.run_on_main", "line_number": 18, "usage_type": "call" }, { "api_name": "a3d.dataset.prep_speechcommands", "line_number": 19, "u...
37448395604
import pytest import abjad def test_LilyPondParser__spanners__HorizontalBracket_01(): maker = abjad.NoteMaker() target = abjad.Container(maker([0] * 4, [(1, 4)])) abjad.horizontal_bracket(target[:]) abjad.horizontal_bracket(target[:2]) abjad.horizontal_bracket(target[2:]) assert abjad.lilyp...
tastethewhip/abjad
tests/test_LilyPondParser__spanners__HorizontalBracket.py
test_LilyPondParser__spanners__HorizontalBracket.py
py
1,766
python
en
code
null
github-code
7
[ { "api_name": "abjad.NoteMaker", "line_number": 8, "usage_type": "call" }, { "api_name": "abjad.Container", "line_number": 9, "usage_type": "call" }, { "api_name": "abjad.horizontal_bracket", "line_number": 10, "usage_type": "call" }, { "api_name": "abjad.horizont...
40441913689
""" Really fast, no bugs! good work @ me idea was pretty simple, ie. reuse the current space what tripped me up was thinking about worst case runtime turns out still is O(n) """ from typing import List class Solution: def firstMissingPositive(self, nums: List[int]) -> int: for index in range(len(nums...
darren-huang/leetcode-grind
leetcode_top_hard_interview_questions/4-first_missing_positive_integer.py
4-first_missing_positive_integer.py
py
850
python
en
code
0
github-code
7
[ { "api_name": "typing.List", "line_number": 17, "usage_type": "name" } ]
85858499
import os import rnmd.extract_code import rnmd.compile_markdown default_compile_dir="/tmp/rnmd" os.makedirs(default_compile_dir, exist_ok=True) def run_markdown(source, args): temp_compile_path = os.path.join(default_compile_dir, os.path.basename(source)) rnmd.compile_markdown.compile_markdown(source, temp_...
markuspeitl/rnmd
rnmd/runtime.py
runtime.py
py
838
python
en
code
0
github-code
7
[ { "api_name": "os.makedirs", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.basename", "line_num...
3537741877
import datetime from individual import Individual from family import Family individuals = {} families = {} supported_tags: list = [ "INDI", "NAME", "SEX", "BIRT", "DEAT", "FAMC", "FAMS", "FAM", "MARR", "HUSB", "WIFE", "CHIL", "DIV", "DATE", "HEAD", "TRLR...
mghiremath/CS555-GEDCOM
team_03/src/gedFileParser.py
gedFileParser.py
py
6,427
python
en
code
0
github-code
7
[ { "api_name": "datetime.datetime", "line_number": 47, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 29, "usage_type": "attribute" }, { "api_name": "family.Family", "line_number": 57, "usage_type": "call" }, { "api_name": "family.identifier"...
4116530345
# key builder test from flexmock import flexmock from keyBuilder import buildKey from assertpy import assert_that def test_buildKey(): config = flexmock(keyName="test", keyPattern=".*", hasGroup=False, groupNum=None) assert_that(buildKey("alan", [config])).is_equal_to({"test":"alan"}) def test_buildKey_two_e...
cao5zy/code_transformer
tests/keyBuilder_test.py
keyBuilder_test.py
py
812
python
en
code
0
github-code
7
[ { "api_name": "flexmock.flexmock", "line_number": 7, "usage_type": "call" }, { "api_name": "assertpy.assert_that", "line_number": 12, "usage_type": "call" }, { "api_name": "keyBuilder.buildKey", "line_number": 12, "usage_type": "call" }, { "api_name": "flexmock.fl...
24507195808
from nptdms import TdmsFile import numpy as np import matplotlib import matplotlib.pyplot as plt input_file="M9_Default_200921-123303_Courants50Hz.tdms" with TdmsFile.open(input_file) as tdms_file: # Iterate over all items in the file properties and print them for name, value in tdms_file.properties.items(): ...
feelpp/book.hifimagnet
docs/docs/modules/appendix/attachments/nptdms-ex.py
nptdms-ex.py
py
2,113
python
en
code
2
github-code
7
[ { "api_name": "nptdms.TdmsFile.open", "line_number": 8, "usage_type": "call" }, { "api_name": "nptdms.TdmsFile", "line_number": 8, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 57, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.gca"...
16673574090
import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression data = pd.read_csv('Data.csv') x = data.iloc[:,[0]].values y = data.iloc[:,[1]].values x_t = np.transpose(x) first_inv = np.matmul(x_t, x) second = np.matmul(x_t, y) first = np.linalg.inv...
myaseen208/Winter2018-2019Stat-701MSCS
Assignment 2/slr.py
slr.py
py
550
python
en
code
0
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.transpose", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.matmul", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.matmul", "line_n...
5052319475
# **hdfs操作 import os from hdfs import client #**url:ip:端口 client = client.InsecureClient("http://yh001:50070", user="hadoop" ,root="/") def upload(remote_dir="/pings/wordcount/", local_dir="D:/data/1/"): """上传本地文件到hdfs""" client.delete(remote_dir, True) client.makedirs(remote_dir) for file in os.lis...
pingszi/PythonDemo
hadoop/myhdfs.py
myhdfs.py
py
486
python
en
code
1
github-code
7
[ { "api_name": "hdfs.client", "line_number": 6, "usage_type": "name" }, { "api_name": "hdfs.client.InsecureClient", "line_number": 6, "usage_type": "call" }, { "api_name": "hdfs.client.delete", "line_number": 11, "usage_type": "call" }, { "api_name": "hdfs.client",...
5808688297
from sklearn.preprocessing import StandardScaler from sklearn.cluster import KMeans import pandas as pd import matplotlib.pyplot as plt from sklearn.metrics import silhouette_score, davies_bouldin_score def clustering_k_means(df, columns_clustering, n_clusters=3, label_column_name='label', post...
paulaoak/hex_clustering_uk
src/clustering_k_means.py
clustering_k_means.py
py
5,586
python
en
code
0
github-code
7
[ { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 54, "usage_type": "call" }, { "api_name": "sklearn.cluster.KMeans", "line_number": 58, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 72, "usage_type": "call" }, {...
42747805895
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Nov 29 17:49:23 2018 @author: kzeman2 NitroShed Model """ from mesa import Agent, Model import random from mesa.time import RandomActivation from mesa.space import MultiGrid from schedule import model_schedule #import matplotlib.pyplot as plt #Agent...
kzeman2/PythonNitroShed
model.py
model.py
py
4,392
python
en
code
0
github-code
7
[ { "api_name": "mesa.Model", "line_number": 33, "usage_type": "name" }, { "api_name": "mesa.space.MultiGrid", "line_number": 105, "usage_type": "call" }, { "api_name": "schedule.model_schedule", "line_number": 106, "usage_type": "call" }, { "api_name": "random.rand...
74593511263
""" Module for processing aspect data """ from __future__ import division, absolute_import, print_function from sys import stdout from operator import attrgetter, itemgetter import warnings import inspect import numpy as np import matplotlib.pyplot as plt from matplotlib import animation import pandas as pd from scip...
GRIPS/gripspy
gripspy/science/aspect.py
aspect.py
py
13,445
python
en
code
1
github-code
7
[ { "api_name": "numpy.arange", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.meshgrid", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.cosh", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number"...
26389359129
#!/usr/bin/python import cv2 import sys import os if __name__ == "__main__" : imagename="contrast.jpg" img=cv2.imread(imagename) # if (img==None): # print("File not found") # Or not readable? # sys.exit() #create haar cascade classifi...
zhuyanlong/ComputerVision
facecrop.py
facecrop.py
py
1,091
python
en
code
0
github-code
7
[ { "api_name": "cv2.imread", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.imwrite", "line_number": 29, "usage_type": "call" } ]
7666254343
from front_end_gui_script import print_console_gui import os import calendar import pandas as pd from datetime import datetime from datetime import timedelta from dateutil import relativedelta import snscrape.modules.twitter as sntwitter tweet_path = 'tweets' def initiate_path(): if not os.path.exists(tweet_path)...
mustafaradheyyan/COVID-19_NLP
modules/tweet_scraper.py
tweet_scraper.py
py
4,242
python
en
code
0
github-code
7
[ { "api_name": "os.path.exists", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 14, "usage_type": "call" }, { "api_name": "calendar.monthrange", "line_...
15217259200
from pprint import pprint from time import sleep from selenium.webdriver.chrome.service import Service from selenium import webdriver from selenium.webdriver.common.by import By from bs4 import BeautifulSoup import requests class DataEntryJobAutomation(): def __init__(self) -> None: self.captura_completa ...
filipehlreis/100_days_of_code_python
day53/dataentryjobautomation.py
dataentryjobautomation.py
py
5,272
python
en
code
5
github-code
7
[ { "api_name": "requests.get", "line_number": 23, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 27, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number": 73, "usage_type": "call" }, { "api_name": "selenium.webdriver.chrom...
27763424579
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import enum from googlecloudsdk.api_lib.notebooks import util from googlecloudsdk.command_lib.util.apis import arg_utils from googlecloudsdk.core import log from googlecloudsdk.core import resources def Cre...
twistedpair/google-cloud-sdk
google-cloud-sdk/lib/googlecloudsdk/api_lib/notebooks/runtimes.py
runtimes.py
py
8,886
python
en
code
55
github-code
7
[ { "api_name": "googlecloudsdk.command_lib.util.apis.arg_utils.ChoiceEnumMapper", "line_number": 35, "usage_type": "call" }, { "api_name": "googlecloudsdk.command_lib.util.apis.arg_utils", "line_number": 35, "usage_type": "name" }, { "api_name": "googlecloudsdk.command_lib.util.ap...
37920326515
import os from celery import Celery from configs.default.cron import task_schedule # set the default Django settings module for the 'celery' program. os.environ.setdefault("DJANGO_SETTINGS_MODULE", "configs") app = Celery("sspanel") # Using a string here means the worker doesn't have to serialize # the configurati...
Ehco1996/django-sspanel
apps/celery.py
celery.py
py
726
python
en
code
3,002
github-code
7
[ { "api_name": "os.environ.setdefault", "line_number": 8, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "celery.Celery", "line_number": 10, "usage_type": "call" }, { "api_name": "configs.default.cro...
18047927366
import argparse parser = argparse.ArgumentParser(description='read in message') parser.add_argument('n', help='public key n', type=str) parser.add_argument('d', help='private key d', type=str) parser.add_argument('message', help='message', nargs=argparse.REMAINDER, default=[]) args = parser.parse_args() def decrypt(e...
jlherzberg/PyRSA
decrypt_message.py
decrypt_message.py
py
580
python
en
code
2
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 3, "usage_type": "call" }, { "api_name": "argparse.REMAINDER", "line_number": 6, "usage_type": "attribute" } ]
73683762782
from django.shortcuts import render from rest_framework import status from rest_framework.decorators import api_view from rest_framework.response import Response from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from .models import Branch_Office from .serializers import * @api_view(['GET']) def ...
MagFry/ProjectLanguage
branch_office/views.py
views.py
py
1,328
python
en
code
0
github-code
7
[ { "api_name": "models.Branch_Office.objects.all", "line_number": 18, "usage_type": "call" }, { "api_name": "models.Branch_Office.objects", "line_number": 18, "usage_type": "attribute" }, { "api_name": "models.Branch_Office", "line_number": 18, "usage_type": "name" }, ...
31529112624
import numpy as np import torch import torch.nn.functional as f class Conv: def __init__(self, c_in, c_out, kernel, stride=1, padding=0, dilation=1): self.kernel = kernel self.stride = stride self.padding = padding self.dilation = dilation self.c_in = c_in self.c_ou...
dakshitagrawal/ML_Interview_Algos
conv/conv.py
conv.py
py
2,240
python
en
code
2
github-code
7
[ { "api_name": "numpy.random.rand", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.random.rand", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.random", ...
14196059965
# from pudb import set_trace; set_trace() from typing import List from collections import Counter, deque import heapq class Solution1: def maxResult(self, nums: List[int], k: int) -> int: """LeetCode 1696 The DP idea is fairly straightforward. In fact it is exactly the same as the one we ...
FanchenBao/leetcode
2021_06_challenge/06_09_2021.py
06_09_2021.py
py
4,153
python
en
code
1
github-code
7
[ { "api_name": "typing.List", "line_number": 8, "usage_type": "name" }, { "api_name": "heapq.heappop", "line_number": 35, "usage_type": "call" }, { "api_name": "heapq.heappush", "line_number": 37, "usage_type": "call" }, { "api_name": "heapq.heappop", "line_num...
11820031300
import sys import os from PyQt5.QtWidgets import QMainWindow, QPushButton,\ QApplication, QInputDialog, QLineEdit, QLabel, \ QFileDialog, QComboBox, QAction, QMessageBox from PyQt5.QtCore import pyqtSlot, QByteArray, Qt from PyQt5.QtGui import QIcon, QPixmap, QColor import client from final import image_parser,...
EricaSkerrett/bme590final
gui.py
gui.py
py
18,935
python
en
code
0
github-code
7
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 25, "usage_type": "name" }, { "api_name": "PyQt5.QtGui.QColor", "line_number": 42, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 51, "usage_type": "call" }, { "api_name": ...
4169090204
from __future__ import print_function from keras.datasets import cifar10 from keras.preprocessing.image import ImageDataGenerator from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation, Flatten from keras.layers.convolutional import Convolution2D, MaxPooling2D from keras.opti...
chinnadhurai/machine_vision_course
hw1/q2.py
q2.py
py
3,969
python
en
code
0
github-code
7
[ { "api_name": "matplotlib.use", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.ogrid", "line_number": 39, "usage_type": "attribute" }, { "api_name": "numpy.exp", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.finfo", "line_num...
25131173590
# Kernel Support Vector Machine for Non-linearly Separable Data import numpy as np import pandas as pd import matplotlib.pyplot as plt df = pd.read_csv('Datasets/Social_Network_Ads.csv') X = df.iloc[:, 2:4].values y = df.iloc[:, 4].values # Split the Dataset into Train and Test Data from sklearn.model_selection impor...
vimalkkumar/MLinDepth
kernelSVM.py
kernelSVM.py
py
4,068
python
en
code
1
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 16, "usage_type": "call" ...
26427261313
from django import forms from .models import PostModel class PostForm(forms.ModelForm): class Meta: model = PostModel fields = ("post",) labels = { 'post': 'Напишите пост', } widgets = { 'post': forms.Textarea(attrs={'class': 'post-input'}) ...
Dapimex/Microblog
AnonMicroBlog/forms.py
forms.py
py
335
python
en
code
0
github-code
7
[ { "api_name": "django.forms.ModelForm", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 6, "usage_type": "name" }, { "api_name": "models.PostModel", "line_number": 9, "usage_type": "name" }, { "api_name": "django.forms.T...
2200381424
import requests from io import StringIO import pandas as pd import matplotlib.pyplot as plt url = "https://www.twse.com.tw/exchangeReport/STOCK_DAY?response=csv&date=20210301&stockNo=2330" resp = requests.get(url) raw_data = resp.text clean_data = raw_data.split('\r\n')[1:-6] clean_data[0] = '"date","deal_amount","dea...
wlsun-xiaole/python-lecture
sample_codes/02-Python基本語法II/範例/stock.py
stock.py
py
586
python
en
code
0
github-code
7
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "io.StringIO", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.show", ...
37224165423
import sqlite3 class DBHelper: def __init__(self, dbname="julio_bot.sqlite"): self.dbname = dbname self.conn = sqlite3.connect(dbname) def setup(self): tblstmt = "CREATE TABLE IF NOT EXISTS items (trigger, response text)" trig_idx = "CREATE INDEX IF NOT EXISTS triggerIndex ON...
Hernandope/basicChatBot
dbhelper.py
dbhelper.py
py
1,354
python
en
code
0
github-code
7
[ { "api_name": "sqlite3.connect", "line_number": 8, "usage_type": "call" } ]
23604727562
#!/usr/bin/env python import json from argparse import ArgumentParser from collections import defaultdict import pandas as pd parser = ArgumentParser() parser.add_argument("filepath", help="The full path to the Google Search JSON file") args = parser.parse_args() with open(args.filepath) as f: data = json.load(f...
AntoineAugusti/google-search-gdpr
main.py
main.py
py
1,267
python
en
code
7
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "json.load", "line_number": 13, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.DataF...
73422638943
#!/usr/bin/env python3 """ usage: gendummydata.py outputfilename.sql """ # # This script seeds the AUR database with dummy data for # use during development/testing. It uses random entries # from /usr/share/dict/words to create user accounts and # package names. It generates the SQL statements to # insert these users...
lfos/aurweb
schema/gendummydata.py
gendummydata.py
py
10,879
python
en
code
20
github-code
7
[ { "api_name": "logging.DEBUG", "line_number": 19, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 42, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 43, "usage_type": "call" }, { "api_name": "sys.argv", ...
35791925950
from copy import deepcopy from json import dumps, loads def handle_content(is_open, **_): return { 'add_as_content': True, 'open': not is_open, } def handle_delimiter(has_ending_quotes, has_starting_quotes, is_open, **_): if is_open: if not has_starting_quotes or has_ending_quote...
HPI-Information-Systems/ExtracTable
table-extraction/table_extractor/parser/parser.py
parser.py
py
8,075
python
en
code
2
github-code
7
[ { "api_name": "copy.deepcopy", "line_number": 178, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 194, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 206, "usage_type": "call" }, { "api_name": "json.loads", "line_n...
27254070480
#!/usr/bin/python #SBATCH --job-name="test_gemm" #SBATCH --time=0:20:00 #SBATCH --ntasks-per-node=1 #SBATCH --cpus-per-task=8 #SBATCH --account=csstaff #SBATCH --reservation=fallenotb import json import sys import os import copy import shutil import glob import subprocess import time import sqlite3 def main(): ...
toxa81/python-scripts
run_job_py34.py
run_job_py34.py
py
2,038
python
en
code
0
github-code
7
[ { "api_name": "sys.argv", "line_number": 20, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 22, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 24, "usage_type": "attribute" }, { "api_name": "copy.deepcopy", "line_numb...
8371717701
import subprocess import config as config import os os.chdir(config.BASE_DIR) for play in config.playlists: current_dir = os.getcwd() togo = os.path.join(current_dir, config.PLAYLIST_NAME, play.name) try: os.chdir(togo) except Exception as e: os.makedirs(togo, exist_ok=True) os.chd...
albertoZurini/youtube-dl-multiple-playlist-sync
sync_play.py
sync_play.py
py
935
python
en
code
0
github-code
7
[ { "api_name": "os.chdir", "line_number": 5, "usage_type": "call" }, { "api_name": "config.BASE_DIR", "line_number": 5, "usage_type": "attribute" }, { "api_name": "config.playlists", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.getcwd", "lin...
21099546758
import numpy as np import matplotlib.pyplot as plt # convolution of 2 arrays # w/o wrap arround , can add zeros to end of input # f, g not necessarily the same length # arbitrary gauss function def gauss(x,sigma): return 1/np.sqrt(2*np.pi*sigma**2)*np.exp(-0.5*x**2/sigma**2) def conv_safe(f,g): # make d...
michellehlam/phys512_hw
problem_sets/ps5/ps5_Problem4.py
ps5_Problem4.py
py
1,176
python
en
code
0
github-code
7
[ { "api_name": "numpy.sqrt", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.exp", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 2...
7516795348
import sys from parse import * import copy from enum import Enum #import gmpy2 #from gmpy2 import mpz import collections import functools import numpy as np import time class Node: def __init__(self, name, rate): self.name = name self.rate = rate self.tunnels = [] self.valve_on = False self.tot...
markmcb42/adventofcode
2022/day16.py
day16.py
py
1,843
python
en
code
0
github-code
7
[ { "api_name": "collections.deque", "line_number": 54, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 77, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 85, "usage_type": "call" }, { "api_name": "copy.deepcopy", "li...
74199548382
import sys import datetime assert sys.version_info >= (3, 5) # make sure we have Python 3.5+ from pyspark.sql import SparkSession, functions, types spark = SparkSession.builder.appName('tmax model tester').getOrCreate() assert spark.version >= '2.3' # make sure we have Spark 2.3+ spark.sparkContext.setLogLevel('WA...
jediXNavi/big_data
732/Assignments/weather_tomorrow.py
weather_tomorrow.py
py
1,440
python
en
code
0
github-code
7
[ { "api_name": "sys.version_info", "line_number": 4, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 8, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 8, "usage_type": "attribut...
15904742584
import requests import datetime from bs4 import BeautifulSoup as bs from pymongo import MongoClient link = "http://www.santostang.com/" headers = {"Host":"www.santostang.com", "User-Agent":"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:52.0) Gecko/20100101 Firefox/52.0" } re = requests.get(link ,headers = head...
yikuaiqian/python-practise
MongoDBceshi.py
MongoDBceshi.py
py
712
python
en
code
0
github-code
7
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 12, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime....
28541195037
from fastapi import FastAPI, Request import uvicorn from fastapi.responses import HTMLResponse from fastapi.staticfiles import StaticFiles from fastapi.templating import Jinja2Templates import os from image_random_selector import select_random_image from recognition_mask_predictor import mask_recognition app = FastAPI...
Julesba97/mask-recognition-tensorflow-fastapi
app/src/app.py
app.py
py
2,677
python
fr
code
0
github-code
7
[ { "api_name": "fastapi.FastAPI", "line_number": 10, "usage_type": "call" }, { "api_name": "fastapi.templating.Jinja2Templates", "line_number": 13, "usage_type": "call" }, { "api_name": "fastapi.staticfiles.StaticFiles", "line_number": 15, "usage_type": "call" }, { ...