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
45635636253
import sys import torch from puresound.nnet.skim import MemLSTM, SegLSTM from puresound.streaming.skim_inference import StreamingSkiM sys.path.insert(0, "./") def test_mem_lstm(): memlstm = MemLSTM(10, causal=True, dropout=0) memlstm.eval() h = torch.rand(1, 10, 1, 10).float().detach() c = torch.ran...
mcw519/PureSound
test/test_streaming.py
test_streaming.py
py
3,727
python
en
code
4
github-code
6
[ { "api_name": "sys.path.insert", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "puresound.nnet.skim.MemLSTM", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.rand", ...
39254369826
from rest_framework import serializers from proco.connection_statistics.models import ( CountryDailyStatus, CountryWeeklyStatus, SchoolDailyStatus, SchoolWeeklyStatus, ) class CountryWeeklyStatusSerializer(serializers.ModelSerializer): class Meta: model = CountryWeeklyStatus field...
unicef/Project-Connect-BE
proco/connection_statistics/serializers.py
serializers.py
py
2,912
python
en
code
2
github-code
6
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 11, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 11, "usage_type": "name" }, { "api_name": "proco.connection_statistics.models.CountryWeeklyStatus", "line_num...
37290352407
from datetime import datetime import smtplib from program import config import os def log_to_file(log: str): with open('logs.txt', 'a') as logs_file: logs_file.write(str(datetime.now()) + " | " + log + "\n") logs_file.close() def get_logs_from_file(): with open('logs.txt', 'r') as logs_file...
Poul3R/swiatksiazki_scraper
program/utils.py
utils.py
py
1,494
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "name" }, { "api_name": "os.environ", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.environ", ...
29009838459
#!/usr/bin/env python import pg8000 types = ('STK', 'CASH', 'CMDTY', 'FUT', 'OPT', 'IND', 'FOP', 'WAR', 'BOND', 'FUND') def main(): conn = pg8000.connect( host='127.0.0.1', database='opentrade', user='postgres', password='test') cursor = conn.cursor() exchanges = {} cursor....
treverson/opentrade-1
scripts/update_rate.py
update_rate.py
py
676
python
en
code
4
github-code
6
[ { "api_name": "pg8000.connect", "line_number": 10, "usage_type": "call" } ]
38634158163
from sqlite3 import Connection from flask import Flask from flask_blog import db class TestDB: def test_get_db(self, app: Flask) -> None: assert isinstance(db.get_db(), Connection) assert db.get_db() is db.get_db() def test_close_db(self, app: Flask) -> None: original_connection = d...
ftambara/flaskr
tests/test_db.py
test_db.py
py
707
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "name" }, { "api_name": "sqlite3.Connection", "line_number": 10, "usage_type": "argument" }, { "api_name": "flask_blog.db.get_db", "line_number": 10, "usage_type": "call" }, { "api_name": "flask_blog.db"...
72479830588
import os import dj_database_url from pathlib import Path BASE_DIR = Path(__file__).resolve().parent.parent IS_HEROKU = "DYNO" in os.environ # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key...
benedwards44/sfdatacompare
sfdatacompare/settings.py
settings.py
py
3,480
python
en
code
16
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 5, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 14, "usage_type": "call" }, { "api_name": "os.environ", "line_numb...
39920491954
import sys import click from js9 import j from zerorobot.cli import utils def print_task(task, tb=False): state = task.state print("{created} - {guid} - {action} - {state}".format( created=j.data.time.epoch2HRDateTime(task.created), guid=task.guid, action=task.action_name, st...
BolaNasr/0-robot
zerorobot/cli/task.py
task.py
py
2,837
python
en
code
0
github-code
6
[ { "api_name": "js9.j.data.time.epoch2HRDateTime", "line_number": 12, "usage_type": "call" }, { "api_name": "js9.j.data", "line_number": 12, "usage_type": "attribute" }, { "api_name": "js9.j", "line_number": 12, "usage_type": "name" }, { "api_name": "click.group", ...
6819439348
from ..models import BlogPost, HomePage from django import template from django.conf import settings from django.utils.text import slugify from django.template.defaultfilters import stringfilter from wagtail.wagtailcore.models import Page from wagtail.wagtailcore.templatetags.wagtailcore_tags import pageurl from wa...
kingsdigitallab/wagtailbase
templatetags/wagtailbase_tags.py
wagtailbase_tags.py
py
7,637
python
en
code
2
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "django.template.Library", "line_number": 19, "usage_type": "call" }, { "api_name": "django.template", "line_number": 19, "usage_type": "name" }, { "api_name": "django.conf...
19129110732
from flask import Flask, request,send_file, render_template, jsonify import pandas as pd import json as js from io import StringIO from werkzeug.utils import secure_filename import os import requests from flask_cors import CORS app = Flask(__name__) cors = CORS(app,resources={r'*':{'origins':'http://localhost:3000'}})...
rajatgedam/microservices-ml-project
flask-server/input.py
input.py
py
2,325
python
en
code
1
github-code
6
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number...
33017424665
"""Support for Dyson Pure Hot+Cool link fan.""" import logging from libpurecool.const import FocusMode, HeatMode, HeatState, HeatTarget from libpurecool.dyson_pure_hotcool_link import DysonPureHotCoolLink from libpurecool.dyson_pure_state import DysonPureHotCoolState from homeassistant.components.climate import Clima...
84KaliPleXon3/home-assistant-core
homeassistant/components/dyson/climate.py
climate.py
py
6,070
python
en
code
1
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "homeassistant.components.climate.const.FAN_FOCUS", "line_number": 26, "usage_type": "name" }, { "api_name": "homeassistant.components.climate.const.FAN_DIFFUSE", "line_number": 26, ...
42048343714
import errno import socket import threading import hashlib import base64 import logging from .DataFrameFormat import * from .ServerException import * class WebSocketServer: _SEC_KEY = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" _HANDKSHAKE_RESP = ( "HTTP/1.1 101 Switching Protocols\r\n" "Upgrade: ...
Kai-Bailey/WebSock
websock/WebSocketServer.py
WebSocketServer.py
py
14,648
python
en
code
21
github-code
6
[ { "api_name": "socket.socket", "line_number": 36, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 36, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 36, "usage_type": "attribute" }, { "api_name": "logging.bas...
34386201505
import pymysql import csv # 连接到MySQL数据库 conn = pymysql.connect( host='123.60.191.124', # MySQL服务器地址 user='root', # 用户名 password='Hzk2022@', # 密码 database='bridge' # 数据库名称 ) # 创建游标对象 cursor = conn.cursor() try: # 获取所有以"table"开头的表名 cursor.execute("SHOW TABLES LIKE 'table%'") tables = cu...
youkipepper/Py
bridge_data/download.py
download.py
py
926
python
en
code
0
github-code
6
[ { "api_name": "pymysql.connect", "line_number": 5, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 30, "usage_type": "call" } ]
11409257271
import os device_id = '0' os.environ["CUDA_VISIBLE_DEVICES"] = device_id from fastapi import FastAPI, Request import uvicorn, json, datetime import torch from loguru import logger logger.add('log/runtime_{time}.log') from deep_training.data_helper import ModelArguments, TrainingArguments, DataArguments from deep_tr...
kavin525zhang/AIGC
pretrained_model/ChatGLM/loan_collection/api_lora.py
api_lora.py
py
5,103
python
en
code
0
github-code
6
[ { "api_name": "os.environ", "line_number": 4, "usage_type": "attribute" }, { "api_name": "loguru.logger.add", "line_number": 11, "usage_type": "call" }, { "api_name": "loguru.logger", "line_number": 11, "usage_type": "name" }, { "api_name": "utils.prompter.Prompte...
35395903833
import sys from typing import Optional try: # pylint: disable=unused-import if sys.platform == 'win32': # pragma: no cover from .gss_win32 import GSSBase, GSSClient, GSSServer, GSSError else: from .gss_unix import GSSBase, GSSClient, GSSServer, GSSError gss_available = True except Im...
ronf/asyncssh
asyncssh/gss.py
gss.py
py
1,259
python
en
code
1,408
github-code
6
[ { "api_name": "sys.platform", "line_number": 8, "usage_type": "attribute" }, { "api_name": "typing.Optional", "line_number": 21, "usage_type": "name" } ]
74024066427
from flask import Flask, request,flash, redirect from flask import render_template from flask_sqlalchemy import SQLAlchemy from flask import url_for from werkzeug.utils import secure_filename,send_file,send_from_directory #""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" #"""""""""""""""""""""""""""...
Jean-joel/regression
app.py
app.py
py
7,248
python
en
code
0
github-code
6
[ { "api_name": "pickle.load", "line_number": 22, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "line_number": 3...
650413927
#! /usr/bin/python import os import sys import json import luigi import numpy as np import nifty.tools as nt import cluster_tools.utils.volume_utils as vu import cluster_tools.utils.function_utils as fu from cluster_tools.cluster_tasks import SlurmTask, LocalTask, LSFTask class BackgroundSizeFilterBase(luigi.Task)...
constantinpape/cluster_tools
cluster_tools/postprocess/background_size_filter.py
background_size_filter.py
py
6,129
python
en
code
32
github-code
6
[ { "api_name": "luigi.Task", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "luigi.Parameter", "l...
2533553742
""" Simple "Hello, world!" example that sends a `getNodeInfo` command to your friendly neighborhood node. """ from argparse import ArgumentParser from pprint import pprint from sys import argv from typing import Text from httpx.exceptions import NetworkError from iota import BadApiResponse, StrictIota, __version__ ...
iotaledger/iota.py
examples/hello_world.py
hello_world.py
py
1,239
python
en
code
344
github-code
6
[ { "api_name": "iota.StrictIota", "line_number": 17, "usage_type": "call" }, { "api_name": "httpx.exceptions.NetworkError", "line_number": 21, "usage_type": "name" }, { "api_name": "iota.BadApiResponse", "line_number": 26, "usage_type": "name" }, { "api_name": "ppr...
23641757895
import numpy as np import os import math import open3d as o3d def eulerAnglesToRotMatrixSelfRotate(theta) : R_x = np.array([[1, 0, 0 ], [0, math.cos(theta[0]), -math.sin(theta[0]) ], [0, math.sin(theta[0]), ma...
JC0103/FYP-Point_Cloud_Registration
Utility/Transformationin2Cam.py
Transformationin2Cam.py
py
6,481
python
en
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 10, "usage_type": "call" }, { "api_name": "math.cos", "line_number": 11, "usage_type": "call" }, { "api_name": "math.sin", "line_number": 11, "usage_type": "call" }, { "api_name": "math.sin", "line_number": 12, "...
7603547377
from criptografia import criptografar import PySimpleGUI as sg # Deve ter 16, 24 ou 32 bytes de comprimento class GeradorDeSenha: def __init__(self): sg.theme('reddit') interface = [ [sg.Text('Tipo de criptografia', auto_size_text=True), sg.Checkbox('AES-128', key='128', ...
GustavoAdM/CryptografiaPython
layout.py
layout.py
py
1,773
python
pt
code
0
github-code
6
[ { "api_name": "PySimpleGUI.theme", "line_number": 9, "usage_type": "call" }, { "api_name": "PySimpleGUI.Text", "line_number": 11, "usage_type": "call" }, { "api_name": "PySimpleGUI.Checkbox", "line_number": 12, "usage_type": "call" }, { "api_name": "PySimpleGUI.In...
2244771552
import getopt import os import sys from pathlib import Path import wx # -------------------项目撰写核心模块(库)---------------------------------------------------------------------------------- # Dauto平台组件模块 from dautolibrary.dautocomponents.parentframe import ParentFrame # -----------------------------------------------------...
guotaosun/waffirm
Dauto.pyw
Dauto.pyw
pyw
3,411
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line...
40667975592
from __future__ import division import argparse import logging import multiprocessing as mp import os import sys from distutils.util import strtobool import numpy as np from scipy.io import wavfile from scipy.signal import firwin from scipy.signal import lfilter from sprocket.speech.feature_extractor import Feature...
bigpon/QPNet
src/bin/noise_shaping.py
noise_shaping.py
py
6,659
python
en
code
13
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 22, "usage_type": "call" }, { "api_name": "distutils.util.strtobool", "line_number": 55, "usage_type": "name" }, { "api_name": "scipy.signal.firwin", "line_number": 74, "usage_type": "call" }, { "api_name": "...
20525895920
import numpy as np from math import * import matplotlib.pyplot as plt def func(x): return np.sin(x / 5) * np.exp(x / 10) + 5 * np.exp(-x / 2) def print_func(y): x = np.linspace(0,16,100) fig = plt.figure() y = y(x) y2 = func(x) plt.plot(x, y, 'r') plt.plot(x, y2, 'g') plt.show() k_array = np.array([[...
vovuas2003/NaumkinC01-119_2021_infa
NumPy/Number3.py
Number3.py
py
1,010
python
en
code
0
github-code
6
[ { "api_name": "numpy.sin", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_...
10322596686
import christmas_lights.events as lev import argparse import signal import sys import pygame import pandas as pd def signal_handler(signal, frame): colorWipe(strip, Color(0,0,0)) sys.exit(0) def opt_parse(): parser = argparse.ArgumentParser() parser.add_argument('-c', action='store_t...
mitchallain/christmas-lights
scripts/light_it_up_midi.py
light_it_up_midi.py
py
970
python
en
code
0
github-code
6
[ { "api_name": "sys.exit", "line_number": 12, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "signal.signal", "line_number": 19, "usage_type": "call" }, { "api_name": "signal.SIGINT", "l...
19646346507
import cv2 as cv import numpy as np import matplotlib.pyplot as plt img = cv.imread('Lab Image feature extraction/sign4.jpg') img = cv.resize(img,None,fx=0.3,fy=0.3) blurimage = cv.medianBlur(img, 5) HSV = cv.cvtColor(blurimage, cv.COLOR_BGR2HSV) lower_color = np.array([[20,100,100],[30,50,50]]) upper_color = n...
KanapongAiamtip/DIP
Lab Image feature extraction/lfe1.py
lfe1.py
py
766
python
en
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.medianBlur", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 1...
17509348708
# -*- coding: utf-8 -*- import scrapy import re class ImdbSpider(scrapy.Spider): name = 'imdb' allowed_domains = ['imdb.com'] def __init__(self, search = None, *args, **kwargs): self.start_urls = [search ] super().__init__(**kwargs) def parse(self, response): self...
Hallicopter/imdbscraper
imdb.py
imdb.py
py
2,003
python
en
code
2
github-code
6
[ { "api_name": "scrapy.Spider", "line_number": 5, "usage_type": "attribute" }, { "api_name": "re.findall", "line_number": 19, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 38, "usage_type": "call" }, { "api_name": "scrapy.Request", "line_nu...
13321416824
from airflow.models import Variable from airflow.hooks.postgres_hook import PostgresHook import requests def set_wistia_urls(ds, *args, **kwargs): if "client" not in kwargs or kwargs["client"] is None: raise Exception("You must configure a client for this operator") pg_connection = kwargs["client"] +...
CrossingsCommunityChurch/apollos-shovel
dags/misc/wista.py
wista.py
py
1,550
python
en
code
0
github-code
6
[ { "api_name": "airflow.hooks.postgres_hook.PostgresHook", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 26, "usage_type": "call" }, { "api_name": "airflow.models.Variable.get", "line_number": 27, "usage_type": "call" }, { ...
19064400048
from api.strings import id_key from .strings import * from api.ver1.offices.strings import office_key from api.ver1.parties.strings import party_key import datetime votes = [ { id_key: 1, createdOn_key: datetime.datetime.now().date().__str__(), createdBy_key: 2, office_ke...
pcf26536/politico-api
api/ver1/ballot/models.py
models.py
py
1,298
python
en
code
1
github-code
6
[ { "api_name": "api.strings.id_key", "line_number": 9, "usage_type": "name" }, { "api_name": "api.ver1.offices.strings.office_key", "line_number": 12, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 10, "usage_type": "call" }, { "api_n...
37056034694
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Random Effects SEM.""" import pandas as pd import numpy as np from .model_means import ModelMeans from .utils import chol_inv, chol_inv2, cov, calc_zkz, delete_mx from .univariate_blup import blup from scipy.linalg import solve_sylvester from collections import defaultd...
planplus/pysem
pysem/model_effects.py
model_effects.py
py
39,165
python
en
code
4
github-code
6
[ { "api_name": "model_means.ModelMeans", "line_number": 15, "usage_type": "name" }, { "api_name": "model_means.ModelMeans.matrices_names", "line_number": 23, "usage_type": "attribute" }, { "api_name": "model_means.ModelMeans", "line_number": 23, "usage_type": "name" }, ...
71256789948
from flask import Flask,send_file,request from elasticsearch import Elasticsearch import csv import time app = Flask(__name__) @app.route('/getCSV') def getCSVfile(): keyword = request.args.get('keyword') filename = createCSV(keyword) return send_file(filename, mimetype='text/csv', ...
bozzmob/twitter-stream-elasticsearch
downloadCSV.py
downloadCSV.py
py
1,247
python
en
code
4
github-code
6
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 9, "usage_type": "attribute" }, { "api_name": "flask.request...
7095382286
import torch from torch import nn import torch.nn.functional as F from layer_torch import RelationGatedConv import random from torch_geometric.nn.conv import MessagePassing, GCNConv, GATv2Conv class MyNet_Torch(torch.nn.Module): def __init__(self, kg1, kg2, sup_ent1, sup_ent2, triples, ent_num, rel_num, re...
laquabe/RGHN
code/model.py
model.py
py
13,879
python
en
code
0
github-code
6
[ { "api_name": "torch.nn", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn.Embedding", "line_number": 56, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 56, "usage_type": "name" }, { "api_name": "torch.nn.Embedding", "li...
4591075675
#coding=utf-8 from math import sqrt import matplotlib.pyplot as plt dataset = [[1.2, 1.1], [2.4, 3.5], [4.1, 3.2], [3.4, 2.8], [5, 5.4]] #样本数据 # 计算样本均值 def mean(values): return sum(values) / float(len(values)) # 计算 x 与 y 的协方差 def covariance(x, mean_x, mean_y): covar = 0.0 for i in range(len(x)): ...
Guozhanxin/machine-learning
01_simple_linear_regression/simple_linear_regression.py
simple_linear_regression.py
py
2,152
python
en
code
2
github-code
6
[ { "api_name": "math.sqrt", "line_number": 40, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.axis", "line_number": 52, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 52, "usage_type": "name" }, { "api_name": "matplotlib.pyplot....
40319311237
from socket import setdefaulttimeout import httpx from ansible.module_utils.basic import AnsibleModule from ansible_collections.ansibleguy.opnsense.plugins.module_utils.helper.api import \ check_host, ssl_verification, check_response, get_params_path, debug_api, \ check_or_load_credentials, api_pretty_except...
ansibleguy/collection_opnsense
plugins/module_utils/base/api.py
api.py
py
5,577
python
en
code
158
github-code
6
[ { "api_name": "httpx.ConnectTimeout", "line_number": 13, "usage_type": "attribute" }, { "api_name": "httpx.ConnectError", "line_number": 13, "usage_type": "attribute" }, { "api_name": "httpx.ReadTimeout", "line_number": 13, "usage_type": "attribute" }, { "api_name...
35151307517
import os from redis import StrictRedis redis_url = "redis://127.0.0.1" db = StrictRedis.from_url(redis_url, decode_responses=True) try: db.echo("ping") except: print("ERROR communicating with Redis database.") print("Start Redis instance first. Exiting.") exit(1) def main(filename): with open(fil...
1mbili/PAMiW
app/update_db.py
update_db.py
py
603
python
en
code
0
github-code
6
[ { "api_name": "redis.StrictRedis.from_url", "line_number": 4, "usage_type": "call" }, { "api_name": "redis.StrictRedis", "line_number": 4, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", ...
18081533163
# Spruce - a tool to help manage system software states. # Copyright (C) 2017 Matt North # This file is part of Spruce. # Spruce is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the...
Mattsky/spruce
spruce/urls.py
urls.py
py
1,516
python
en
code
0
github-code
6
[ { "api_name": "django.conf.urls.url", "line_number": 25, "usage_type": "call" }, { "api_name": "spruce.views.index", "line_number": 25, "usage_type": "attribute" }, { "api_name": "spruce.views", "line_number": 25, "usage_type": "name" }, { "api_name": "django.conf...
5722720970
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jun 7 21:42:42 2019 @author: siddharth """ import functools import vgg, datetime as dt import tensorflow as tf, numpy as np,os import transform_net from utils import get_img STYLE_LAYERS = ('relu1_1', 'relu2_1', 'relu3_1', 'relu4_1', 'relu5_1') CONTE...
slickFix/Video_style_transfer
optimize.py
optimize.py
py
8,276
python
en
code
0
github-code
6
[ { "api_name": "tensorflow.Graph", "line_number": 42, "usage_type": "call" }, { "api_name": "tensorflow.device", "line_number": 42, "usage_type": "call" }, { "api_name": "tensorflow.Session", "line_number": 42, "usage_type": "call" }, { "api_name": "tensorflow.plac...
24731119074
import board import os import sys import neopixel import time from datetime import datetime up_dir = os.path.dirname(os.path.abspath(__file__))+'/../../' sys.path.append(up_dir) from lcd import LCD as LCD from ubo_keypad import * # Might have to revisit this form of import from eeprom import * from print_label import p...
ubopod/ubo-hw-acceptance
tests/hw_acceptance/test_summarize.py
test_summarize.py
py
8,751
python
en
code
1
github-code
6
[ { "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", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path.append", "line...
69937111548
# Importamos librerías from pytesseract import pytesseract import cv2 # Función para digitalizar el texto (digital o manuscrito) de una imagen def digitalizeDigitalTextFromImage(img): # Establecemos el path a tesseract.exe path_to_tesseract = r'C:/Users/jesus/AppData/Local/Programs/Tesseract-OCR/tesseract.e...
jesussaro/TFA-Inteligencia-Artificial-JSC
DigitalizeDigitalText.py
DigitalizeDigitalText.py
py
1,143
python
es
code
0
github-code
6
[ { "api_name": "pytesseract.pytesseract.tesseract_cmd", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pytesseract.pytesseract", "line_number": 14, "usage_type": "name" }, { "api_name": "cv2.cvtColor", "line_number": 22, "usage_type": "call" }, { "a...
10230109175
from collections import defaultdict import numpy as np from evals.elsuite.bluff.bluff.cards import ( CARDS, PlayerCards, get_all_winning_hands, get_bluff_move, ) from evals.elsuite.bluff.bluff.game import Game class Player: def __init__(self, game: Game): self.game = game self.ga...
openai/evals
evals/elsuite/bluff/bluff/players.py
players.py
py
6,493
python
en
code
12,495
github-code
6
[ { "api_name": "evals.elsuite.bluff.bluff.game.Game", "line_number": 15, "usage_type": "name" }, { "api_name": "numpy.random.default_rng", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 18, "usage_type": "attribute" }, { "ap...
32645228197
"""Guide Squash 01 module""" from functools import partial from mgear.shifter.component import guide from mgear.core import transform, pyqt from mgear.vendor.Qt import QtWidgets, QtCore from maya.app.general.mayaMixin import MayaQWidgetDockableMixin from maya.app.general.mayaMixin import MayaQDockWidget from . impo...
mgear-dev/mgear4
release/scripts/mgear/shifter_classic_components/tangent_spline_01/guide.py
guide.py
py
7,915
python
en
code
209
github-code
6
[ { "api_name": "mgear.shifter.component.guide.ComponentGuide", "line_number": 29, "usage_type": "attribute" }, { "api_name": "mgear.shifter.component.guide", "line_number": 29, "usage_type": "name" }, { "api_name": "mgear.core.transform.getOffsetPosition", "line_number": 51, ...
42174639279
import datetime import logging from enum import Enum from typing import List, Tuple, Optional from sqlalchemy import and_, func, or_, String, cast, desc, distinct from sqlalchemy.orm import Session from src import config from src.accounts.models import Account, AccountUsedTraffic from src.accounts.schemas import ( ...
eloravpn/EloraVPNManager
src/accounts/service.py
service.py
py
8,804
python
en
code
15
github-code
6
[ { "api_name": "enum.Enum", "line_number": 22, "usage_type": "call" }, { "api_name": "src.accounts.models.Account.expired_at.asc", "line_number": 25, "usage_type": "call" }, { "api_name": "src.accounts.models.Account.expired_at", "line_number": 25, "usage_type": "attribute...
29328625022
import time import progressbar data = [] count = 0 bar = progressbar.ProgressBar(max_value=1000000) with open('reviews.txt', 'r') as f: for line in f: data.append(line) count += 1 bar.update(count) print('檔案讀取完了, 總共有', len(data), '筆資料') sum_len = 0 for d in data: sum_len += len(d) prin...
TheCodingTanya/reviews_read
read.py
read.py
py
1,699
python
en
code
0
github-code
6
[ { "api_name": "progressbar.ProgressBar", "line_number": 6, "usage_type": "call" }, { "api_name": "time.time", "line_number": 37, "usage_type": "call" }, { "api_name": "time.time", "line_number": 50, "usage_type": "call" } ]
74936094267
from django.conf.urls import url, include from rest_framework.routers import DefaultRouter from .api import (DataSourceViewSet, DatabaseViewSet, TagViewSet, PublicationViewSet, DataViewSet) router = DefaultRouter() router.register(r'datasources', DataSourceViewSet, base_name='api-datasources') router...
LACNIC/internal-stats-portal
core/urls.py
urls.py
py
679
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 6, "usage_type": "call" }, { "api_name": "api.DataSourceViewSet", "line_number": 7, "usage_type": "argument" }, { "api_name": "api.DatabaseViewSet", "line_number": 8, "usage_type": "argument" }, { ...
19184616148
import simplejson as json from datetime import datetime import re from functools import partial fix_mojibake_escapes = partial( re.compile(rb'\\u00([\da-f]{2})').sub, lambda m: bytes.fromhex(m.group(1).decode())) # with open(os.path.join(subdir, file), 'rb') as binary_data: # repaired = fix_mojibake_esc...
omertalib42/Instagram-Parser
new_custom_script.py
new_custom_script.py
py
1,070
python
en
code
1
github-code
6
[ { "api_name": "functools.partial", "line_number": 6, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 7, "usage_type": "call" }, { "api_name": "simplejson.loads", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime.utcfrom...
13376093817
''' This code produces the evolution of the epithelial tissue when using the best parameters (global and for the active pulses). On this file we define the numerical parameters of the simulation. Then, we import the experimental data. The program runs "classes_and_functions.py", which has all the definitions of classes...
FernandaPerezV/Annual-Killifish-Interface
MainFile.py
MainFile.py
py
6,051
python
en
code
0
github-code
6
[ { "api_name": "numpy.loadtxt", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 43, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_n...
14314545929
import streamlit as st import datetime import time import pandas as pd import snscrape.modules.twitter as sntwitter import pymongo import os.path # Streamlit Page Configuration. st.set_page_config(page_title="Twitter Scraping",page_icon=":tada",layout='wide') header = st.container() with header: st.t...
SrinivasanGajendran/Twitter-Scrapping-Using-Python-Pandas-MongoDB-Streamlit.
Twitter_Scrapping.py
Twitter_Scrapping.py
py
5,326
python
en
code
1
github-code
6
[ { "api_name": "streamlit.set_page_config", "line_number": 11, "usage_type": "call" }, { "api_name": "streamlit.container", "line_number": 12, "usage_type": "call" }, { "api_name": "streamlit.title", "line_number": 14, "usage_type": "call" }, { "api_name": "streaml...
34600688655
import numpy as np import matplotlib.pyplot as plt import sklearn import sklearn.datasets import sklearn.linear_model from snn_utils import plot_decision_boundary, load_planar_dataset, sigmoid np.random.seed(1) def layer_sizes(X, Y): """ :param X : X - array of shape (input size, number of examples) ...
anantsrivastava30/deeplearning
shallow_nn.py
shallow_nn.py
py
7,323
python
en
code
2
github-code
6
[ { "api_name": "numpy.random.seed", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.random.seed", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.random", ...
70300237628
from Flask import Flask, jsonify, redirect, render_template import pymongo import scrape_mars client = pymongo.MongoClient('mongodb://localhost:27017/') app = Flask(__name__) db = client.mars_data_DB mars_data = db.mars_data = mars_data['news_data']['paragraph_text_1'] @app.route("/") def render_index()...
Bryano841/Web-Scraping
app.py
app.py
py
2,417
python
en
code
0
github-code
6
[ { "api_name": "pymongo.MongoClient", "line_number": 5, "usage_type": "call" }, { "api_name": "Flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "Flask.render_template", "line_number": 49, "usage_type": "call" }, { "api_name": "scrape_mars.scrap...
24117984691
import torch from pytorch_transformers import BertTokenizer, BertModel, BertForMaskedLM # Load pre-trained model tokenizer (vocabulary) tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') # Tokenize input text = "[CLS] Who was Steve Jobs ? [SEP] Steve Jobs was a code master [SEP]" tokenized_text = tokenize...
sachinumrao/pytorch_tutorials
masked_language_model.py
masked_language_model.py
py
1,835
python
en
code
0
github-code
6
[ { "api_name": "pytorch_transformers.BertTokenizer.from_pretrained", "line_number": 5, "usage_type": "call" }, { "api_name": "pytorch_transformers.BertTokenizer", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.tensor", "line_number": 29, "usage_type": "call...
32074264986
import cv2 import pyzed.sl as sl import numpy as np import os import math import time import sys from Zed import zedmain from adafruit_servokit import ServoKit from command_or_passthrough import SBUSmain from Navigates import Navigate from PyLidar import LidarMain from multiprocessing import Process, Pipe, Queue debu...
sophierahn/Star-Wars-Training-Droid
Main.py
Main.py
py
9,232
python
en
code
0
github-code
6
[ { "api_name": "adafruit_servokit.ServoKit", "line_number": 20, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 45, "usage_type": "call" }, { "api_name": "Navigates.Navigate", "line_number": 65, "usage_type": "call" }, { "api_name": "multiprocess...
19078323486
import numpy as np import os, sys import random import json import time class Problem: def __init__(self, input): self.input = input self.numTasks = len(input) self.test_iter = 3 # 變數 self.mating_rate = 1.0 self.num_parents_mating = int(len(self.input) * self.matin...
kliuhalo/AI_HW2_Genetic_algo
GA.py
GA.py
py
12,050
python
en
code
0
github-code
6
[ { "api_name": "sys.maxsize", "line_number": 35, "usage_type": "attribute" }, { "api_name": "numpy.arange", "line_number": 53, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 54, "usage_type": "call" }, { "api_name": "numpy.random.choice", "li...
17228555797
#!/usr/bin/env python3 from io import StringIO import pandas as pd import os def read_dat(exe, *filenames, **kwargs): """templogger用datファイルの読み込み JSON中間ファイルを生成せずに DATファイルから直接pandasオブジェクトを返します """ files = ' '.join(filenames) jsonbin = get_ipython().getoutput( f'{exe} --format json {files}...
u1and0/templogger
read_dat.py
read_dat.py
py
604
python
ja
code
0
github-code
6
[ { "api_name": "io.StringIO", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.read_json", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 17, "usage_type": "call" } ]
34264955208
from scipy.special import spherical_jn as jn #Сферическая функция Бесселя первого порядка from scipy.special import spherical_yn as yn #Сферическая функция Бесселя второго порядка import matplotlib.pyplot as plt import urllib.request as url # открытие url from numpy import pi #упрощение записи pi from re import sp...
AlexPogudin/wor2
Pogudin_16_2.py
Pogudin_16_2.py
py
2,409
python
ru
code
0
github-code
6
[ { "api_name": "scipy.special.spherical_jn", "line_number": 11, "usage_type": "call" }, { "api_name": "scipy.special.spherical_yn", "line_number": 11, "usage_type": "call" }, { "api_name": "scipy.special.spherical_jn", "line_number": 13, "usage_type": "call" }, { "...
6748703107
import sys import pygame def check_keydown_events(event, ship): """Respond to keypresses.""" # Pressing down the keys, it means continue if event.key == pygame.K_RIGHT: ship.moving_right = True elif event.key == pygame.K_LEFT: ship.moving_left = True def check_keyup_events(event, ship...
SubaruSama/python-crash-course
Cap 12/Aliens/Aliens/game_functions.py
game_functions.py
py
1,217
python
en
code
0
github-code
6
[ { "api_name": "pygame.K_RIGHT", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.K_LEFT", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pygame.K_RIGHT", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pygame.K_LE...
29561202314
""" pdf_renderer.py Created on: Aug 31 2013 Author: eli """ from flask import send_file import os import shutil import subprocess import tempfile ### FUNCTIONS ### def create_env(app): """ Create a TeX environment. """ texenv = app.create_jinja_environment() texenv.block_start_string = '((...
elidaian/sudoku
src/server/pdf_renderer.py
pdf_renderer.py
py
1,473
python
en
code
1
github-code
6
[ { "api_name": "tempfile.mkdtemp", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path", "line_number": 35, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_n...
11331631943
from tkinter import * from PIL import ImageTk, Image import subprocess import sys class GUI: def __init__(self, parent): main_frame = Frame(parent, bg="white") main_frame.pack() #Logo self.imagef_osc = Image.open("images/osc.png") self.resize_image = self.imagef_osc.resize...
WalsalihiOSC/ormiston-cafe-jasond-osc
pay.py
pay.py
py
2,499
python
en
code
0
github-code
6
[ { "api_name": "PIL.Image.open", "line_number": 13, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 13, "usage_type": "name" }, { "api_name": "PIL.ImageTk.PhotoImage", "line_number": 15, "usage_type": "call" }, { "api_name": "PIL.ImageTk", "li...
74929830587
import socket import base64 import hashlib from Crypto import Random from Crypto.Cipher import AES key = 'asdfghjkl' class AESCipher(object): def __init__(self, key): self.bs = 32 self.key = hashlib.sha256(key.encode()).digest() def encrypt(self, raw): raw = self._pad(raw) ...
rotemga/infosec9
q2/a/winston.py
winston.py
py
993
python
en
code
0
github-code
6
[ { "api_name": "hashlib.sha256", "line_number": 15, "usage_type": "call" }, { "api_name": "Crypto.Random.new", "line_number": 19, "usage_type": "call" }, { "api_name": "Crypto.Random", "line_number": 19, "usage_type": "name" }, { "api_name": "Crypto.Cipher.AES.bloc...
34487428963
import logging as trace import numpy as np import time import re # Note: all logging (trace) messages # are in debug mode in this file class Potentiostat: address = 250 kom = None range_multiplier = 1e-9 time_multiplier = 5e-3 _freq=1000 _avg=20 _sample_number=0 def __init__(self, k...
ccucumber/verdeta-lockin
fotonowy/potentiostat.py
potentiostat.py
py
7,864
python
en
code
0
github-code
6
[ { "api_name": "logging.debug", "line_number": 48, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 65, "usage_type": "call" }, { "api_name": "logging.error", "line_number": 68, "usage_type": "call" }, { "api_name": "logging.debug", "line_n...
39564061531
import numpy as np import cv2 import Memmory from Convert import Convert import Sub_function import Marking import sys class SendValue: pro_path_file = Memmory.PathFile('') add_sub = Sub_function def __init__(self, category, top, bottom, left, right, heading, content, first_para, ...
Bioas/myproject
webs/control/Format_management.py
Format_management.py
py
13,331
python
en
code
0
github-code
6
[ { "api_name": "Memmory.PathFile", "line_number": 11, "usage_type": "call" }, { "api_name": "Convert.Convert", "line_number": 39, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 43, "usage_type": "call" }, { "api_name": "numpy.array", "line...
29185718772
from aiogram import Bot, Dispatcher, types from aiogram.dispatcher.filters import Text from handlers.start import buttons, start from configer import config bot = Bot(token=config.TOKEN) jena = types.InlineKeyboardButton('Жена', callback_data='for_mom') griga = types.InlineKeyboardButton('Гриша', callback_data='for...
KOA1KO/batiabot
handlers/pinok.py
pinok.py
py
2,929
python
ru
code
0
github-code
6
[ { "api_name": "aiogram.Bot", "line_number": 8, "usage_type": "call" }, { "api_name": "configer.config.TOKEN", "line_number": 8, "usage_type": "attribute" }, { "api_name": "configer.config", "line_number": 8, "usage_type": "name" }, { "api_name": "aiogram.types.Inl...
35249573150
import scipy.io as sio import numpy as np import matplotlib.pyplot as plt import matplotlib.lines as mlines from sklearn import svm from sklearn.preprocessing import minmax_scale from sklearn.model_selection import GridSearchCV from sklearn.model_selection import train_test_split def plot_graph(train, test, type): ...
pantanurag555/UCLA_STAT231
Project 3/Codes/P1_1.py
P1_1.py
py
2,998
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.lines.Line2D", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.lines", "line_number": 12, "usage_type": "name" }, { "api_name": "matplotlib.lines.Line2D", "line_number": 13, "usage_type": "call" }, { "api_name": "matp...
4931664534
import paddle.v2 as paddle import sys import gzip import data_reader # cnn layers def model(x): relu = paddle.activation.Relu() conv_1 = paddle.networks.img_conv_group( input=x, num_channels=3, pool_size=2, pool_stride=2, conv_num_filter=[32, 32], conv_filter_si...
wondervictor/DeepLearningWithPaddle
OCR/model.py
model.py
py
5,609
python
en
code
5
github-code
6
[ { "api_name": "paddle.v2.activation.Relu", "line_number": 9, "usage_type": "call" }, { "api_name": "paddle.v2.activation", "line_number": 9, "usage_type": "attribute" }, { "api_name": "paddle.v2", "line_number": 9, "usage_type": "name" }, { "api_name": "paddle.v2....
26038563916
from __future__ import annotations import re from collections import defaultdict from dataclasses import dataclass from pathlib import PurePath from typing import DefaultDict, Iterable from pants.backend.cc.subsystems.cc_infer import CCInferSubsystem from pants.backend.cc.target_types import CCDependenciesField, CCSo...
pantsbuild/pants
src/python/pants/backend/cc/dependency_inference/rules.py
rules.py
py
6,742
python
en
code
2,896
github-code
6
[ { "api_name": "re.compile", "line_number": 35, "usage_type": "call" }, { "api_name": "pants.engine.target.FieldSet", "line_number": 39, "usage_type": "name" }, { "api_name": "pants.backend.cc.target_types.CCSourceField", "line_number": 40, "usage_type": "name" }, { ...
22938441144
import unittest import sys sys.path.append(".") import pybiomol import datetime class PdbTest(unittest.TestCase): def setUp(self): self.pdb = pybiomol.get_pdb_from_file("tests/pdb/pdb_files/1SAM.pdb") class PdbInformationTest(PdbTest): def test_can_make_pdb(self): self.assertIsInstance(sel...
samirelanduk/pybiomol
tests/pdb/test_structurefile.py
test_structurefile.py
py
6,687
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pybiomol.get_pdb_fr...
26257820556
# Базовый класс моделей таблиц from sqlalchemy.ext.declarative import declarative_base # from sqlalchemy.orm import sessionmaker import sqlalchemy as sa Base = declarative_base() # Variables # Class definitions class User(Base): __tablename__ = "user" id = sa.Column(sa.INTEGER, primary_key=True) first_n...
vsixtynine/sf-sql-task
users.py
users.py
py
2,507
python
ru
code
0
github-code
6
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 6, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 14, "usage_type": "call" }, { "api_name": "sqlalchemy.INTEGER", "line_number": 14, "usage_type": "attribute" }, { ...
10422035343
from __future__ import annotations from typing import TYPE_CHECKING, NamedTuple from randovania.game_description.db.pickup_node import PickupNode from randovania.game_description.resources.location_category import LocationCategory from randovania.generator.pickup_pool import PoolResults from randovania.generator.pick...
randovania/randovania
randovania/generator/pickup_pool/pool_creator.py
pool_creator.py
py
3,072
python
en
code
165
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 12, "usage_type": "name" }, { "api_name": "randovania.layout.base.base_configuration.BaseConfiguration", "line_number": 17, "usage_type": "name" }, { "api_name": "randovania.game_description.game_description.GameDescription", ...
19712676526
import pyrebase # Load all ML dependencies import numpy as np import spacy from gensim.test.utils import common_texts, get_tmpfile from gensim.models import Word2Vec w2vmodel = Word2Vec.load("word2vec.model") # Load English tokenizer, tagger, parser, NER and word vectors nlp = spacy.load("en_core_web_sm") # Configu...
ricohasgithub/IntegraBackend
app.py
app.py
py
1,818
python
en
code
0
github-code
6
[ { "api_name": "gensim.models.Word2Vec.load", "line_number": 10, "usage_type": "call" }, { "api_name": "gensim.models.Word2Vec", "line_number": 10, "usage_type": "name" }, { "api_name": "spacy.load", "line_number": 12, "usage_type": "call" }, { "api_name": "pyrebas...
33393669516
import re from django.shortcuts import get_object_or_404, render from .models import Car from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator # Create your views here. def cars(request): prod_data = Car.objects.order_by('-added_date') paginator = Paginator(prod_data, 4) page = request.G...
MImtiajAhmed/dealer-system
cars/views.py
views.py
py
2,508
python
en
code
0
github-code
6
[ { "api_name": "models.Car.objects.order_by", "line_number": 8, "usage_type": "call" }, { "api_name": "models.Car.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "models.Car", "line_number": 8, "usage_type": "name" }, { "api_name": "django.co...
17435142299
import pytest class Solution: def minRemoveToMakeValid(self, s: str) -> str: """ Keep errs index while scaning, Then remove all error chars in the end using a string builder - 1 pass: when we meet a ), we can tell if it's error or not. : when we meet a (, we can't ...
naubull2/codingtests
leetcode/quick-prep/1371_Minimum_Remove_to_Make_Valid_Parentheses/solution.py
solution.py
py
1,393
python
en
code
0
github-code
6
[ { "api_name": "pytest.mark.parametrize", "line_number": 34, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 34, "usage_type": "attribute" }, { "api_name": "pytest.main", "line_number": 43, "usage_type": "call" } ]
26529704123
# -*- coding: utf-8 -*- """ Created on Tue Dec 10 01:24:17 2019 @author: Rashika """ import urllib.request, json import pandas as pd def data(): url= urllib.request.urlopen("https://s3.amazonaws.com/open-to-cors/assignment.json") data = json.loads(url.read().decode()) #print(data) products= dat...
Rashika-Katiyar/Assignment_SmartServ
FetchData.py
FetchData.py
py
706
python
en
code
0
github-code
6
[ { "api_name": "urllib.request.request.urlopen", "line_number": 12, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 12, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 12, "usage_type": "name" }, { "api_nam...
4084524461
"""Main module.""" import requests import logging import json from datetime import datetime, timedelta from slugify import slugify # logging.basicConfig(filename='mpv.log', encoding='utf-8', level=logging.DEBUG) logger = logging.getLogger("mpv") queries = [ { 'id': 'depto', 'url': 'https://api.mas...
camboris/mpv
mpv/mpv.py
mpv.py
py
3,880
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 31, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 31, "usage_type": "name" }, { "api_name": "request...
4521003864
import collections import copy import html import json import sys import traceback import urllib3 from bs4 import BeautifulSoup from graphviz import Digraph #cat-reqi Actual Course/Item #cat-reqa Header/Area #cat-reqg Sub-Heading/Group COURSE_CLASS = "cat-reqi" HOURS_PREFIX = '<span class="course_hours">(' http = ur...
ruler501/DegreePlanner
DegreePlanner.py
DegreePlanner.py
py
13,001
python
en
code
0
github-code
6
[ { "api_name": "urllib3.PoolManager", "line_number": 18, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 49, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 55, "usage_type": "call" }, { "api_name": "html.unescape", ...
31933026491
from pyspark.ml import Pipeline from pyspark.ml.regression import GBTRegressor from pyspark.ml.feature import VectorIndexer from pyspark.ml.evaluation import RegressionEvaluator from pyspark.sql import SparkSession spark = SparkSession.builder.getOrCreate() spark.sparkContext.setLogLevel("ERROR") data = spark.read.fo...
geoffreylink/Projects
07 Machine Learning/SparkML/sparkML_RG_gradientboostedtree.py
sparkML_RG_gradientboostedtree.py
py
1,085
python
en
code
9
github-code
6
[ { "api_name": "pyspark.sql.SparkSession.builder.getOrCreate", "line_number": 7, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 7, "usage_type...
37893999172
from utils.env_utils import create_env from controller.mppi import MPPI params = {'seed':42, #'h':0.05, 'h':0.1, 'env_name':'Acrobot-v1.1', 'render_mode':'human', 'sample_type':'cubic', 'n_knots':15, 'horizon':30, 'temperature':1.0, ...
jrapudg/jax_control_mppi_meshcat
mppi_script.py
mppi_script.py
py
1,186
python
en
code
0
github-code
6
[ { "api_name": "utils.env_utils.create_env", "line_number": 32, "usage_type": "call" }, { "api_name": "controller.mppi.MPPI", "line_number": 33, "usage_type": "call" } ]
36222304116
# -*- coding: utf-8 -*- """ """ import gzip import pandas as pd from pathlib_mate import Path def make_gzip(this_file, filename): """ 将文件名为 <filename> 的 ``.tsv`` 文件 (后缀名必须是tsv, 否则出粗) 压缩成 ``.tsv.gz`` 的压缩包文件. 执行该操作的 python 脚本必须和 ``.tsv`` 文件在同一目录下. :param this_file: 当前 python 脚本的文件全路径 :param file...
MacHu-GWU/wotlkdoc-project
wotlkdoc/compressed_tsv.py
compressed_tsv.py
py
1,268
python
zh
code
8
github-code
6
[ { "api_name": "pathlib_mate.Path", "line_number": 23, "usage_type": "call" }, { "api_name": "pathlib_mate.Path", "line_number": 25, "usage_type": "call" }, { "api_name": "gzip.open", "line_number": 27, "usage_type": "call" }, { "api_name": "pathlib_mate.Path", ...
8979140860
""" Gets a message from a local MQ """ import os import pickle import json import time import db import queue_handler import whisper_transcribe from models import Video, Segment from batch.bootstrap_logs import setup_logging from utils import combine_batch_segment logger = setup_logging("transcribe_logger", "data...
ashrielbrian/video_search
batch/transcribe.py
transcribe.py
py
2,127
python
en
code
1
github-code
6
[ { "api_name": "batch.bootstrap_logs.setup_logging", "line_number": 16, "usage_type": "call" }, { "api_name": "models.Video", "line_number": 24, "usage_type": "name" }, { "api_name": "pickle.loads", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path....
11299733811
import subprocess import os from multiprocessing import Process import math from osmread import parse_file, Way, Node, Relation import time import pickle from static import osm_dir as _dir from tools.weather import weather from tools.mercator import colors from tools import parse_location from sanic import Blueprint fr...
PooryaSharifi/V
ha.py
ha.py
py
7,756
python
en
code
0
github-code
6
[ { "api_name": "sanic.Blueprint", "line_number": 22, "usage_type": "call" }, { "api_name": "tools.weather.weather", "line_number": 27, "usage_type": "call" }, { "api_name": "sanic.response.json", "line_number": 32, "usage_type": "call" }, { "api_name": "bson.Object...
17177378494
""" Kaming Yip CS677 A1 Data Science with Python Apr. 19, 2020 Assignment 11.2: Custom K-means """ from pandas_datareader import data as web import os import pandas as pd import numpy as np from tabulate import tabulate import matplotlib.pyplot as plt from sklearn.preprocessing import StandardScaler def main(): d...
KamingYip/Trading_Strategies_with_Stock_Data
Custom k-means Clustering.py
Custom k-means Clustering.py
py
13,114
python
en
code
3
github-code
6
[ { "api_name": "pandas_datareader.data.get_data_yahoo", "line_number": 23, "usage_type": "call" }, { "api_name": "pandas_datareader.data", "line_number": 23, "usage_type": "name" }, { "api_name": "pandas.to_datetime", "line_number": 29, "usage_type": "call" }, { "a...
27104675593
from sklearn.metrics import silhouette_score, rand_score, adjusted_rand_score from sklearn.discriminant_analysis import LinearDiscriminantAnalysis def experiment_dimension_reduction_large_n(dim=100,n_clusters=5,spread=20,lower_bound=0,upper_bound=100,dp_n_components=50,\ pca_dim = 10,lda_dim = 2): #data gen ...
weiwu99/ece682_project
experiments.py
experiments.py
py
15,834
python
en
code
0
github-code
6
[ { "api_name": "sklearn.metrics.adjusted_rand_score", "line_number": 54, "usage_type": "call" }, { "api_name": "sklearn.metrics.adjusted_rand_score", "line_number": 91, "usage_type": "call" }, { "api_name": "sklearn.metrics.adjusted_rand_score", "line_number": 114, "usage_...
31236036771
from django.contrib import admin from django.contrib.admin import display from .models import Empresa, Service, Resource, Team, Plan, Speech, Contact, Phone #from luan_teste.admin_site import custom_admin_site @admin.register(Empresa,Resource,Speech,Contact,Phone) class FusionAdmin(admin.ModelAdmin): pass @...
diegoamferreira/teste-luan
fusion/admin.py
admin.py
py
1,235
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 11, "usage_type": "name" }, { "api_name": "django.contrib.admin.register", "line_number": 10, "usage_type": "call" }, ...
74325577467
#!/usr/bin/env python3 import json def readConfig(configFilePath = "config.json"): """Read and parse the config file as a dictionary. :return: The config file as a dictionary. """ try: with open(configFilePath) as configFile: config = json.load(configFile) except FileNotFoundError as e: erro...
Jeinzi/ETD-Filter
configmanager.py
configmanager.py
py
701
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 13, "usage_type": "call" }, { "api_name": "json.decoder", "line_number": 19, "usage_type": "attribute" } ]
28967973924
import json import sys from typing import List, Literal, TypedDict sys.path.append("pylib/anki/_vendor") import stringcase strings_json, ftl_js_path, ftl_dts_path, modules_js_path, modules_dts_path = sys.argv[ 1: ] with open(strings_json, encoding="utf8") as f: modules = json.load(f) class Variable(TypedDi...
NicolleNina/Anki
ts/lib/genfluent.py
genfluent.py
py
3,515
python
en
code
1
github-code
6
[ { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "json.load", "line_number...
2056094992
# USAGE # python test_model.py --input downloads --model output/lenet.hdf5 from keras.models import load_model from keras.preprocessing.image import img_to_array from pyimagesearch.utils.captchahelper import process from imutils import contours from imutils import paths import numpy as np import argparse import imutils...
lykhahaha/Mine
StarterBundle/chapter21-breaking_captchas/test_model.py
test_model.py
py
2,432
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "keras.models.load_model", "line_number": 21, "usage_type": "call" }, { "api_name": "imutils.paths.list_images", "line_number": 24, "usage_type": "call" }, { "api_nam...
25995623518
import io import json import logging import re import subprocess import tempfile import time from dataclasses import dataclass, field from typing import Any, Dict, List import yaml from . import config from . import entity from . import exceptions from . import model from . import schema from . import utils log = l...
parlaylabs/model
model/pipeline.py
pipeline.py
py
12,954
python
en
code
2
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "dataclasses.dataclass", "line_number": 30, "usage_type": "name" }, { "api_name": "subprocess.Popen", "line_number": 94, "usage_type": "call" }, { "api_name": "subprocess.P...
73658353149
import logging from universal_ci_noti.noti.producer import NotificationProducer from universal_ci_noti.noti.queue import NotificationQueue from universal_ci_noti.noti.types import JobResult from universal_ci_noti.web_server import WebAPI class WebProducer(NotificationProducer): def __init__(self, queue: Notifica...
zifter/universal-ci-noti
src/universal_ci_noti/noti/producer/impl/web.py
web.py
py
793
python
en
code
0
github-code
6
[ { "api_name": "universal_ci_noti.noti.producer.NotificationProducer", "line_number": 9, "usage_type": "name" }, { "api_name": "universal_ci_noti.noti.queue.NotificationQueue", "line_number": 10, "usage_type": "name" }, { "api_name": "universal_ci_noti.web_server.WebAPI", "lin...
71236764669
import numpy as np import math import transforms3d class Transforms(object): DTYPE = float @staticmethod def getRotMatEuler(rvec=[0, 0, 0]): ''' Calculates Rotation Matrix given euler angles. rotEuler = rotZ * rotY * rotX ''' if not (rvec[0] or rvec[1] or rvec[2]):...
humanoid-robotics-htl-leonding/robo-ducks-core
tools/mate/mate/lib/transforms/transforms.py
transforms.py
py
2,946
python
en
code
5
github-code
6
[ { "api_name": "numpy.eye", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 22, "usage_type": "call" }, { "api_name": "math.cos", "line_number": 23, "usage_type": "call" }, { "api_name": "math.sin", "line_number": 23, ...
5214843588
import os import requests def main(): fp = open("collage_parsed.json", 'r') dir = "issues/" done = False for line in fp: if "title" in line: title = line.strip()[10:-2] if "image" in line: image = line.strip()[10:-2] if "issue" and "pdf" in line: ...
nibraaska/Pharaoh
seedDataParse/parse_download.py
parse_download.py
py
1,123
python
en
code
1
github-code
6
[ { "api_name": "os.makedirs", "line_number": 20, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 30, "usage_type": "call" } ]
9523494601
from flask import Flask, render_template import urllib.request, json app_Rick = Flask(__name__) @app_Rick.route("/") def get_list_characters_page(): url = "https://rickandmortyapi.com/api/character" response = urllib.request.urlopen(url) data = response.read() dict = json.loads(data) return ren...
victoriamsm/rick_morty_api
app_R.py
app_R.py
py
2,886
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "urllib.request.request.urlopen", "line_number": 9, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 9, "usage_type": "attribute" }, { "api_name": "u...
28292154464
from p11_15 import * from scipy import stats import matplotlib.pyplot as plt def calculate_b1_from_origin(x, y): den = np.sum(np.power(x, 2)) nom = 0 for i in range(len(x)): nom += x[i] * y[i] return nom/den def estimate_var(y, y_pred): return np.sum(np.power(np.subtract(y, y_pred), 2)) /...
mohamadi-sara20/learn-stats
ch11/p11_29.py
p11_29.py
py
1,689
python
en
code
0
github-code
6
[ { "api_name": "scipy.stats.t.isf", "line_number": 40, "usage_type": "call" }, { "api_name": "scipy.stats.t", "line_number": 40, "usage_type": "attribute" }, { "api_name": "scipy.stats", "line_number": 40, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.sc...
7123589623
# -*- coding: utf-8 -*- import re from zope.interface import Interface from zope.component import getUtility from zope import schema from z3c.form import form, field, button from plone.z3cform.layout import wrap_form from upc.genweb.recaptcha.widget import ReCaptchaFieldWidget from Products.statusmessages.interfaces i...
UPCnet/upc.genwebupctheme
upc/genwebupctheme/browser/contact.py
contact.py
py
5,608
python
en
code
1
github-code
6
[ { "api_name": "zope.schema.ValidationError", "line_number": 22, "usage_type": "attribute" }, { "api_name": "zope.schema", "line_number": 22, "usage_type": "name" }, { "api_name": "Products.CMFPlone.PloneMessageFactory", "line_number": 23, "usage_type": "call" }, { ...
11844717054
from __future__ import print_function import torch import torch.nn as nn import torch.nn.functional as F import torchvision.models as models import torch.optim as optim from torchsummary import summary from torchvision import datasets, transforms import numpy as np import matplotlib.pyplot as plt import cv2 as cv ep...
itsEricWu/cs490-research
Traffic_sign_new/traffic_sign.py
traffic_sign.py
py
4,507
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 22, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 22, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
72532838269
# pylint: disable=redefined-outer-name # pylint: disable=too-many-arguments # pylint: disable=too-many-statements # pylint: disable=unused-argument # pylint: disable=unused-variable import asyncio import json import time from collections.abc import Awaitable, Callable, Iterator from copy import deepcopy from datetime ...
ITISFoundation/osparc-simcore
services/web/server/tests/unit/with_dbs/02/test_projects_states_handlers.py
test_projects_states_handlers.py
py
51,752
python
en
code
35
github-code
6
[ { "api_name": "simcore_service_webserver._meta.API_VTAG", "line_number": 55, "usage_type": "name" }, { "api_name": "pytest.MonkeyPatch", "line_number": 60, "usage_type": "attribute" }, { "api_name": "pytest.fixture", "line_number": 58, "usage_type": "attribute" }, { ...
34814928333
from django.shortcuts import render, redirect from .models import Info, EditorialBody # Create your views here. def home(request): if request.method == 'POST': serial = request.POST['Serial'] information = Info.objects.all().get(serial_no=serial) params = {'all': information} retur...
nazmul53p/CRUD_Project
core/views.py
views.py
py
1,196
python
en
code
1
github-code
6
[ { "api_name": "models.Info.objects.all", "line_number": 9, "usage_type": "call" }, { "api_name": "models.Info.objects", "line_number": 9, "usage_type": "attribute" }, { "api_name": "models.Info", "line_number": 9, "usage_type": "name" }, { "api_name": "django.shor...
11779890810
import json import numpy as np from collections import Counter print('reading dump') with open('data/climate2/topics_big/dump_7000000_monthly.json', 'r') as f: dump = json.load(f) print('iterating') no_climate = [t['topic'] for t in dump['tweets'] if 'climate' not in t['text'].lower()] cnts = Counter(no_climate)...
TimRepke/twitter-climate
code/pipeline/scripts/count_no_climate.py
count_no_climate.py
py
602
python
en
code
1
github-code
6
[ { "api_name": "json.load", "line_number": 7, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 12, "usage_type": "call" } ]
29567160728
# 用于模型和键盘操作比赛,键盘可以加速,键盘的小车为蓝色 import pygame from pygame.locals import * import math from game_logic import my_item from ai_logic_使用tensorflow框架.ai import get_res_by_tf from ai_logic_自己实现神经网络.training_model import Network import numpy as np BLACK = (0, 0, 0) WHITE = (255, 255, 255) GREEN = (0, 255, 0) RED = (255, 0, 0...
Gaoyang0/RacingGame
ai_logic_使用tensorflow框架/MotorRacing.py
MotorRacing.py
py
7,982
python
en
code
0
github-code
6
[ { "api_name": "pygame.transform.rotate", "line_number": 39, "usage_type": "call" }, { "api_name": "pygame.transform", "line_number": 39, "usage_type": "attribute" }, { "api_name": "math.pi", "line_number": 45, "usage_type": "attribute" }, { "api_name": "pygame.dra...
26932246545
import json import requests from Common.params import Params from Conf.Config import Config from Common import Assert class TestCoursePlayAddress: def test_response_data_format(self): """ 用例描述:播放地址接口默认参数状态码返回 :return: """ conf = Config() test = Assert.Assertions() ...
UncleLiketao/API_AutoTest_Framework_Python
TestCase/test_launcher3/test_course_playAddress.py
test_course_playAddress.py
py
1,038
python
en
code
0
github-code
6
[ { "api_name": "Conf.Config.Config", "line_number": 14, "usage_type": "call" }, { "api_name": "Common.Assert.Assertions", "line_number": 15, "usage_type": "call" }, { "api_name": "Common.Assert", "line_number": 15, "usage_type": "name" }, { "api_name": "Common.para...
35246374807
import boto3 sqs = boto3.client('sqs') response = sqs.receive_message( QueueUrl='https://sqs.us-east-1.amazonaws.com/292274580527/cc406_team4' ) recibos = [] for message in response["Messages"]: recibos.append(message["ReceiptHandle"]) print(message["Body"]) #for r in recibos: # response = sqs.delet...
AnaValeriaGM/TacosFranc
CarpetaProyecto/proyecto.py
proyecto.py
py
420
python
en
code
0
github-code
6
[ { "api_name": "boto3.client", "line_number": 3, "usage_type": "call" } ]
24184583704
import json import numpy as np import math import cv2 from ego_pose.envs.humanoid_v1 import HumanoidEnv from envs.visual.humanoid_vis import HumanoidVisEnv class Pose2DContext: def __init__(self, cfg, gt_comparison=False): if gt_comparison: self.vis_model = 'humanoid_1205_vis_single_v1' ...
marikoisogawa/OpticalNLOSPose
pose/ego_pose/utils/pose2d.py
pose2d.py
py
11,728
python
en
code
17
github-code
6
[ { "api_name": "envs.visual.humanoid_vis.HumanoidVisEnv", "line_number": 16, "usage_type": "call" }, { "api_name": "ego_pose.envs.humanoid_v1.HumanoidEnv", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 24, "usage_type": "call" }, ...
73844202747
#!/usr/bin/env python from imageprocessing import flatten_rgb_image from parallel import process import cv2, random, argparse, sys import numpy as np WIDTH = 64 HEIGHT = 64 parser = argparse.ArgumentParser() parser.add_argument("-n", type = int, required = True) # number of instances for each class parser.add_argum...
daniel-e/tinyimages
bin/gen.py
gen.py
py
1,889
python
en
code
1
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "random.seed", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.random.rand", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.random", ...
17770787051
import nltk # Function that works for multiple types of parsers (You are free to use something else if you want.) def check_sentence(parser, sentence): print("--------------------------------------------------") print("Checking if provided sentence matches the grammar:") print(sentence) if isinstance(s...
Carmoondedraak/NLTK-project
PCF.py
PCF.py
py
2,608
python
en
code
0
github-code
6
[ { "api_name": "nltk.pos_tag", "line_number": 22, "usage_type": "call" } ]
72777547387
import matplotlib.pyplot as plt import numpy as np y, x = np.ogrid[0:1:21j, 0:1:21j] pi = np.pi A = 1.0 vx = -A * (np.cos(2 * pi * x) * np.sin(2 * pi * y)) vy = A * (np.sin(2 * pi * x) * np.cos(2 * pi * y)) plt.quiver(x, y, vx, vy, color="b", label="velocity") # uncomment the following lines to plot streamlines inst...
evgenyneu/ASP3162
01_intro_to_programming/python_plotting/03_vector_plot/vector_plot.py
vector_plot.py
py
585
python
en
code
1
github-code
6
[ { "api_name": "numpy.ogrid", "line_number": 4, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number": 5, "usage_type": "attribute" }, { "api_name": "numpy.cos", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": ...