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
73914447358
# https://www.hackerrank.com/challenges/collections-counter/problem from collections import Counter if __name__ == '__main__': numberofshoes = int(input()) shoevarietysize = Counter(map(int,input().split())) numberofcustomer = int(input()) totalincome = 0 for _ in range(numberofcustomer): ...
AbhishekYadav011/learning
problem_solving/hackerrank/collection_counter.py
collection_counter.py
py
555
python
en
code
0
github-code
97
[ { "api_name": "collections.Counter", "line_number": 6, "usage_type": "call" } ]
21795792191
# -*- coding: utf-8 -*- import os import xlrd import logging from sources.repository.noderepository import NodeRepo from sources.domain.nodesubscriber import NodeSubscriber from sources.domain.errors import MigrateError from sources.config.config import * log_def_subs_repo = logging.getLogger("migrate.defsubsrepo") ...
vpalex999/tusur_software_development
MigrateIMS/sources/repository/mockrepository.py
mockrepository.py
py
1,999
python
en
code
0
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "sources.repository.noderepository.NodeRepo", "line_number": 13, "usage_type": "name" }, { "api_name": "os.path.isfile", "line_number": 18, "usage_type": "call" }, { "api_n...
10811508022
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Feb 22 11:05:03 2022 @author: belayv """ import mdtraj as md import paramiko from scp import SCPClient, SCPException import os import sys def send_to_fah(lilac_out_dir,fah_in_dir): def remove_solvent(lilac_out_dir): for i in...
viktorbelay/protein-analysis-package
1.py
1.py
py
2,849
python
en
code
0
github-code
97
[ { "api_name": "os.listdir", "line_number": 20, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 25, "usage_type": "call" }, { "api_name": "mdtraj.load", "line_number": 27, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 35, ...
32044108462
from flask import Flask, request from flask_cors import CORS import requests from datetime import datetime from dateutil.relativedelta import relativedelta from geopy.geocoders import Nominatim from random import * import json app = Flask(__name__) CORS(app) @app.route("/getSamplePoints") def samplePoints(): # sa...
danielyuenhx/cleanchain-backend
server.py
server.py
py
2,189
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 11, "usage_type": "call" }, { "api_name": "geopy.geocoders.Nominatim", "line_number": 32, "usage_type": "call" }, { "api_name": "json.dumps", ...
13130363386
import argparse import os import time import cv2 import numpy as np import tensorrt as trt import common TRT_LOGGER = trt.Logger(trt.Logger.INFO) trt.init_libnvinfer_plugins(TRT_LOGGER, "") WINDOW_NAME = "TensorRT Fast-SCNN example." mean = [0.485, 0.456, 0.406] std = [0.229, 0.224, 0.225] def get_engine(engine...
NobuoTsukamoto/tensorrt-examples
python/fast_scnn/trt_fast_scnn_image.py
trt_fast_scnn_image.py
py
4,448
python
en
code
71
github-code
97
[ { "api_name": "tensorrt.Logger", "line_number": 12, "usage_type": "call" }, { "api_name": "tensorrt.init_libnvinfer_plugins", "line_number": 13, "usage_type": "call" }, { "api_name": "tensorrt.Runtime", "line_number": 23, "usage_type": "call" }, { "api_name": "num...
3026908945
# importing the necessary packages import os from dotenv import load_dotenv import spotipy from spotipy.oauth2 import SpotifyClientCredentials import spotipy.util as util sp = spotipy.Spotify() load_dotenv() # setting up authorization cid = os.getenv('SPOTIFY_CID') secret = os.getenv('SPOTIFY_SID') # saving the info...
camjewell11/SpotofyAMBot
Spotify.py
Spotify.py
py
2,415
python
en
code
0
github-code
97
[ { "api_name": "spotipy.Spotify", "line_number": 8, "usage_type": "call" }, { "api_name": "dotenv.load_dotenv", "line_number": 10, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 12, "usage_type": "call" }, { "api_name": "os.getenv", "line_num...
74142208638
from __future__ import absolute_import import os.path import sys from datetime import timedelta from dns.name import from_text from dns.rdataclass import IN from dns.rdatatype import A, AAAA from dns.resolver import Cache from reconfigure.configs import HostsConfig from .dnspython import create_answer, create_simp...
jayvdb/dns-cache
dns_cache/hosts.py
hosts.py
py
3,132
python
en
code
18
github-code
97
[ { "api_name": "datetime.timedelta", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.platform", "line_number": 52, "usage_type": "attribute" }, { "api_name": "os.path.path.expandvars", "line_number": 58, "usage_type": "call" }, { "api_name": "os.path....
71438174719
# Import libraries for pre-processing import numpy as np np.random.seed(1000) import matplotlib.pyplot as plt import os import cv2 from PIL import Image import keras # Set the path & size of images image_directory = 'D:/ML_Projects/Melanoma Classification/skin-lesions/train/' SIZE = 128 dataset_train = [...
AnirudhHosur/Skin-Lesion---melanoma-detection-
skin_cancer_classification.py
skin_cancer_classification.py
py
9,698
python
en
code
0
github-code
97
[ { "api_name": "numpy.random.seed", "line_number": 3, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 23, "usage_type": "call" }, { "api_name": "cv2.imread", "line_n...
40914821932
""".. Ignore pydocstyle D400. ===== State ===== Constants used by the dispatcher. .. autofunction:: resolwe.flow.managers.state.update_constants """ # This module should not import anything local, or there will be circular # dependencies, since the constants are needed in various sub-modules inside # resolwe.flow.ma...
gregorjerse/resolwe
resolwe/flow/managers/state.py
state.py
py
1,297
python
en
code
null
github-code
97
[ { "api_name": "collections.namedtuple", "line_number": 19, "usage_type": "call" }, { "api_name": "django.conf.settings", "line_number": 35, "usage_type": "argument" } ]
30021096656
from flask import (Flask, render_template, request, jsonify) app = Flask(__name__) @app.route('/') def index(): print('request for index page received') return render_template('index.html') @app.route('/convert', methods=['POST']) def convert(): data = request.get_json() celsius = data.get('celsius')...
mddiallo/api-temp-flask
app.py
app.py
py
568
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.request.get_json", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.request"...
21977485552
from django.shortcuts import render from django.http import HttpResponse # from models import Question from django.template import loader import json import logging import sys import os from models.predict_model import Modelpredictor from .models import Question import models.train_model as tm import storage.database ...
MarcRotsaert/MakeAIWork3
projects/healthapp/src/django/myfirstdjango/polls/views.py
views.py
py
3,195
python
en
code
0
github-code
97
[ { "api_name": "logging.basicConfig", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 20, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 20, "usage_type": "call" }, { "api_name": "models.Question.objects.o...
3638033988
import streamlit as st import networkx as nx import matplotlib.pyplot as plt G, undirected_G = st.session_state.G, st.session_state.undirected_G def visualize_network(G, plot_options): pos = nx.spring_layout(G, iterations=20, seed=1721) fig, ax = plt.subplots(figsize=(40, 15), dpi=10000) # Increase dpi here...
AlainJoss/foodweb-analyser
pages/9_visualization.py
9_visualization.py
py
635
python
en
code
0
github-code
97
[ { "api_name": "streamlit.session_state", "line_number": 5, "usage_type": "attribute" }, { "api_name": "networkx.spring_layout", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 10, "usage_type": "call" }, { "api_...
72004275198
from django.contrib.auth.models import User, Group from stonks.models import * # UserProfile, User, Funds, Transactions from rest_framework import serializers from rest_framework_simplejwt.serializers import TokenObtainPairSerializer class UserProfileSerializer(serializers.ModelSerializer): class Meta: ...
brongh/junk_stonks
stonks/serializers.py
serializers.py
py
4,005
python
en
code
0
github-code
97
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 7, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 7, "usage_type": "name" }, { "api_name": "rest_framework.serializers.HyperlinkedModelSerializer", "line_number...
74468443198
from django.shortcuts import render, redirect from crud.models import players, game, player_game_scoreboard from django.http import JsonResponse, HttpResponse from django.views.decorators.csrf import csrf_exempt import json from django.contrib.auth.decorators import login_required @login_required() def teamSel...
ChristosK97/CkCrudAppPublic
crud/views.py
views.py
py
13,962
python
en
code
0
github-code
97
[ { "api_name": "crud.models.game.objects.filter", "line_number": 10, "usage_type": "call" }, { "api_name": "crud.models.game.objects", "line_number": 10, "usage_type": "attribute" }, { "api_name": "crud.models.game", "line_number": 10, "usage_type": "name" }, { "ap...
70741508478
from os.path import exists, join from collections import defaultdict import numpy as np import os import time import logging import re import pickle import shutil import signal from multiprocessing import Pool try: from spython.main import Client as client except: pass BUFFER_PATH = os.getenv('BUFFER_PATH') i...
Daffan/ros_jackal
rl_algos/collector.py
collector.py
py
8,060
python
en
code
19
github-code
97
[ { "api_name": "os.getenv", "line_number": 18, "usage_type": "call" }, { "api_name": "spython.main.Client.execute", "line_number": 23, "usage_type": "call" }, { "api_name": "spython.main.Client", "line_number": 23, "usage_type": "name" }, { "api_name": "os.path.joi...
73478330239
import argparse def left_factoring2(rules, n): counter = 0 max_alpha = {} for key in rules: max_alpha[key] = 1 while(True): if(counter == n): break keys = list(rules) rule = keys[counter] rule_without_stricks = rule.split('\'')[0] gram = rul...
DavidAbdelmalek/Compiler_Design
left factoring/task_4_2.py
task_4_2.py
py
3,057
python
en
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 62, "usage_type": "call" } ]
33722466667
# import datetime # # def regularMonths(currMonth): # mm, yy = map(int, currMonth.split("-")) # while True: # if mm < 12: # mm += 1 # else: # mm = 1 # yy +=1 # m = datetime.date(yy, mm, 1) # if m.weekday() == 0: # return m.strftime(...
Vestenar/PythonProjects
venv/02_Codesignal/02_The Core/135_regularMonths.py
135_regularMonths.py
py
1,784
python
en
code
0
github-code
97
[ { "api_name": "datetime.datetime.strptime", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 20, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 28, "usage_type": "call" }, { "api_name": "dateti...
13589005727
import random #Libreria utilizada para generar un numero aleatorio para el comprobante import datetime #Libreria utilizada para usar la fecha y hora def cargar_apuestas_quiniela(): ''' Esta funcion lee las apuestas en el archivo y almacena cada linea en la lista datos, el elemento 1 de datos corresponde...
te02021/Proyecto-Final
proyectofinal.py
proyectofinal.py
py
21,466
python
es
code
0
github-code
97
[ { "api_name": "datetime.datetime.now", "line_number": 48, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 48, "usage_type": "attribute" }, { "api_name": "random.randint", "line_number": 49, "usage_type": "call" }, { "api_name": "datetime....
73733537918
from sklearn.neural_network import MLPRegressor from sklearn.model_selection import train_test_split from sklearn.metrics import mean_squared_error import pandas as pd import utilities houses = pd.read_csv("../../datasets/house_prices/train.csv") houses = houses.drop(['Id'], axis=1) numerical_houses = houses._get_nume...
lipry/DatascienceFriday
source/house_prices_script/neural_network.py
neural_network.py
py
874
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "utilities.sub_na", "line_number": 10, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 15, "usage_type": "call" }, { "api_name...
44017042952
import math import time import numpy as np import scipy as sp import matplotlib.pyplot as plt from matplotlib.lines import Line2D import scipy.signal as sig import scipy.fft as fft import scipy.io.wavfile as wavfile from scipy.constants import pi import sounddevice as sd # Documentation: https://python-sounddevice.re...
DGullicksonMines/DSP_Group7Project
adaptive_filter_testing/adaptive_filter.py
adaptive_filter.py
py
2,281
python
en
code
0
github-code
97
[ { "api_name": "scipy.io.wavfile.read", "line_number": 17, "usage_type": "call" }, { "api_name": "scipy.io.wavfile", "line_number": 17, "usage_type": "name" }, { "api_name": "math.ceil", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.linspace", ...
24745331419
products = [ {"item_name": "boost", "mrp": 290, "stock": 50}, {"item_name": "complan", "mrp": 240, "stock": 10}, {"item_name": "bournvita", "mrp": 320, "stock": 20}, {"item_name": "horlicks", "mrp": 280, "stock": 13}, {"item_name": "nutricharge", "mrp": 275, "stock": 0}, ] name = list(map(lambda pr...
Anjualbin/workdirectory
Functional programming by sajay/mapd.py
mapd.py
py
750
python
en
code
0
github-code
97
[ { "api_name": "functools.reduce", "line_number": 26, "usage_type": "call" } ]
182077926
'''Regional spider module''' # -*- coding: utf-8 -*- from scrapy.spider import Spider from scrapy.selector import Selector from scrapy.http import Request import urlparse from regional.items import RegionalItem class RegionalSpider(Spider): '''Regional spider''' name = 'regional-spider' ...
lucumt/myrepository
python/amd47/ny/dec/regional_spider/regional/spiders/regionalspider.py
regionalspider.py
py
2,455
python
en
code
1
github-code
97
[ { "api_name": "scrapy.spider.Spider", "line_number": 13, "usage_type": "name" }, { "api_name": "scrapy.selector.Selector", "line_number": 24, "usage_type": "call" }, { "api_name": "regional.items.RegionalItem", "line_number": 36, "usage_type": "call" }, { "api_nam...
42446489055
import numpy as np import cv2 from PIL import ImageGrab # windows FOURCC = 'DIVX' # linux # FOURCC = 'XVID' p = ImageGrab.grab() a, b = p.size fourcc = cv2.VideoWriter_fourcc(*FOURCC) video = cv2.VideoWriter('video.mp4', fourcc, 60, (a, b)) while True: im = ImageGrab.grab() cv_im = cv2.cvtColor(np.array(im),...
ZhiyuanLck/VideoScript
ScreenCapture.py
ScreenCapture.py
py
379
python
en
code
0
github-code
97
[ { "api_name": "PIL.ImageGrab.grab", "line_number": 9, "usage_type": "call" }, { "api_name": "PIL.ImageGrab", "line_number": 9, "usage_type": "name" }, { "api_name": "cv2.VideoWriter_fourcc", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.VideoWriter...
37308223216
#!/usr/bin/env python """Tests for `kred` package.""" import unittest from nose2.tools import params class TestStringMethods(unittest.TestCase): @params("Pragmaapps", "Pragmaapps Technalogy", "iPragmatech name as Pragmaapps") def test_is_knight(self, value): assert value.startswith('Pragmaapps') ...
javedpragmaapps/kred
tests/test_demo.py
test_demo.py
py
581
python
en
code
0
github-code
97
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "nose2.tools.params", "line_number": 12, "usage_type": "call" }, { "api_name": "nose2.tools.params", "line_number": 17, "usage_type": "call" } ]
43642549179
from itertools import combinations card_count, target = list(map(int, input().split(" "))) cards = list(map(int, input().split(" "))) closest = 0 for combos in combinations(cards, 3): summed = sum(combos) if closest < summed <= target: closest = summed print(closest)
JYC11/data-structures-and-algos
baekjun/blackjack_sum.py
blackjack_sum.py
py
297
python
en
code
0
github-code
97
[ { "api_name": "itertools.combinations", "line_number": 7, "usage_type": "call" } ]
8011764090
#!/usr/bin/python import cgi, cgitb, pickle import os.path as path print("Content-type: text/html\n") cgitb.enable() inpts = cgi.FieldStorage() data_dir = '' def cartTotal(username): total = 0.00 for item in carts[username]: total += float(item.price) return "%.2f" % total d...
shadmanrakib/surreal
surreal/cart.py
cart.py
py
5,778
python
en
code
0
github-code
97
[ { "api_name": "cgitb.enable", "line_number": 6, "usage_type": "call" }, { "api_name": "cgi.FieldStorage", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 71, "usage_type": "call" }, { "api_name": "os.path", "line_number...
37845335564
import logging import argparse import os import sqlite3 from datetime import datetime from bs4 import BeautifulSoup def main(): parser = argparse.ArgumentParser( description="Parse saved webpages for user and route data." ) parser.add_argument("input", help="The folder wit...
andylamb/8a-data
parse.py
parse.py
py
11,261
python
en
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 27, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 28, "usage_type": "attribute" }, { "api_name": "logging....
8499297081
#!/usr/bin/python from itertools import permutations from project_euler import timeit, sieves, tuple_to_digit def is_permutations(nbrs): perms = map(tuple_to_digit, permutations(str(nbrs[0]), 4)) return all(nbr in perms for nbr in nbrs) def prime_permutations(): sieve = sieves(10000) diff = 3330 ...
PStahl/project_euler
p049_prime_permutations.py
p049_prime_permutations.py
py
549
python
en
code
0
github-code
97
[ { "api_name": "project_euler.tuple_to_digit", "line_number": 9, "usage_type": "argument" }, { "api_name": "itertools.permutations", "line_number": 9, "usage_type": "call" }, { "api_name": "project_euler.sieves", "line_number": 14, "usage_type": "call" }, { "api_na...
38921782103
from typing import List class BinarySearch: def binary_search(self, nums: List[int], target, low, high) -> int: if high >= low: mid = (low + high) // 2 if nums[mid] == target: return True elif nums[mid] > target: return self.binary_searc...
SamanehGhafouri/leetcode
easy/above_70_percent_easy/Algorithms/binary_search.py
binary_search.py
py
622
python
en
code
0
github-code
97
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" } ]
26848031835
import json import boto3 import urllib3 def lambda_handler(event, context): for item_event in event["Records"]: item_event_body = json.loads(item_event["body"]) job_name = item_event_body["job_guid"] url = item_event_body["audio_url"] bucket = "voice-recognition-2131...
AntonAnton/aws_voice_transcribtion_test_task
transcribtions_handler.py
transcribtions_handler.py
py
1,288
python
en
code
0
github-code
97
[ { "api_name": "json.loads", "line_number": 8, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 17, "usage_type": "call" }, { "api_name": "urllib3.PoolManager", "line_number": 18, "usage_type": "call" }, { "api_name": "boto3.client", "line_n...
4170145499
from is_wire.core import Channel, Message, Subscription from is_msgs.common_pb2 import Tensor import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import cv2 import sys def create_world_frame(): # Create the world frame u_vectors = np.array([1,0,0]) v_vectors = np...
rfvassallo/learningISBristol
lesson07_moveRobot_correctOdometry/plot_odometry.py
plot_odometry.py
py
3,490
python
en
code
1
github-code
97
[ { "api_name": "numpy.array", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": ...
36516499770
import json import tornado.web from tornado import gen from docker_settings import docker_commands, whitelist from executor import executors from linux_command import linux_command_execute from loggers import logger from slack import slack_messages, slack_settings, slack_http_client # docker_webhook_handler.p...
gitter-badger/Docker-Webhooks-Server
Tornado-Application/handlers/docker_webhook_handler.py
docker_webhook_handler.py
py
2,997
python
en
code
0
github-code
97
[ { "api_name": "tornado.web.web", "line_number": 15, "usage_type": "attribute" }, { "api_name": "tornado.web", "line_number": 15, "usage_type": "name" }, { "api_name": "loggers.logger.logger.info", "line_number": 29, "usage_type": "call" }, { "api_name": "loggers.l...
16896729259
import torch from torch import nn import torch.nn.functional as F class TextEncoder(nn.Module): def __init__(self, embedding_size, hidden_size, num_layers, bidirectional=False, model_type='gru'): super().__init__() if model_type == 'gru': self.text_encoder = nn.GRU(embedding_si...
shreyansh26/Sentence-VAE
model.py
model.py
py
7,277
python
en
code
2
github-code
97
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.GRU", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.nn", "line_number"...
36820760246
from flask import Blueprint, render_template, send_from_directory, url_for, current_app, request, Response, send_file, jsonify from flask_login import login_required, current_user from flask_uploads import UploadSet, IMAGES from flask_wtf import FlaskForm from flask_wtf.file import FileField, FileRequired, FileAllo...
megashinyabsol359/Cloudinary-2.0
code/project/main.py
main.py
py
8,619
python
en
code
0
github-code
97
[ { "api_name": "flask.Blueprint", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 21, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 26, "usage_type": "call" }, { "api_name": "flask_log...
43391429647
from django.shortcuts import render, redirect, get_object_or_404 from django.contrib import messages from django.contrib.auth.decorators import login_required from .forms import CreateEventForm, JoinEvent, LikeEvent from django.urls import reverse, reverse_lazy from .models import Event, Participant, Like from membersh...
paperclippete/FinalMilestone
events/views.py
views.py
py
6,128
python
en
code
1
github-code
97
[ { "api_name": "forms.CreateEventForm", "line_number": 16, "usage_type": "call" }, { "api_name": "forms.CreateEventForm", "line_number": 19, "usage_type": "call" }, { "api_name": "membership.models", "line_number": 24, "usage_type": "name" }, { "api_name": "members...
72970191998
#!/home/zeyu/anaconda3/bin/python3.6 """ Preprocessing Author: Zeyu Li <zyli@cs.ucla.edu> or <zeyuli@ucla.edu> Description: Take in the Very raw data and produce a ready-to-use version """ import sys, os import re import logging import numpy as np from lxml import etree from bs4 import B...
zyli93/NeRank
src/preprocessing.py
preprocessing.py
py
23,663
python
en
code
19
github-code
97
[ { "api_name": "nltk.data.path.append", "line_number": 21, "usage_type": "call" }, { "api_name": "nltk.data", "line_number": 21, "usage_type": "attribute" }, { "api_name": "bs4.BeautifulSoup", "line_number": 44, "usage_type": "call" }, { "api_name": "re.sub", "...
5094825006
# -*- coding: utf-8 -*- import numpy as np import pandas as pd import argparse import glob import sys import os import sys import random import copy import json import time from datetime import datetime as dt import matplotlib.pyplot as plt path = os.path.join(os.path.dirname(__file__), '../') sys.path.append(path) ...
conf-post-01/Ddim
ddim_change_symptom/ddim_simulation_real_data.py
ddim_simulation_real_data.py
py
14,094
python
en
code
0
github-code
97
[ { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.path.append", "line...
21928761617
import json from glob import glob from os.path import isdir, join import click import semantic_version from platformio import app, exception, util from platformio.compat import glob_escape from platformio.managers.package import BasePkgManager from platformio.managers.platform import PlatformFactory, PlatformManager ...
socallinuxexpo/scaleav-deb
opt/scaleavvenv/lib/python3.6/site-packages/platformio/managers/lib.py
lib.py
py
12,034
python
en
code
1
github-code
97
[ { "api_name": "platformio.managers.package.BasePkgManager", "line_number": 15, "usage_type": "name" }, { "api_name": "platformio.project.config.ProjectConfig.get_instance", "line_number": 20, "usage_type": "call" }, { "api_name": "platformio.project.config.ProjectConfig", "li...
70607913280
""" Script for raw yield extraction """ import os import sys import argparse import yaml import pandas as pd import numpy as np from hist import Hist import uproot from flarefly.data_handler import DataHandler from flarefly.fitter import F2MassFitter from particle import Particle def create_hist(pt_lims, contents, er...
DmesonAnalysers/DmesonAnalysis
resonances/extract_rawyield_DV0reso.py
extract_rawyield_DV0reso.py
py
7,341
python
en
code
9
github-code
97
[ { "api_name": "hist.Hist.new.Var", "line_number": 36, "usage_type": "call" }, { "api_name": "hist.Hist.new", "line_number": 36, "usage_type": "attribute" }, { "api_name": "hist.Hist", "line_number": 36, "usage_type": "name" }, { "api_name": "numpy.array", "lin...
2631177664
from django.test import TestCase from knesset.settings import PROJECT_ROOT from knesset.mks.models import Member from knesset.committees.models import Committee from knesset.mmm.models import Document, parse_json, text_lookup, verify from datetime import datetime import simplejson import re FP = open(PROJECT_ROOT + "/...
adamatan/Open-Knesset
src/knesset/mmm/tests.py
tests.py
py
2,215
python
en
code
null
github-code
97
[ { "api_name": "knesset.settings.PROJECT_ROOT", "line_number": 10, "usage_type": "name" }, { "api_name": "simplejson.load", "line_number": 11, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetim...
3286547792
from thread import Thread import os import time from .bluetoothctl import Bluetoothctl import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk, GdkPixbuf class Handler: def __init__(self, builder, controller=None): self.builder = builder self.bluetooth = None self.devices ...
adamcakg/configuration-tools-Raspberry-Pi
settings/bluetooth/handler.py
handler.py
py
6,971
python
en
code
1
github-code
97
[ { "api_name": "gi.require_version", "line_number": 7, "usage_type": "call" }, { "api_name": "thread.Thread", "line_number": 17, "usage_type": "call" }, { "api_name": "gi.repository.Gtk.ListStore", "line_number": 38, "usage_type": "call" }, { "api_name": "gi.reposi...
30929318619
from uuid import uuid4 from storm.locals import Not from fluiddb.data.namespace import Namespace, createNamespace from fluiddb.data.object import getDirtyObjects, DirtyObject from fluiddb.data.permission import ( NamespacePermission, Operation, Policy, TagPermission, createTagPermission, getTagPermissions) fr...
fluidinfo/fluiddb
fluiddb/model/test/test_tag.py
test_tag.py
py
21,389
python
en
code
7
github-code
97
[ { "api_name": "fluiddb.data.permission.getTagPermissions", "line_number": 30, "usage_type": "call" }, { "api_name": "fluiddb.data.permission.Policy.CLOSED", "line_number": 31, "usage_type": "attribute" }, { "api_name": "fluiddb.data.permission.Policy", "line_number": 31, ...
13793066442
#using async import asyncio import random async def produce(cookiejar, n): for x in range(1, n + 1): # produce an item print('producing {}/{}'.format(x, n)) # simulate i/o operation using sleep print("<<producer waiting>>") await asyncio.sleep(random.random()) ...
Pratyush-Shanbhag/Advanced_Python
PC/PC3.py
PC3.py
py
1,269
python
en
code
0
github-code
97
[ { "api_name": "asyncio.sleep", "line_number": 11, "usage_type": "call" }, { "api_name": "random.random", "line_number": 11, "usage_type": "call" }, { "api_name": "asyncio.sleep", "line_number": 35, "usage_type": "call" }, { "api_name": "random.random", "line_n...
38953308859
import matplotlib.pyplot as plt import matplotlib.lines as mline import matplotlib import os import numpy as np from scipy.interpolate import griddata #Plot preamble matplotlib.rcdefaults() matplotlib.rc('font',**{'family':'serif','size':16}) os.environ['PATH'] = os.environ['PATH'] + ':/opt/local/bin' os.environ['PAT...
Mylleranton/AccretionDisks
Old/force_vectors.py
force_vectors.py
py
7,050
python
en
code
0
github-code
97
[ { "api_name": "matplotlib.rcdefaults", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.rc", "line_number": 10, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.environ", "...
7705365067
from bs4 import BeautifulSoup import lxml import pandas as pd import re df = pd.read_csv('react-native.csv') print(df.head()) #content = df['body'].tolist() ### ### read body as a single string ### content = df['body'].str.cat(sep=',') print(len(content)) soup = BeautifulSoup(content, "lxml") ### ### remove ...
rudongsu/Emotion-SO
pre_processing.py
pre_processing.py
py
1,047
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 32, "usage_type": "call" } ]
34914782272
import unittest from mock import patch from linotp.tokens.emailtoken import EmailTokenClass from linotp.tokens.hmactoken import HmacTokenClass from linotp.tokens.passwordtoken import PasswordTokenClass from linotp.tokens.smstoken import SmsTokenClass from linotp.tokens.totptoken import TimeHmacTokenClass from linotp....
LinOTP/LinOTP
linotp/tests/unit/tokens/challenge_token/test_challenge_prompt.py
test_challenge_prompt.py
py
6,079
python
en
code
484
github-code
97
[ { "api_name": "unittest.TestCase", "line_number": 63, "usage_type": "attribute" }, { "api_name": "linotp.tokens.smstoken.SmsTokenClass", "line_number": 84, "usage_type": "call" }, { "api_name": "mock.patch", "line_number": 66, "usage_type": "call" }, { "api_name":...
73073512318
import os import torch import numpy as np from torch.nn import functional as F from .model import CriticNet, Actor_1_Net, Actor_2_Net, Actor_3_Net from .Image_model import CNN, Ray, Feature from .replay_memory import Transition, Memory class MultiDDPG_Agent: def __init__(self, **config): self.config = con...
ChouYuhao/my_algo
pycharm-unity/algorithm/HRL/Multi-DDPG_con/Brain/agent.py
agent.py
py
8,931
python
en
code
0
github-code
97
[ { "api_name": "replay_memory.Memory", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 22, "usage_type": "attribute" }, { "api_name": "model.Cr...
4383080597
"""add age column into user table Revision ID: eaf754b4cce2 Revises: 4c1ed9483d5e Create Date: 2020-08-30 18:43:16.390626 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'eaf754b4cce2' down_revision = '4c1ed9483d5e' branch_labels = None depends_on = None def ...
antonLytkin18/otus-highload
app/app/migration/versions/eaf754b4cce2_add_age_column_into_user_table.py
eaf754b4cce2_add_age_column_into_user_table.py
py
533
python
en
code
2
github-code
97
[ { "api_name": "alembic.op.get_bind", "line_number": 20, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 20, "usage_type": "name" }, { "api_name": "alembic.op.get_bind", "line_number": 25, "usage_type": "call" }, { "api_name": "alembic.op", "...
22425125798
# -*- coding: utf-8 -*- # @Author: Nandadeep Davuluru # @Date: 2019-03-10 11:38:34 # @Last Modified by: nandadeep # @Last Modified time: 2019-03-12 20:42:22 import os, time from kmp import KMP from naive import NaiveStringMatch from bm import BoyerMoore from random import randint from random import shuffle from ma...
nandadeepd/string-matching
match-algorithms/driver.py
driver.py
py
3,621
python
en
code
1
github-code
97
[ { "api_name": "matplotlib.pyplot.scatter", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 25, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.xlabel", "line_number": 26, "usage_type": "call" }, { "api_name": "...
43945591138
import typing import boto3 iot_client = boto3.client('iot') def describe_thing(thing_name: str) -> dict: thing = iot_client.describe_thing(thingName=thing_name) thing.pop('ResponseMetadata', None) return thing def list_things_in_thing_group(thing_group_name: str, callback: typing.Callable[[str], None]...
nelsestu/thing-expert
cloud/src/baseline_cloud/core/aws/iot.py
iot.py
py
1,332
python
en
code
2
github-code
97
[ { "api_name": "boto3.client", "line_number": 5, "usage_type": "call" }, { "api_name": "typing.Callable", "line_number": 14, "usage_type": "attribute" }, { "api_name": "typing.List", "line_number": 33, "usage_type": "attribute" } ]
25616307732
# coding: utf-8 """ The functions below use OpenCV functions to detect edges in a given frame. Sources: - cv2.equalizeHist: improve the contrast of the frame https://docs.opencv.org/3.2.0/d5/daf/tutorial_py_histogram_equalization.html - cv2.Canny: edge detection. https://docs.opencv.org/3.3.1/da/d22/tutorial_...
thayerAlshaabi/DeepEye
src/lane_detector/graphic_utils.py
graphic_utils.py
py
5,620
python
en
code
23
github-code
97
[ { "api_name": "numpy.array", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 35, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 38, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HSV", "line_nu...
2231968261
import json import pytest from model_bakery import baker from rest_framework import status from usaspending_api.accounts.models import TreasuryAppropriationAccount from usaspending_api.common.tests.autocomplete import check_autocomplete @pytest.fixture def tas_data(db): baker.make(TreasuryAppropriationAccount, ...
fedspendingtransparency/usaspending-api
usaspending_api/accounts/tests/integration/test_tas_autocomplete.py
test_tas_autocomplete.py
py
1,784
python
en
code
265
github-code
97
[ { "api_name": "model_bakery.baker.make", "line_number": 13, "usage_type": "call" }, { "api_name": "usaspending_api.accounts.models.TreasuryAppropriationAccount", "line_number": 13, "usage_type": "argument" }, { "api_name": "model_bakery.baker", "line_number": 13, "usage_t...
28240071901
import numpy as np from flask import Flask, request, jsonify, render_template import joblib # Use joblib for model loading app = Flask(__name__) model = joblib.load('model.pkl') # Load the trained model @app.route('/') def home(): return render_template('index.html') @app.route('/predict', methods=['POST']) de...
MayurGholap-4212/Deployed-ML-Model-for-Diabetes-Prediction
app.py
app.py
py
2,642
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "joblib.load", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.form", ...
72789459518
import torch import seaborn as sns import pandas as pd from sklearn.metrics import confusion_matrix import torchaudio from dataset import audioDataset from train import SAMPLE_RATE, NUM_SAMPLES from sklearn.metrics import (ConfusionMatrixDisplay, classification_report, confusion_matrix) im...
arttuhaverinen/torch-cnn-audio-classification
test.py
test.py
py
4,520
python
en
code
0
github-code
97
[ { "api_name": "train.NUM_SAMPLES", "line_number": 13, "usage_type": "name" }, { "api_name": "train.SAMPLE_RATE", "line_number": 14, "usage_type": "name" }, { "api_name": "torch.no_grad", "line_number": 40, "usage_type": "call" }, { "api_name": "torch.cuda.is_avail...
12887327265
from django.shortcuts import render from apps.produtos.models import ( Produtos, MovimentacaoProdutos, MediaProduto ) from django.http import JsonResponse from apps.datatable.datatable import DataTableFilter, DataTableRaw from django.contrib.auth.decorators import login_required @login_required(login_url='...
hiagobury-hash/wmarket
apps/produtos/views.py
views.py
py
9,072
python
pt
code
0
github-code
97
[ { "api_name": "django.shortcuts.render", "line_number": 13, "usage_type": "call" }, { "api_name": "django.contrib.auth.decorators.login_required", "line_number": 11, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 18, "usage_type": "call" ...
32503517419
import matplotlib.pyplot as plt import matplotlib.style import csv import numpy as np import pandas as pd import glob import math import re matplotlib.style.use('ggplot') class PlotStatistics: def __init__(self): pass def plotReward(self, pathToCSV, numMovAvg): data = pd.re...
mikkellars/pyludo
PlotStatistics.py
PlotStatistics.py
py
6,583
python
en
code
0
github-code
97
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 11, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 11, "usage_type": "name" }, { "api_na...
20821495713
import logging from src.common.contracts import keeper_contract from src.common.execution import check_gas_price from src.common.ipfs import fetch_harvest_params from src.common.tasks import BaseTask from src.config.settings import settings from src.harvest.execution import submit_harvest_transaction logger = logging...
stakewise/v3-operator
src/harvest/tasks.py
tasks.py
py
1,249
python
en
code
16
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "src.common.tasks.BaseTask", "line_number": 13, "usage_type": "name" }, { "api_name": "src.common.contracts.keeper_contract.can_harvest", "line_number": 16, "usage_type": "call" ...
29367332537
import os import pathlib from wand.image import Image as Wim from spinorama import logger def write_multiformat(chart, filename, force): """Write a png file and then convert and save to jpg and webp""" if not pathlib.Path(filename).is_file() or force: chart.write_image(filename) if os.path.getsi...
pierreaubert/spinorama
src/spinorama/pict.py
pict.py
py
880
python
en
code
72
github-code
97
[ { "api_name": "pathlib.Path", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.getsize", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "spinorama.logger.warning", ...
37004527647
''' Tools to calculate thermal simulations for LIFU experiments ABOUT: author - Samuel Pichardo date - June 23, 2021 last update - Nov 27, 2021 ''' import numpy as np import matplotlib.pyplot as plt from scipy.io import loadmat,savemat from BabelViscoFDTD.tools.RayleighAndBHTE impor...
ProteusMRIgHIFU/BabelBrain
IntegrationBrainsightUC/CalculateTemperatureEffects.py
CalculateTemperatureEffects.py
py
12,716
python
en
code
8
github-code
97
[ { "api_name": "platform.platform", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 41, "usage_type": "call" }, { "api_name": "BabelViscoFDTD.H5pySimple.ReadFromH5py", "line_number": 46, "usage_type": "call" }, { "api_name"...
21805339040
from sklearn import ensemble, preprocessing from linear_regression_try1 import get_error, get_data, get_some_columns def main(): print('working ...') # ############################################################################# # Load data train_df, test_df = get_data() y_train = train_df['tri...
r2apu/Data_mining_coursework_repo
code/gradient_boosting.py
gradient_boosting.py
py
1,401
python
en
code
0
github-code
97
[ { "api_name": "linear_regression_try1.get_data", "line_number": 10, "usage_type": "call" }, { "api_name": "linear_regression_try1.get_some_columns", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 26, "usage_...
70648066878
from sqlalchemy import create_engine, event from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from sqlite3 import Connection as SQLite3Connection __author__ = 'Alex Haslehurst' class MediaContext: Base = declarative_base() def __init__(self, connection_string, e...
axle-h/media-persist
axh/media/persist/context.py
context.py
py
1,025
python
en
code
0
github-code
97
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlalchemy.create_engine", "line_number": 13, "usage_type": "call" }, { "api_name": "sqlalchemy.event.listen", "line_number": 14, "usage_type": "call" ...
36658978309
from shapely.geometry import LineString, Point, Polygon import math def social_distance(frame_shape, a, b, c, d, min_iter=3, min_w=None, max_w=None): h, w = frame_shape A, B ,C ,D = Point(a), Point(b), Point(c), Point(d) AB = get_line(A, B) CD = get_line(C, D) COEF = 1 minx = A.x if A.x < C....
intel-iot-devkit/social-distance
libs/geodist.py
geodist.py
py
7,136
python
en
code
12
github-code
97
[ { "api_name": "shapely.geometry.Point", "line_number": 7, "usage_type": "call" }, { "api_name": "shapely.geometry.Point", "line_number": 33, "usage_type": "call" }, { "api_name": "shapely.geometry.Point", "line_number": 36, "usage_type": "call" }, { "api_name": "s...
24073186546
import os import sys from pathlib import Path sys.path.append(os.path.abspath(Path(os.getcwd()) / "..")) from flask import request, jsonify from flask_cors import cross_origin from . import device from crud.device import get_device, create_device, update_device, delete_device @device.route('/create_device', methods=["...
carlostrevisan1/IOT-Dashboard
back/app/device/views.py
views.py
py
1,910
python
en
code
1
github-code
97
[ { "api_name": "sys.path.append", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number...
35094955773
# Samujjwaal Dey # Python Script to implement vector space model # load dependency libraries import math import os import copy import re from nltk.corpus import stopwords from collections import Counter from nltk.stem import PorterStemmer import pickle # number of webpages indexed N = 6001 # extracting english stop...
samujjwaal/uic-search-engine
search_query.py
search_query.py
py
5,398
python
en
code
1
github-code
97
[ { "api_name": "nltk.corpus.stopwords.words", "line_number": 19, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 19, "usage_type": "name" }, { "api_name": "nltk.stem.PorterStemmer", "line_number": 22, "usage_type": "call" }, { "api_nam...
9542508667
import asyncio from datetime import datetime, timedelta import numpy as np import pandas_market_calendars as mcal # Create a calendar from pandas import DatetimeIndex # nyse = mcal.get_calendar('NYSE') # holidays = nyse.holidays() # dt2021 = np.datetime64(datetime(2021,1 ,1)) # for holiday in holidays.holidays: # ...
PGAndre/InvestAnalytics_bot
tgbot/misc/bdays.py
bdays.py
py
1,856
python
en
code
1
github-code
97
[ { "api_name": "pandas_market_calendars.get_calendar", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.datetime64", "line_number": 29, "usage_type": "call" }, { "api_name...
38095551250
import sqlite3 from datetime import datetime from dateutil.relativedelta import relativedelta def get_db_connection(): conn = sqlite3.connect('expense_tracker.db') conn.row_factory = sqlite3.Row return conn user_id = 1 with get_db_connection() as conn: data = conn.execute("SELECT expenses.name, expens...
bluetude/expense_tracker
test.py
test.py
py
1,034
python
en
code
0
github-code
97
[ { "api_name": "sqlite3.connect", "line_number": 6, "usage_type": "call" }, { "api_name": "sqlite3.Row", "line_number": 7, "usage_type": "attribute" }, { "api_name": "datetime.datetime.today", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datet...
12843103661
from collections import deque def getEnergy(e, result): global M if len(e) == 2: # print(result) if M < result: M = result return 0 for i in range(1, len(e)-1): c = e.copy() result += c[i-1]*c[i+1] del c[i] # print(c) # print(resul...
jokh0108/study-algorithm
practice/baekjoon/baekjoon-16198.py
baekjoon-16198.py
py
651
python
en
code
0
github-code
97
[ { "api_name": "collections.deque", "line_number": 20, "usage_type": "call" } ]
38227560304
import bpy import random from math import sqrt L1=[] #hold list L2=[] #main list BallNumber=40 for i in range(3): x=random.randrange(0,16) L2.append(x) while len(L2) < 3*BallNumber: for i in range(3): #coordinates x=random.randrange(0,16) L1.append(x) for i in rang...
batuhantosn/100Balls_for_Blender
100balls.py
100balls.py
py
790
python
en
code
1
github-code
97
[ { "api_name": "random.randrange", "line_number": 11, "usage_type": "call" }, { "api_name": "random.randrange", "line_number": 18, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 25, "usage_type": "call" }, { "api_name": "bpy.ops.mesh.primitive_uv...
26146194689
import torch from torch.distributions.categorical import Categorical import torch.nn as nn import numpy as np from edm.egnn.models import EGNN_dynamics from edm.equivariant_diffusion.en_diffusion import EnVariationalDiffusion from edm.egnn.egnn_new import EGNN, GNN from edm.equivariant_diffusion.utils import remove_me...
tomer196/GaUDI
models_edm.py
models_edm.py
py
7,732
python
en
code
2
github-code
97
[ { "api_name": "torch.nn.DataParallel", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "utils.helpers.analyzed_rings", "line_number": 23, "usage_type": "name" }, { "api_name": "torc...
26684549806
import time import requests def main(): now = int(time.time()) * 1000 while now > 0: print(now) r = requests.get("http://127.0.0.1:8000/chain/blocks/{}".format(now)) print(r.json()) now -= 24 * 60 * 60 * 1000 main()
lingyong/pupu_block
script.py
script.py
py
272
python
en
code
1
github-code
97
[ { "api_name": "time.time", "line_number": 6, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 10, "usage_type": "call" } ]
75014960317
# import views import requests import json import ast # from Management.real_time_data.writeLogs import logsWrite from datetime import date class Bonanza_API_RESPONSE: def __init__(self,apiClientId, accessToken, strategy, name, trading_symbol, broker): execution_date = date.today() # logs = logsWr...
Algoptions/Website_Streaming_Real_Time
bonanza_api_response.py
bonanza_api_response.py
py
15,801
python
en
code
0
github-code
97
[ { "api_name": "datetime.date.today", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 11, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 63, "usage_type": "call" }, { "api_name": "ast.literal_eval", ...
70224080319
from setuptools import setup from setuptools import find_packages import subprocess import os # gst_remote_version = ( # subprocess.run(["git", "describe", "--tags"], stdout=subprocess.PIPE) # .stdout.decode("utf-8") # .strip() # ) # if "-" in gst_remote_version: # # when not on tag, git describe outp...
tomytw/gst-calculation
setup.py
setup.py
py
1,664
python
en
code
0
github-code
97
[ { "api_name": "setuptools.setup", "line_number": 32, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 41, "usage_type": "call" } ]
11576180871
#!/usr/bin/env python # -*- coding:utf-8 -*- import _env import re from async_spider import AsySpider from bs4 import BeautifulSoup from lib._db import get_collection from tornado import gen from config.config import CONFIG from html2text import html2text DB = CONFIG.MONGO.DATABASE class CategorySpider(AsySpider): ...
PegasusWang/pyhome
crawler/ahlinux/ahlinux.py
ahlinux.py
py
2,712
python
en
code
8
github-code
97
[ { "api_name": "config.config.CONFIG.MONGO", "line_number": 12, "usage_type": "attribute" }, { "api_name": "config.config.CONFIG", "line_number": 12, "usage_type": "name" }, { "api_name": "async_spider.AsySpider", "line_number": 15, "usage_type": "name" }, { "api_n...
29398178733
import json import time from spiderfoot import SpiderFootEvent, SpiderFootPlugin class sfp_hybrid_analysis(SpiderFootPlugin): meta = { 'name': "Hybrid Analysis", 'summary': "Search Hybrid Analysis for domains and URLs related to the target.", 'flags': ["apikey"], 'useCases': ["Fo...
smicallef/spiderfoot
modules/sfp_hybrid_analysis.py
sfp_hybrid_analysis.py
py
8,938
python
en
code
10,704
github-code
97
[ { "api_name": "spiderfoot.SpiderFootPlugin", "line_number": 7, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 92, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 121, "usage_type": "call" }, { "api_name": "time.sleep", "l...
11731896980
import datetime import re import htmlentitydefs import urllib from pyramid.security import authenticated_userid from pyramid.traversal import resource_path from repoze.lemonade.content import create_content from karl.models.interfaces import IContainerVersion from karl.models.interfaces import IObjectVersion from rep...
karlproject/karl
karl/content/models/wiki.py
wiki.py
py
7,940
python
en
code
48
github-code
97
[ { "api_name": "re.compile", "line_number": 25, "usage_type": "call" }, { "api_name": "repoze.folder.Folder", "line_number": 35, "usage_type": "name" }, { "api_name": "zope.interface.implements", "line_number": 36, "usage_type": "call" }, { "api_name": "karl.conten...
8588572797
import os from discord.ext import commands from dotenv import load_dotenv import core import numpy as np import datetime load_dotenv() TOKEN = os.getenv('DISCORD_TOKEN') class CustomBot(commands.Bot): def __init__(self): """ CustomClient constructor. Serves to initialize the command prefix. ...
Shrecki/Polling-Bot
bot.py
bot.py
py
9,541
python
en
code
0
github-code
97
[ { "api_name": "dotenv.load_dotenv", "line_number": 8, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 9, "usage_type": "call" }, { "api_name": "discord.ext.commands.Bot", "line_number": 12, "usage_type": "attribute" }, { "api_name": "discord.ext....
74104373119
import re import sys import argparse import subprocess DOT_CMD = 'dot' def pd2dot(pd): connections = [] index = 0 out = ['digraph _ {'] for line in pd.splitlines(): if line.startswith('#X connect'): parts = line.split() a = parts[2] b = parts[4] connections.append((a, b)) out.append(f' {b} -> {...
xi/xipd
xipd/format.py
format.py
py
1,773
python
en
code
1
github-code
97
[ { "api_name": "re.match", "line_number": 31, "usage_type": "call" }, { "api_name": "subprocess.run", "line_number": 58, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 69, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", ...
25892837045
''' This file takes all the excel files ending in '.xls' from it's parent directory and copy/pastes values in column B of each file to remove the formulas so it can be uploaded to the small package file upload on the Portal. ''' import xlwings as xw import os def get_file_list(): path = os.path...
egood13/Python
rs_xlformatter.py
rs_xlformatter.py
py
1,279
python
en
code
0
github-code
97
[ { "api_name": "os.path.abspath", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 18, "usage_type": "call" }, { "api_name": "xlwings.Range", "line_num...
8282413103
import numpy as np import pandas as pd from sklearn.decomposition import PCA from sklearn.metrics import classification_report, confusion_matrix from sklearn.pipeline import make_pipeline from sklearn.svm import SVC from sklearn.model_selection import GridSearchCV, validation_curve from sklearn.model_selection import t...
ds5110/faces
src/zw_svc_landmarks.py
zw_svc_landmarks.py
py
5,571
python
en
code
3
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 17, "usage_type": "call" }, { "api_name": "sklearn.decomposition.PCA", "line_number": 22, "usage_type": "call" }, { ...
23942662315
# config/database.py from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker Base = declarative_base() # Base de datos sql relacional - ubicaciones engine_ubicaciones = create_engine('sqlite:///db/ubicaciones.db') session_ubicaciones = sessio...
pepeul1191/gestion-swp
config/database.py
database.py
py
570
python
es
code
0
github-code
97
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 6, "usage_type": "call" }, { "api_name": "sqlalchemy.create_engine", "line_number": 8, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.sessionmaker", "line_number": 9, "usage_type": "call" ...
5389963701
import os import time import math import imaplib import email from bs4 import BeautifulSoup import urllib from urllib.request import urlopen import re import parser import json from datetime import datetime import os import requests from dotenv import dotenv_values from mailer import sendEmail import mysql.connector fr...
brown-bytes/brown-bytes-v2
scraper/scraper.py
scraper.py
py
7,409
python
en
code
2
github-code
97
[ { "api_name": "dotenv.dotenv_values", "line_number": 21, "usage_type": "call" }, { "api_name": "mysql.connector.connector.connect", "line_number": 57, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 57, "usage_type": "attribute" }, { ...
40070342120
from tensorflow.examples.tutorials.mnist import input_data from scipy.misc import imshow import tensorflow as tf import numpy as np mnist = input_data.read_data_sets('MNIST_data', one_hot=True) sess = tf.InteractiveSession() x = tf.placeholder(tf.float32, shape=[None, 784]) y_ = tf.placeholder(tf.float32, shape=[None...
vernwalrahul/Learning_Tensorflow
predict_digit.py
predict_digit.py
py
1,257
python
en
code
0
github-code
97
[ { "api_name": "tensorflow.examples.tutorials.mnist.input_data.read_data_sets", "line_number": 6, "usage_type": "call" }, { "api_name": "tensorflow.examples.tutorials.mnist.input_data", "line_number": 6, "usage_type": "name" }, { "api_name": "tensorflow.InteractiveSession", "l...
26867762942
import re, sys import ReDebug from PyQt5.QtWidgets import (QApplication, QWidget,) from PyQt5.QtGui import QIcon class Ui_main(QWidget, ReDebug.Ui_Form): def __init__(self): super().__init__() self.setupUi(self) self.initialize() def initialize(self): self.signal_binding() # 进...
XwAdmin/CodeTest
Python_QT/正则调试工具/re_main.pyw
re_main.pyw
pyw
3,710
python
en
code
1
github-code
97
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 7, "usage_type": "name" }, { "api_name": "ReDebug.Ui_Form", "line_number": 7, "usage_type": "attribute" }, { "api_name": "PyQt5.QtGui.QIcon", "line_number": 16, "usage_type": "call" }, { "api_name": "re.sub",...
14089872937
""" Challenges API resources """ import random from flask import url_for, Response, request from flask_apispec import MethodResource, doc from flask_login import login_required, current_user from flask_restful import Resource, abort from sqlalchemy.orm import load_only, joinedload from werkzeug import exceptions from...
narcosita/pyxword-contest
pyxword_contest/contest/resources/challenges.py
challenges.py
py
4,507
python
en
code
0
github-code
97
[ { "api_name": "flask_restful.Resource", "line_number": 28, "usage_type": "name" }, { "api_name": "flask_apispec.MethodResource", "line_number": 28, "usage_type": "name" }, { "api_name": "flask_login.login_required", "line_number": 30, "usage_type": "name" }, { "ap...
20681526978
import matplotlib.pyplot as plt import seaborn as sns import matplotlib as mpl import numpy as np from six import string_types def contour_plot(x, y, z, shade=False, legend=True, shade_lowest=True, cbar=False, cbar_ax=None, cbar_kws=None, ax=None, **kwargs): """Plot a contour. Parameters ...
PrasadBabarendaGamage/vis
vis/seaborn.py
seaborn.py
py
5,308
python
en
code
0
github-code
97
[ { "api_name": "matplotlib.pyplot.gca", "line_number": 110, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 110, "usage_type": "name" }, { "api_name": "numpy.asarray", "line_number": 113, "usage_type": "call" }, { "api_name": "numpy.float6...
14209577938
import msal import requests import pandas as pd from pathlib import Path def get_access_token(): app_id = '*********************************************' pbi_tenant_id = '*********************************************' app_secret = '*********************************************' authority_url...
SharmaAntriksh/Power-BI-Automation
Python/Refresh History.py
Refresh History.py
py
4,153
python
en
code
1
github-code
97
[ { "api_name": "msal.ConfidentialClientApplication", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 34, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 57, "usage_type": "call" }, { "api_name": "requests...
28419788108
import random import pygame import words def main(): width, height = 435, 570 pygame.init() surface = pygame.display.set_mode((width, height)) pygame.display.set_caption('Wordle Clone') game = Game(surface) game.play() pygame.quit() class Game(): def __init__(self, su...
FaiyadRahman/WordleClone
wordle.py
wordle.py
py
3,613
python
en
code
0
github-code
97
[ { "api_name": "pygame.init", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pygame.display.s...
74582375679
import requests from bs4 import BeautifulSoup as bs import pandas as pd from time import sleep from selenium import webdriver url = 'https://www.usquidditch.org/teams' #open selenium - use your own info for PATH PATH = (r"C:\\Users\\Gustavo\\Desktop\\scoutfy\\Team USA\\chromedriver.exe") driver = webd...
gustavo1046/WebCrawler---Python
mining.py
mining.py
py
2,893
python
en
code
0
github-code
97
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 14, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 14, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 20, "usage_type": "call" }, { "api_name": "bs4.Beautiful...
10755593682
#!/usr/bin/env python3 """ SfM point filtering """ import sys import time import numpy import glob from termcolor import colored import pylab as plt from PointFiltering import LazData, VegetationIndices, Filter, Grid, PlotTools from PointFiltering.Helpers import saveimg, savergb def run(filter, **kwargs): """ Run...
niels-anders/sfm-point-filtering
main.py
main.py
py
7,245
python
en
code
2
github-code
97
[ { "api_name": "PointFiltering.Filter.FILTERS", "line_number": 40, "usage_type": "attribute" }, { "api_name": "PointFiltering.Filter", "line_number": 40, "usage_type": "name" }, { "api_name": "glob.glob", "line_number": 47, "usage_type": "call" }, { "api_name": "Po...
8065332827
import requests from bs4 import BeautifulSoup import pandas as pd url = 'https://exame.com/brasil/as-50-melhores-escolas-de-cada-estado-do-brasil-no-enem/' response = requests.get(url) soup = BeautifulSoup(response.content, 'html.parser') table = soup.find('table') data = [] for row in table.find_all('t...
Renan1404/Trabalho-ciencia-de-dados-P1-da-Alessandra
Raspagem das 5 melhores escolas do país.py
Raspagem das 5 melhores escolas do país.py
py
695
python
en
code
0
github-code
97
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 21, "usage_type": "call" } ]
33444484807
import math import tensorflow as tf import tensorflow_datasets as tfds import matplotlib.pyplot as plt def plot_image_examples(images : tf.Tensor, n=9): rows = int(math.sqrt(n)) fig, axs = plt.subplots(rows, math.ceil(n / rows)) for i in range(n): axs[i // rows, i % rows].imshow(images[i], cmap="g...
Henrbfe/tdt05-miniproject
src/visualisations.py
visualisations.py
py
709
python
en
code
0
github-code
97
[ { "api_name": "tensorflow.Tensor", "line_number": 7, "usage_type": "attribute" }, { "api_name": "math.sqrt", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.p...
23732834332
#--------------------------------------------------------------- # # This script contains the functions to # receive a new pattern and modify # according the existent rule base. # # To avoid unnecessary processing, # the function " intersected_connected_sets " # find which of the original connected sets # ...
ivan-paz/InferenceRules
new_instance.py
new_instance.py
py
8,483
python
en
code
1
github-code
97
[ { "api_name": "json.load", "line_number": 31, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 149, "usage_type": "call" } ]
622546647
# Name: Gerardo Palacios # Date: 11/26/2020 # Honor Statement: I have not given or received any unauthorized assistance on this assignment # YouTube Link: https://youtu.be/DXaabepMEvw import random import numpy as np import pandas as pd import matplotlib.pyplot as plt class SixSidedDie: """A simulation of a six...
gpala7077/Simulation_Analysis
BattleForCrymland.py
BattleForCrymland.py
py
24,182
python
en
code
0
github-code
97
[ { "api_name": "random.randint", "line_number": 30, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 80, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 92, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
15454114501
import json import logging import boto3 from abc import ABC, abstractmethod from django.conf import settings logger = logging.getLogger(__name__) class AWSBatchClient(ABC): def __init__(self): self.client = boto3.client("batch", region_name=settings.AWS_REGION_NAME) @abstractmethod def ge...
NREL/engage
calliope_app/batch/managers.py
managers.py
py
2,703
python
en
code
3
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "abc.ABC", "line_number": 11, "usage_type": "name" }, { "api_name": "boto3.client", "line_number": 14, "usage_type": "call" }, { "api_name": "django.conf.settings.AWS_REGION...
39699759691
from django.shortcuts import render, redirect from .models import Book, Author def index(request): context = { "books_table" : Book.objects.all() } return render(request, 'books_authors_app/addbook.html', context) def add_book(request): if request.method == 'POST': Book.objects...
codingdojotulsajanuary2019/michael_s
python_stack/django/django_orm/books_authors_proj/apps/books_authors_app/views.py
views.py
py
2,660
python
en
code
0
github-code
97
[ { "api_name": "models.Book.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "models.Book.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "models.Book", "line_number": 8, "usage_type": "name" }, { "api_name": "django.shor...
22111842934
""" https://leetcode.com/problems/cousins-in-binary-tree/ """ from typing import Optional from utils import TreeNode class Solution: def isCousins(self, root: Optional[TreeNode], x: int, y: int) -> bool: level = [root] while True: newLevel = [] vals = set() ...
kangxie-colorado/leetcode-and-notes
previous_run/281.993.cousinsInBinaryTree.py
281.993.cousinsInBinaryTree.py
py
1,606
python
en
code
0
github-code
97
[ { "api_name": "typing.Optional", "line_number": 14, "usage_type": "name" }, { "api_name": "utils.TreeNode", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 40, "usage_type": "name" }, { "api_name": "utils.TreeNode", "...
29511008052
from django import template from django.utils.safestring import mark_safe from django.utils.html import format_html from django.utils.safestring import mark_safe from django.contrib.staticfiles.storage import staticfiles_storage register = template.Library() @register.simple_tag def vertical_bar(value, max_value, d...
gpodder/mygpo
mygpo/web/templatetags/charts.py
charts.py
py
2,330
python
en
code
257
github-code
97
[ { "api_name": "django.template.Library", "line_number": 8, "usage_type": "call" }, { "api_name": "django.template", "line_number": 8, "usage_type": "name" }, { "api_name": "django.utils.html.format_html", "line_number": 30, "usage_type": "call" }, { "api_name": "d...
73029823999
#! -*- coding:utf-8 -*- import re import gc import codecs import random import warnings import pandas as pd from sklearn.metrics import f1_score from nltk.metrics.distance import jaccard_distance from sklearn.model_selection import StratifiedKFold from keras.layers import * from keras.callbacks import * f...
rebornZH/2019-CCF-BDCI-NLP
baseline.py
baseline.py
py
8,905
python
en
code
113
github-code
97
[ { "api_name": "keras.backend.tensorflow_backend.set_session", "line_number": 25, "usage_type": "call" }, { "api_name": "re.split", "line_number": 41, "usage_type": "call" }, { "api_name": "keras_bert.Tokenizer", "line_number": 55, "usage_type": "name" }, { "api_na...
74950309757
import discord import time import asyncio import traceback import aiohttp import aiofiles import math import humecord from humecord.utils import ( dateutils, discordutils, hcutils, miscutils, components ) class DevCommand: def __init__(self): self.name = "dev" self.descriptio...
humeman/humecord
humecord/trash/msg_commands/_dev.py
_dev.py
py
41,529
python
en
code
0
github-code
97
[ { "api_name": "humecord.utils.exceptions.TestException", "line_number": 80, "usage_type": "call" }, { "api_name": "humecord.utils", "line_number": 80, "usage_type": "attribute" }, { "api_name": "humecord.utils.discordutils.create_embed", "line_number": 90, "usage_type": "...
72612454078
import sys sys.path.append("E:\PythonGUI-ManageEmployee\Pyqt5") from PyQt5.QtWebEngineWidgets import QWebEngineView from Algorithm.Cluster.Brute_Force import Brute_Force_Cluster from Algorithm.Cluster.Randomized_Tour import Randomized_Tour_Cluster from Process_Data.PyQT5_ProcessData import Process_Data_Small from Proc...
NguyenKhoaTruong/tms
Map_/PyQT5_Map_Cluster.py
PyQT5_Map_Cluster.py
py
10,817
python
en
code
0
github-code
97
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "dotenv.load_dotenv", "line_number": 32, "usage_type": "call" }, { "api_name": "os.getenv", "line_...