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
43297874105
# -*- coding: utf-8 -*- """ Created on Mon Feb 17 16:10:16 2020 @author: Marko """ import numpy as np import pandas as pd #import matplotlib.pyplot as plt #from collections import Counter from unidecode import unidecode import os def choose_gw(): df = pd.read_csv("GLK.csv") names = df.column...
markokad/fpl-genetic
combine_id.py
combine_id.py
py
6,190
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 40, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 41, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
24779758119
""" Script for blob detection originaly inspired by http://www.learnopencv.com/blob-detection-using-opencv-python-c/ at 13th of Juny 2015 Now it returns clusterBuster relics and hsitogramms """ # Standard imports import numpy as np import cv2 #import pyfits as fits #import scipy.ndimage.morphology as morp #mor...
jakgel/clusterbuster
clusterbuster/sourceextraction.py
sourceextraction.py
py
5,118
python
en
code
2
github-code
97
[ { "api_name": "clusterbuster.surveyclasses.Galaxycluster", "line_number": 26, "usage_type": "call" }, { "api_name": "clusterbuster.surveyclasses", "line_number": 26, "usage_type": "name" }, { "api_name": "clusterbuster.surveyclasses.DetInfo", "line_number": 28, "usage_typ...
33815852749
#-*-coding:utf8-*- from appium import webdriver import time class WechatTest(): def __init__(self): desired_caps = {} desired_caps['platformName'] = 'Android' desired_caps['platformVersion'] ='4.4.2' desired_caps['deviceName']='Android Emulator' desired_caps['appPackage']='c...
Trrinity/Selenium-Appium
com.taobao.taobao.py
com.taobao.taobao.py
py
1,523
python
en
code
0
github-code
97
[ { "api_name": "appium.webdriver.Remote", "line_number": 13, "usage_type": "call" }, { "api_name": "appium.webdriver", "line_number": 13, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 16, "usage_type": "call" }, { "api_name": "time.sleep", ...
38339321818
import logging from typing import Callable import pcapi.connectors.notion as notion_connector from pcapi.core.providers.models import VenueProvider import pcapi.core.providers.repository as providers_repository import pcapi.local_providers from pcapi.local_providers.provider_api import synchronize_provider_api from pc...
bruno-ebstein-pass-culture/pass-culture-main
api/src/pcapi/local_providers/provider_manager.py
provider_manager.py
py
3,166
python
en
code
null
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "pcapi.scheduled_tasks.logger.build_cron_log_message", "line_number": 23, "usage_type": "call" }, { "api_name": "pcapi.scheduled_tasks.logger.CronStatus.FAILED", "line_number": 23, ...
21643801764
""" Given an array of intervals where intervals[i] = [start, end], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input. """ from collections import deque def merge(intervals: list[list[int]]) -> list[list[int]]: intervals = sorted(interv...
Sma-Das/Leetcode
2-Medium/mergeIntervals.py
mergeIntervals.py
py
850
python
en
code
0
github-code
97
[ { "api_name": "collections.deque", "line_number": 12, "usage_type": "call" } ]
30945730389
"""chat_settings Revision ID: 20190314182214 Revises: 20190314175025 Create Date: 2019-03-14 18:22:14.635279 """ import sqlalchemy as sa from alembic import op from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm.session import Session # revision identifiers, used by Alembic. revision = "2019...
llybin/TelegramExchangeRatesBot
migrations/versions/20190314182214_chat_settings.py
20190314182214_chat_settings.py
py
1,660
python
en
code
15
github-code
97
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 20, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 26, "usage_type": "call" }, { "api_name": "sqlalchemy.BigInteger", "line_number": 26, "usage_type": "attribute" }, ...
34913205932
import logging from typing import Any, Tuple from linotp.lib.policy.evaluate import PolicyEvaluator from linotp.lib.policy.util import get_policies from linotp.lib.user import User LOG = logging.getLogger(__name__) def search_policy(param, only_active=True): """ Function to retrieve the list of policies. ...
LinOTP/LinOTP
linotp/lib/policy/processing.py
processing.py
py
6,936
python
en
code
484
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "linotp.lib.policy.evaluate.PolicyEvaluator", "line_number": 32, "usage_type": "call" }, { "api_name": "linotp.lib.policy.util.get_policies", "line_number": 32, "usage_type": "call"...
8282986071
#! /usr/bin/env python """This module simply adds miscellaneous code that the main modules can use.""" from __future__ import absolute_import import logging import requests from mozci.utils.authentication import get_credentials LOG = logging.getLogger('mozci') def _public_url(url): """ If we run the script...
gijsk/mozilla_ci_tools
mozci/utils/misc.py
misc.py
py
1,353
python
en
code
null
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "requests.head", "line_number": 37, "usage_type": "call" }, { "api_name": "mozci.utils.authentication.get_credentials", "line_number": 37, "usage_type": "call" } ]
1098969886
import atexit import io import sys def getParent(x): return (x - 1) // 2 def leftChild(x): return (2 * x + 1) if (2 * x + 1) < curr_size else -1 def rightChild(x): return (2 * x + 2) if (2 * x + 2) < curr_size else -1 def heapify(): curr_ind = curr_size - 1 while getParent(curr_ind) != -1 an...
Sameer2898/Data-Structure-And-Algorithims
Placement Prepration/Heap/binary_heap_operations.py
binary_heap_operations.py
py
2,811
python
en
code
0
github-code
97
[ { "api_name": "sys.stdin.read", "line_number": 69, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 69, "usage_type": "attribute" }, { "api_name": "io.StringIO", "line_number": 71, "usage_type": "call" }, { "api_name": "sys.stdout", "line_numb...
7175045013
import RPi.GPIO as GPIO import time from mfrc522 import SimpleMFRC522 from datetime import datetime, time as dt_time # Set the GPIO mode GPIO.setmode(GPIO.BOARD) # Define the motor driver pins for the stepper motor motor_pins = [13, 11, 15, 12] # Set the motor pins as output for pin in motor_pins: G...
goutham260702/medication_monitoring
medi.py
medi.py
py
3,871
python
en
code
0
github-code
97
[ { "api_name": "RPi.GPIO.setmode", "line_number": 7, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 7, "usage_type": "name" }, { "api_name": "RPi.GPIO.BOARD", "line_number": 7, "usage_type": "attribute" }, { "api_name": "RPi.GPIO.setup", "line...
34848979532
import calendar from datetime import date from django.contrib import admin from django.db.models import Sum, Count from django.utils.html import format_html from django.utils.html import mark_safe from .forms import StudentFeeAdd from .models import Student, StudentFee, FeeGroup, FeeType#, FeeSummary # Register your...
mujeebishaque/university-management-system
students/admin.py
admin.py
py
6,171
python
en
code
1
github-code
97
[ { "api_name": "django.contrib.admin.site.register", "line_number": 13, "usage_type": "call" }, { "api_name": "models.FeeGroup", "line_number": 13, "usage_type": "argument" }, { "api_name": "django.contrib.admin.site", "line_number": 13, "usage_type": "attribute" }, { ...
1429877464
def data(read_data,file): if read_data is True: #Reading system information from scripts.readData import data_file print('Reading data...') data_file('datasystem/'+str(file)+'.xlsx') # delete temporal files def data_consistency(stages, seriesBack, seriesForw): ...
maep-tools/maep-backend
storage/app/templates/1/python/scripts/main_model.py
main_model.py
py
7,778
python
en
code
1
github-code
97
[ { "api_name": "scripts.readData.data_file", "line_number": 8, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 17, "usage_type": "call" }, { "api_name": "utils.paramvalidation.paramlimits", "line_number": 22, "usage_type": "call" }, { "api_name"...
27179598501
import logging from unittest import TestCase from Signage.src.google_street_view_etl import GoogleStreetViewEtl as GSVE import geopandas as gpd import numpy as np import random class TestGoogleStreetViewEtl(TestCase): @classmethod def _get_iter(cls): _st_shp = gpd.read_file( "/Users/sunghoo...
Streets-Data-Collaborative/groundwork-detection
Signage/test/test_googleStreetViewEtl.py
test_googleStreetViewEtl.py
py
2,909
python
en
code
2
github-code
97
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "name" }, { "api_name": "geopandas.read_file", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 17, "usage_type": "call" }, { "api_name": "geopandas.read_file...
18117015401
#coding=utf-8 # 05.16 교수요청사항 # 기존의 Search Engine 에서 했던것처럼 # 단어들을 lexical 단위에서 + 형태소 단위에서 # 구조가 아닌 단어들의 이치를 보고 하면 어떻게 되느냐에 대한 코드 작성 import operator import os from whoosh.index import create_in from whoosh.fields import * from whoosh.qparser import QueryParser from typing import List, TextIO,Dict import time '''________...
DevHyung/ETRI-wiseNLU
Whoosh/whoosh_Origin.py
whoosh_Origin.py
py
7,529
python
en
code
0
github-code
97
[ { "api_name": "typing.List", "line_number": 36, "usage_type": "name" }, { "api_name": "typing.TextIO", "line_number": 37, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 31, "usage_type": "name" }, { "api_name": "typing.List", "line_number"...
30147989370
""" BFS 1st group check visited add group 2nd+ group group -> check visited initial check visited add group if len(group) > 0: Calc 처음부터 말렸다. DFS BFS 중에 고민했고, BFS가 더 효율적으로 제거할 수 있을거라 생각했다. 근데, 생각보다 모든 Cell을 Search하는게 시간을 많이 잡아먹었다. 비효율적으로 Search 할 수 밖에 없다고 생각은 했는데, 바꾼 영역만을 다시 Search하는게 더 좋...
yongjin-shin/code_test
BFS/population_move.py
population_move.py
py
4,987
python
ko
code
0
github-code
97
[ { "api_name": "sys.stdin", "line_number": 29, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 77, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 121, "usage_type": "call" } ]
2323487448
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister from qiskit import Aer, execute from qiskit.extensions.quantum_initializer.initializer import Initialize import matplotlib.pyplot as plt import random import math '''Calculate QC''' def w(x): count=0 while x: count+=1 x&=(x-1...
Siyi-06/Quantum_Ling_Adder
n_bits_Quantum_Ling_Adder.py
n_bits_Quantum_Ling_Adder.py
py
13,677
python
en
code
0
github-code
97
[ { "api_name": "math.floor", "line_number": 16, "usage_type": "call" }, { "api_name": "math.log2", "line_number": 16, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 26, "usage_type": "call" }, { "api_name": "random.randint", "line_number...
29791314161
# auther:Liul8 # date:2020/7/27 15:01 # tools:PyCharm # Python:3.7.7 from flask import Flask, request, jsonify from pytesseract import pytesseract from PIL import Image import os import urllib.request app = Flask(__name__) ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg'} def allowed_file(filename): return '.' in file...
lucas234/tesseract-ocr-server
api.py
api.py
py
2,233
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 22, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 22, "usage_type": "name" }, { "api_name": "os.path.exists", "line_numbe...
17060267773
"""Management command for syncing requirements.""" from argparse import ArgumentParser from collections import defaultdict from logging import getLogger from typing import Any, Dict, List from django.core.mail import send_mail from django.core.management.base import BaseCommand from django.db.utils import IntegrityErr...
yunojuno-archive/django-package-monitor
package_monitor/management/commands/refresh_packages.py
refresh_packages.py
py
3,784
python
en
code
65
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "requirements.requirement.Requirement", "line_number": 21, "usage_type": "name" }, { "api_name": "models.PackageVersion", "line_number": 24, "usage_type": "call" }, { "api_...
31447964151
from typing import Tuple from neural import * from sklearn.model_selection import train_test_split import matplotlib.pyplot as plt import numpy as np def parse_line(line: str) -> Tuple[List[float], List[float]]: """Splits line of CSV into inputs and output (transormfing output as appropriate) Args: l...
LT-Intro-To-AI/assignment7-nadiapesch
main.py
main.py
py
3,289
python
en
code
0
github-code
97
[ { "api_name": "typing.Tuple", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 29, "usage_type": "name" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 67, "usage_type": "call" }, { "api_name": "mat...
38429366802
# All extension functions for SRW should be imported into this space # even if they're defined elsewhere. # Functions should modify extra*Data in place. # Add DOM node for serialization by ZSI. # Fr'ex: # object.extraFooData.append(r.fromString('<a:b c="d">e</a:b>')) # Configuration in SRW ZeeRex file should look l...
cheshire3/cheshire3
cheshire3/web/srwExtensions.py
srwExtensions.py
py
7,698
python
en
code
16
github-code
97
[ { "api_name": "xml.sax.saxutils", "line_number": 35, "usage_type": "name" }, { "api_name": "xml.sax.saxutils", "line_number": 36, "usage_type": "argument" }, { "api_name": "lxml.builder.ElementMaker", "line_number": 45, "usage_type": "call" }, { "api_name": "lxml....
33195823896
import csv # For parsing tables/users.csv from typing import List, NamedTuple # For creating a named tuple representing a user from gmail import send_email # For sending an email to a user from last_fm import get_tracks_above_threshold # For getting the top tracks for a user from spotify import ( create_playli...
yayabosh/your-greatest-hits
main.py
main.py
py
3,131
python
en
code
2
github-code
97
[ { "api_name": "typing.NamedTuple", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 20, "usage_type": "name" }, { "api_name": "csv.DictReader", "line_number": 29, "usage_type": "call" }, { "api_name": "last_fm.get_tracks_above...
20332512851
import unittest import requests HOST = "http://127.0.0.1:6000" class TestApi(unittest.TestCase): def test_sub_endpoint(this): response = requests.get(f"{HOST}/api/sub", params={ "lhs": 10, "rhs": 2 }) assert response.status_code == 200 assert response.json(...
Bartek-stu/github-actions-example
test/test_api.py
test_api.py
py
1,675
python
en
code
0
github-code
97
[ { "api_name": "unittest.TestCase", "line_number": 6, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.get", "li...
37560208965
import pandas as pd import numpy as np from pathlib import Path import itertools import matplotlib.pyplot as plt plt.style.use('seaborn-white') from operator import is_not from functools import partial import logging # create file handler which logs even debug messages logging.basicConfig(filename=Path(__file__).paren...
nllong/advent_of_code_2021
day11/run.py
run.py
py
3,647
python
en
code
0
github-code
97
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 6, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "api_name"...
33672992235
import pygame # Initialize Pygame and set the window size pygame.init() size = (700, 500) screen = pygame.display.set_mode(size) # Set the background color for the empty grid spaces bg_color = (255, 255, 255) screen.fill(bg_color) # Create entities using rectangles food_color = (0, 255, 0) food = pygame.draw.rect(sc...
Limonka11/ArtificialLifeSimulator
Environment/pygameEx.py
pygameEx.py
py
888
python
en
code
0
github-code
97
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pygame.draw.rect...
44674492359
import os import json from flask import Flask, render_template, request from run_model import bag_of_words app = Flask(__name__) @app.route("/ping", methods=["GET"]) def home_view(): return "pong" @app.route("/bag_of_words", methods=["POST"]) def help_view(): message = request.json q = message['question'...
kyoungd/simp-help-util
app.py
app.py
py
451
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.request.json", "line_number": 14, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 14, "usage_type": "name" }, { "api_name": "run_model.bag_of_wor...
5274740281
from webassets.filter.closure import ClosureJS class SimpleClosureJS(ClosureJS): """ This filter uses the Google Closure Compiler with simple optimizations turned on. """ def __init__(self, disable_ie_checks=False): super(SimpleClosureJS, self).__init__() self.disable_ie_checks =...
pmnyc/Data_Engineering_Collections
django_flask_samples/skylines-master/skylines/frontend/assets/filters.py
filters.py
py
611
python
en
code
2
github-code
97
[ { "api_name": "webassets.filter.closure.ClosureJS", "line_number": 4, "usage_type": "name" } ]
21695188881
# -*- coding: utf-8 -*- from flask import (Blueprint, g, render_template, flash, redirect, url_for, abort) from flask.ext.login import current_user from ..services import projects, users, issues from ..for...
xtao/vilya
vilya/frontend/issue.py
issue.py
py
2,330
python
en
code
9
github-code
97
[ { "api_name": "flask.Blueprint", "line_number": 15, "usage_type": "call" }, { "api_name": "services.users.first", "line_number": 22, "usage_type": "call" }, { "api_name": "services.users", "line_number": 22, "usage_type": "name" }, { "api_name": "flask.abort", ...
72564000638
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import admin from .models import Product, Provider, Purchase, Departure, Inventory, Brand from .forms import DepartureForm, PurchaseForm, InventoryForm # Register your models here. @admin.register(Product) class AdminProduct(admin.M...
castillabend/Inventory
apps/inventario/admin.py
admin.py
py
1,509
python
en
code
0
github-code
97
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 12, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 12, "usage_type": "name" }, { "api_name": "django.contrib.admin.register", "line_number": 11, "usage_type": "call" }, ...
20958214918
from rest_framework import serializers from .models import File class FileListSerializer(serializers.Serializer) : user_id = serializers.IntegerField() name = serializers.CharField(max_length=50) one_file = serializers.ListField( child=serializers.FileField( max_length=100000, ...
KashyapTamakuwala/Document_Organizer
file_uploader/uploader/serializers.py
serializers.py
py
917
python
en
code
0
github-code
97
[ { "api_name": "rest_framework.serializers.Serializer", "line_number": 4, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 4, "usage_type": "name" }, { "api_name": "rest_framework.serializers.IntegerField", "line_number": 5, "usage_ty...
10771884314
[globals().pop(var) for var in dir() if not var.startswith("__")] from math import sqrt,ceil,log import pandas as pd import scipy.stats data = pd.read_csv('AB_test_data.csv') data.drop(['date','id'], axis=1, inplace=True) A = data[data.Variant == 'A'] A.drop(['Variant'], axis=1, inplace=True) B = data[data.Variant...
Upcoding52/Mkt_AB_testing
HW1.py
HW1.py
py
2,151
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "scipy.stats.stats.norm.ppf", "line_number": 27, "usage_type": "call" }, { "api_name": "scipy.stats.stats", "line_number": 27, "usage_type": "attribute" }, { "api_name": "sci...
18847848052
import dash from dash import dcc from dash import html import yfinance as yf import pandas as pd import plotly.graph_objects as go from dash.dependencies import Input, Output import numpy as np stock_data = None last_symbol = None def get_stock_data(symbol): stock_data = yf.download(symbol, start='2021-01-01', en...
Alex2782/gym_gettex
gui/app_indicators.py
app_indicators.py
py
4,423
python
en
code
0
github-code
97
[ { "api_name": "yfinance.download", "line_number": 14, "usage_type": "call" }, { "api_name": "dash.Dash", "line_number": 19, "usage_type": "call" }, { "api_name": "dash.html.Div", "line_number": 42, "usage_type": "call" }, { "api_name": "dash.html", "line_numbe...
28589215
import argparse import numpy as np from collections import namedtuple from cshogi import * parser = argparse.ArgumentParser() parser.add_argument('book') parser.add_argument('positions') parser.add_argument('--depth', type=int, default=512) args = parser.parse_args() book = np.fromfile(args.book, BookEntry) keys = se...
TadaoYamaoka/DeepLearningShogi
dlshogi/utils/book_to_positions.py
book_to_positions.py
py
1,973
python
en
code
180
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.fromfile", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.empty", ...
2627756068
# import standard data science libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression from scipy.spatial.distance import jensenshannon # import Path to read the csv file in an OS independent way from pathlib import Path # Use pickle to save tem...
BryceHackett/BonusBet
GenerateCustomers.py
GenerateCustomers.py
py
12,259
python
en
code
0
github-code
97
[ { "api_name": "numpy.random.gamma", "line_number": 51, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 51, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 59, "usage_type": "call" }, { "api_name": "pathlib.Path", ...
10284426777
import cv2 import numpy as np cap = cv2.VideoCapture(0) cap.set(10, 2) while cap.isOpened() == True: ret, frame = cap.read() if ret == True: gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) gray = np.float32(gray) # shi-tomasi 角点检测 corners = cv2.goodFeaturesToTrack(gray, 100, 0....
SSC202/OpenCV
OpenCV-Python/Code/8_Feature_detection/shi_tomasi.py
shi_tomasi.py
py
678
python
en
code
0
github-code
97
[ { "api_name": "cv2.VideoCapture", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.float32", ...
20415631204
from fastapi import FastAPI import pandas as pd app = FastAPI() df_funcion1 = pd.read_parquet('datasets/df_funcion1.parquet', engine='fastparquet', index=False) df_funcion2 = pd.read_parquet('datasets/df_funcion2.parquet', engine='fastparquet', index=False) df_recomendacion_csv = pd.read_csv('datasets/df_recomendacio...
ECBOCANEGRA/Proyecto-Steam
main.py
main.py
py
1,470
python
es
code
0
github-code
97
[ { "api_name": "fastapi.FastAPI", "line_number": 4, "usage_type": "call" }, { "api_name": "pandas.read_parquet", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.read_parquet", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.read_csv"...
35170883767
import torch import unittest from torch_blade import utils from torch_blade.version import cuda_available from tests.disc.testing_base import \ DiscTestCase, skipTorchGE, skipTorchLT, isTorchMlirEnable class TestDiscNNOps(DiscTestCase): def _test_nn_ops(self, nn_ops_func, x=None): test_data = torch....
alibaba/BladeDISC
pytorch_blade/tests/disc/ops/test_nn_ops.py
test_nn_ops.py
py
4,764
python
en
code
707
github-code
97
[ { "api_name": "tests.disc.testing_base.DiscTestCase", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.randn", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number": 15, "usage_type": "attribute" }, { "api_name": "to...
12822293858
import gc import os import time import boto3 import dask import fsspec import joblib import numpy as np import pandas as pd import rasterio as rio import rioxarray import utm import xarray as xr import xgboost as xgb from pyproj import CRS from rasterio.session import AWSSession from s3fs import S3FileSystem import c...
carbonplan/trace
carbonplan_trace/v1/inference.py
inference.py
py
10,559
python
en
code
29
github-code
97
[ { "api_name": "s3fs.S3FileSystem", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.nan", "line_number": 33, "usage_type": "attribute" }, { "api_name": "pyproj.CRS.from_dict", "line_number": 43, "usage_type": "call" }, { "api_name": "pyproj.CRS", ...
10554814853
#!/bin/python import requests,re username = "natas20" pwd = "eofm3Wsshxc5bwtVnEuGIlr7ivb9KABF" url = f"http://{username}.natas.labs.overthewire.org/?debug=True" data={'name':'ag\nadmin 1'} session = requests.Session() response= session.post(url,data=data,auth=(username,pwd)) response= session.get(url,auth=(username,...
Sachin-v3rma/random
CTF/N20.py
N20.py
py
364
python
en
code
0
github-code
97
[ { "api_name": "requests.Session", "line_number": 8, "usage_type": "call" } ]
32729151891
import os import numpy as np import logging import argparse import time import tensorflow as tf from skimage import transform from skimage import morphology from skimage.morphology import disk import math from sklearn.ensemble import RandomForestClassifier import pickle import modelProd as model import f...
Hakim-F/CardiacSegmenter
CardiacModels/Unet2DLGE.py
Unet2DLGE.py
py
11,488
python
en
code
2
github-code
97
[ { "api_name": "logging.basicConfig", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 17, "usage_type": "attribute" }, { "api_name": "tensorflow.placeholder", "line_number": 26, "usage_type": "call" }, { "api_name": "tensorfl...
33928528734
from app.models import db, Card import datetime def seed_cards(): card1= Card( list_id=1, workspace_id=1, index='0', name='Top 10 Trends list - Forbes', description='Top 10 Trends list - Forbes', created_at=datetime.datetime.now() ) card2= Card( list...
walkeradkins/whatnext
app/seeds/cards.py
cards.py
py
4,333
python
en
code
0
github-code
97
[ { "api_name": "app.models.Card", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "attribute" }, { "api_name": "app.model...
519159138
from functools import reduce lista = [1,2,3,4] # Este código da 19 y DEBERÍA dar 20 sumatorioDobles = reduce(lambda x, y: x+y*2, lista) print(sumatorioDobles) def SumatorioDobleClasico (l): resultado = 0 for i in l: resultado += i*2 return resultado print(SumatorioDobleClasico(lista)) # Este p...
zopiro00/m02_boot_0
01_funciones_nivel/04b_reduce.py
04b_reduce.py
py
493
python
es
code
0
github-code
97
[ { "api_name": "functools.reduce", "line_number": 6, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 21, "usage_type": "call" } ]
27875288992
import cv2 for j in range(5): images = [] #if j > 0: # break for i in range(5): image = cv2.imread("./images/c%d_%d.tif"%(j, i)) images.append(image) stitcher = cv2.Stitcher_create(1) print(len(images)) (status, stitched) = stitcher.stitch(images) cv2.imwrite("test%d.p...
teodecarvalho/Microscope
Stitching.py
Stitching.py
py
878
python
en
code
0
github-code
97
[ { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.Stitcher_create", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.imwrite", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.imread", "line_numbe...
35167238765
# regression.py import torch from torch import nn import numpy as np __all__ = ['_3DMM'] class _3DMM(object): """docstring for 3DMM""" def __init__(self): super(_3DMM, self).__init__() self.l1_loss = nn.L1Loss(reduction='none') self.mse_loss = nn.MSELoss(reduction='none') self...
human-analysis/3dfacefill
losses/_3dmm.py
_3dmm.py
py
1,696
python
en
code
9
github-code
97
[ { "api_name": "torch.nn.L1Loss", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.nn.MSELoss", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.nn", "line_number...
73461784319
import pygame import random dice_icon_size = 125 class Dice: def __init__(self, position): self.__position = position self.test = position self.roll_times = 1 self.__move_times = 0 self.__rotate_times = 0 self.init_dice() def init_dice(self): self.roll_...
linitachi/QuickEscape
dice.py
dice.py
py
1,860
python
en
code
0
github-code
97
[ { "api_name": "random.randint", "line_number": 27, "usage_type": "call" }, { "api_name": "pygame.image.load", "line_number": 49, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 49, "usage_type": "attribute" }, { "api_name": "pygame.transform.s...
2611468120
from collections import namedtuple from . import exiv2_wrapper Rational = namedtuple("Rational", ["numerator", "denominator"]) def convert_to_rational(data): numerator, denominator = data.split("/") return Rational(numerator=int(numerator), denominator=int(denominator)) exiv2_2_python = { "Short": int, ...
UIUCLibrary/DCC_Migrator
DCC_pyMigrator/ext/metadata.py
metadata.py
py
1,294
python
en
code
0
github-code
97
[ { "api_name": "collections.namedtuple", "line_number": 4, "usage_type": "call" } ]
8620043073
"""Task 7.""" import functools import itertools def valuesunion(*dicts): answ = set() for d in dicts: for el in d.values(): answ.add(el) return answ def popcount(n): s = bin(n) sum = 0 for i in range(2, len(s)): if s[i] == '1': sum += 1 return sum ...
AntonZamyatin/bio-python-course
term1/task7/task7.py
task7.py
py
6,345
python
en
code
0
github-code
97
[ { "api_name": "itertools.count", "line_number": 74, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 122, "usage_type": "call" } ]
9217669648
import matplotlib.pyplot as plt def prepare_plot(orig_img,orig_mask,pred_mask): # Initialize our figure figure,ax = plt.subplots(nrows=1,ncols=3,figsize=(10,10)); # Plot the original image, original mask, predicted mask ax[0].imshow(orig_mask) ax[1].imshow(orig_mask) ax[2].imshow(pred_mask) ...
0m0D1NGR0NALD/Segmentation-of-Breast-Cancer-Ultrasound-Images
predict.py
predict.py
py
558
python
en
code
2
github-code
97
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 5, "usage_type": "name" } ]
43724126158
from sympy import lambdify from init import x, PRECISION def chord(y, interval: tuple): a, b = interval[0], interval[1] f = lambdify(x, y) if f(a) * f(b) > 0: raise Exception("An incorrect interval to be solved by chord method was passed" "The boundaries of the interval to ...
KirillKurril/numerical_analysis_methods
LWD_3/chord_method.py
chord_method.py
py
963
python
en
code
0
github-code
97
[ { "api_name": "sympy.lambdify", "line_number": 6, "usage_type": "call" }, { "api_name": "init.x", "line_number": 6, "usage_type": "argument" }, { "api_name": "init.PRECISION", "line_number": 14, "usage_type": "name" }, { "api_name": "init.PRECISION", "line_num...
15636332367
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app', '0009_remove_ticket_price'), ] operations = [ migrations.AddField( model_name='event', name='p...
kotik1/do
app/migrationOLD/0010_event_price.py
0010_event_price.py
py
406
python
en
code
0
github-code
97
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AddField", "line_number": 14, "usage_type": "call" }, { ...
4364834291
#!/usr/bin/env python # coding: utf-8 # In[3]: import os import glob import sys if len(sys.argv) < 2: print ("Please enter the path to the data directory") f = {} for root, directories, filenames in os.walk(sys.argv[1]): #Change to Data_MPHI for MPHI dataset for directory in directories: ...
prajwal1210/Stance-Detection-in-Web-and-Social-Media
KDEY/features.py
features.py
py
11,220
python
en
code
29
github-code
97
[ { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.walk", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number":...
34591651397
#!/usr/bin/env python3 """Parses the wikipedia pages and other sources into JSON.""" import json import os import re from collections import namedtuple, OrderedDict import iso3166 from bs4 import BeautifulSoup MNC_OPERATOR_FIELDS = ("mcc", "mnc", "brand", "operator") COUNTRY_FIELDS = ("name", "iso2", "iso3", "numeri...
mozilla/ichnaea
mobile_codes/parse.py
parse.py
py
16,980
python
en
code
527
github-code
97
[ { "api_name": "collections.namedtuple", "line_number": 16, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 17, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 18, "usage_type": "call" }, { "api_name": "...
25089309829
import mlrose_hiive as mlrose import numpy as np import matplotlib.pyplot as plt import six weights = np.random.randint(1, 50, 50) # 100个物品,重量随机在1到50之间 values = np.random.randint(1, 50, 50) # 100个物品,价值随机在5到100之间 max_weight_pct = 0.4 fitness1 = mlrose.Knapsack(weights, values, max_weight_pct) problem1 = mlrose...
Applauzzz/ML-HW2
HW2/Part_A.py
Part_A.py
py
4,185
python
en
code
0
github-code
97
[ { "api_name": "numpy.random.randint", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 5, "usage_type": "attribute" }, { "api_name": "numpy.random.randint", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.random...
9079110363
import os import tempfile import pytest from pytest_splunk_addon.standard_lib.utilities.junit_parser import JunitParser def test_parse_junit_raises_exception_when_not_fields_are_present_in_testcase(): jp = JunitParser( os.path.join( os.path.dirname(__file__), "test_data", "sample_junit_withou...
splunk/pytest-splunk-addon
tests/unit/tests_standard_lib/test_utilities/test_junit_parser.py
test_junit_parser.py
py
2,267
python
en
code
51
github-code
97
[ { "api_name": "pytest_splunk_addon.standard_lib.utilities.junit_parser.JunitParser", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" ...
38507290
import csv import scipy.stats import numpy as np def mean_confidence_interval(data, confidence=0.95): a = 1.0 * np.array(data) n = len(a) m, se = np.mean(a), scipy.stats.sem(a) h = se * scipy.stats.t.ppf((1 + confidence) / 2., n-1) return m, m-h, m+h all_surps_all_k_all_n = dict() for k in range(...
neilrathi/lm-ditransitive
lstm/analyze.py
analyze.py
py
1,668
python
en
code
0
github-code
97
[ { "api_name": "numpy.array", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 8, "usage_type": "call" }, { "api_name": "scipy.stats.stats.sem", "line_number": 8, "usage_type": "call" }, { "api_name": "scipy.stats.stats", "li...
17363893452
import PyDAQmx from daq9211 import * import Tkinter as tk import tkFileDialog import tkMessageBox from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg from matplotlib.figure import Figure from matplotlib import pyplot as plt import matplotlib.animation as animation import datetime import ttk class daq_conf...
Natetempid/nearfield
GUI_Layout_1/GUI_Layout_1/frame_daq_config.py
frame_daq_config.py
py
14,921
python
en
code
0
github-code
97
[ { "api_name": "Tkinter.Frame", "line_number": 14, "usage_type": "attribute" }, { "api_name": "Tkinter.Frame.__init__", "line_number": 16, "usage_type": "call" }, { "api_name": "Tkinter.Frame", "line_number": 16, "usage_type": "attribute" }, { "api_name": "Tkinter....
36620387528
import os import matplotlib.pyplot as plt from mpl_toolkits.axes_grid import AxesGrid from skimage.io import MultiImage from skimage import data_dir # Load the multi-layer image fname = os.path.join(data_dir, 'multipage.tif') img = MultiImage(fname) # Create an image grid fig = plt.figure() grid = AxesGrid(fig, ...
Black-Milk/Dash-Docset
Dash Docsets/scikit-image 0.9.x 2.docset/Contents/Resources/Documents/plots/show_collection.py
show_collection.py
py
633
python
en
code
33
github-code
97
[ { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "skimage.data_dir", "line_number": 10, "usage_type": "argument" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "skimage.io.MultiImage"...
20531971012
import argparse import numpy as np from pulp import * import random import math parser = argparse.ArgumentParser() parser.add_argument('--mdp', required = True) parser.add_argument('--algorithm') parser.add_argument('--policy') args = parser.parse_args() def storeMDP(mdpPath): with open(mdpPath) as file: ...
FreneticXO/mdp-planning
planner.py
planner.py
py
4,737
python
en
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.random.uniform",...
34238249957
import evaluate import torch import torch.nn.functional as F from accelerate import Accelerator from datasets import load_dataset from torch.optim import AdamW from torch.utils.data import DataLoader from tqdm.auto import tqdm from transformers import ( AutoModelForSequenceClassification, AutoTokenizer, Da...
john-b-yang/learnx2
hf/runs/run_33_acc.py
run_33_acc.py
py
2,698
python
en
code
0
github-code
97
[ { "api_name": "datasets.load_dataset", "line_number": 17, "usage_type": "call" }, { "api_name": "transformers.AutoTokenizer.from_pretrained", "line_number": 19, "usage_type": "call" }, { "api_name": "transformers.AutoTokenizer", "line_number": 19, "usage_type": "name" }...
73319478080
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Mar 10 10:39:27 2021 @author: mac """ # -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import numpy as np from sympy import sieve as euclid ## source: https://stackoverflow.com/questions/2068372/fastest-way-to-list-all-...
knut0815/Monte-Carlo-Hypothesis
data_generation/binary_encoding.py
binary_encoding.py
py
1,894
python
en
code
0
github-code
97
[ { "api_name": "numpy.ones", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.bool", "line_number": 22, "usage_type": "attribute" }, { "api_name": "numpy.r_", "line_number": 28, "usage_type": "attribute" }, { "api_name": "numpy.nonzero", "line_nu...
27047823465
import streamlit as st from datetime import date import yfinance as yf from prophet import Prophet import plotly.graph_objects as go st.title('Stock Forecast App') stocks = ('GOOG', 'AAPL', 'MSFT', 'AMZN','META','TSLA','BRK.A','JNJ','KO','LLY') selected_stock = st.selectbox('Select dataset for prediction', s...
Ravi-chandera/StockPredictionApp
app.py
app.py
py
1,229
python
en
code
0
github-code
97
[ { "api_name": "streamlit.title", "line_number": 7, "usage_type": "call" }, { "api_name": "streamlit.selectbox", "line_number": 10, "usage_type": "call" }, { "api_name": "streamlit.slider", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.date.tod...
15837321176
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Increase version and commit changes to git """ from __future__ import print_function import subprocess import re import sys versionFile = "src/dist.py" readmeFile = "README.md" def check_readme(version): version = '.'.join(map(str, version)) changelog = [] copy...
technic/iptvdream4x
scripts/version-up.py
version-up.py
py
2,413
python
en
code
0
github-code
97
[ { "api_name": "re.compile", "line_number": 20, "usage_type": "call" }, { "api_name": "subprocess.Popen", "line_number": 42, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 42, "usage_type": "attribute" }, { "api_name": "subprocess.check_cal...
43138101551
from django.shortcuts import render from .forms import ContactForm, SignUpForm def home(request): title = "Welcome" form = SignUpForm(request.POST or None) context = { "title": title, "form": form } if form.is_valid(): instance = form.save(commit = False) if not instance.full_name: instance.full_...
hardikzurdo/newsletter
newsletter/views.py
views.py
py
628
python
en
code
0
github-code
97
[ { "api_name": "forms.SignUpForm", "line_number": 5, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 23, "usage_type": "call" }, { "api_name": "forms.ContactForm", "line_number": 27, "usage_type": "call" }, { "api_name": "django.shor...
73251041918
import numpy as np import scipy.io as sio from datetime import datetime, timedelta import pandas as pd import os import csv import matplotlib.pyplot as plt from matplotlib.ticker import ScalarFormatter, MultipleLocator import matplotlib.mlab as mlab import scipy as sp from scipy.interpolate import UnivariateSpline impo...
franciscolang/Southern_Ocean_BL
Python/MAC-YOTC/07_yotc_mac_all_variables925.py
07_yotc_mac_all_variables925.py
py
27,505
python
en
code
0
github-code
97
[ { "api_name": "os.path.expanduser", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "scipy.io.loadmat", "line_number": 33, "usage_type": "call" }, { "api_name": "scipy.io", "line...
4327919460
from django.db import models # from ....card import card from django.contrib.auth import get_user_model User = get_user_model() class Game(models.Model): # Each game is mapped to one user user = models.OneToOneField(User, on_delete = models.CASCADE) GAMESTATE = ( ('battle','battle'), ('sh...
LucienLuc/project-sts
backend/src/apps/game/main/models.py
models.py
py
835
python
en
code
0
github-code
97
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 5, "usage_type": "call" }, { "api_name": "django.db.models.Model", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 7, "usage_type": "name" }, { "api_...
72065984959
import argparse import matplotlib as mpl import matplotlib.colors as mcolors import matplotlib.pyplot as plt import numpy as np import pandas as pd from pandas import ExcelWriter import re import time from scipy import integrate from scipy.stats import norm, gaussian_kde from config import config import config as ...
ssuchek/Travelers
claim_id_weight_comparison.py
claim_id_weight_comparison.py
py
29,405
python
en
code
0
github-code
97
[ { "api_name": "matplotlib.rcParams", "line_number": 20, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 21, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 23, "usage_type": "call" }, { "api_nam...
7965832388
import logging from pyspark.sql import SparkSession from pyspark.sql.functions import explode from pyspark.sql.functions import split def configure_logging(): logger = logging.getLogger() logger.setLevel(logging.INFO) def create_spark(): spark = SparkSession \ .builder \ .appName("Struct...
mleuthold/spark-structured-streaming-on-kafka
structured_streaming/StructuredStreamingApp.py
StructuredStreamingApp.py
py
2,895
python
en
code
0
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 13, "usage_type": "call" }, { "api_na...
14578828891
import os import collections import glob import scanpy.api as sc from sklearn import cluster import pandas import subprocess from utils.config import Configuration import matplotlib.pyplot as plt import numpy import shutil from interface.singlecellexperiment import SingleCellExperiment config = Configuration() class...
mwiens91/SCRNApipeline
interface/tenxanalysis.py
tenxanalysis.py
py
12,444
python
en
code
null
github-code
97
[ { "api_name": "utils.config.Configuration", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path.exists",...
33351114906
import tensorflow as tf import data as DataHelper import numpy as np import time def add_eos(sentences): for i in range(len(sentences)): sentences[i] = np.append(sentences[i], DataHelper.eos_id) return sentences samples, labels = DataHelper.get_train_set() labels = add_eos(labels) vocab_src, vocab_t...
phathuynh55/Test-10k-sentences
model.py
model.py
py
12,832
python
en
code
0
github-code
97
[ { "api_name": "numpy.append", "line_number": 9, "usage_type": "call" }, { "api_name": "data.eos_id", "line_number": 9, "usage_type": "attribute" }, { "api_name": "data.get_train_set", "line_number": 13, "usage_type": "call" }, { "api_name": "data.get_vocabs", ...
5400078101
from pyramid.httpexceptions import HTTPBadRequest from pyramid_jsonapi.http_query import QueryInfo from rqlalchemy import RQLQueryMixIn from sqlalchemy.orm import load_only, Query as BaseQuery class PJQueryMixin: @staticmethod def from_view(view, **kwargs): query = view.dbsession.query( v...
colinhiggs/pyramid-jsonapi
pyramid_jsonapi/db_query.py
db_query.py
py
4,647
python
en
code
26
github-code
97
[ { "api_name": "sqlalchemy.orm.load_only", "line_number": 27, "usage_type": "call" }, { "api_name": "pyramid_jsonapi.http_query.QueryInfo", "line_number": 38, "usage_type": "call" }, { "api_name": "pyramid.httpexceptions.HTTPBadRequest", "line_number": 69, "usage_type": "c...
24353320453
# -*- coding: utf-8 -*- #!/usr/bin/env python3 """ Created on Tue Dec 12 15:01:40 2017 @Mail: minnglee@163.com @Author: Ming Li """ import sys,os,logging,click logging.basicConfig(filename='{0}.log'.format(os.path.basename(__file__).replace('.py','')), format='%(asctime)s: %(name)s: %(levelname)s: ...
minglibio/Script
Selection/GetWinSweepFinder.py
GetWinSweepFinder.py
py
2,358
python
en
code
4
github-code
97
[ { "api_name": "logging.basicConfig", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.DEBUG", ...
2651258516
#!/usr/bin/python from jinja2 import Environment, FileSystemLoader import cherrypy, redis class Kitchen(object): env = Environment(loader=FileSystemLoader("templates")) red = redis.StrictRedis(host='localhost', port=6379, db=0) def index(self, e=env, r=red): t = e.get_template("index.html") d = ...
lloyddiz/Kitchen
kitchen.py
kitchen.py
py
1,920
python
en
code
0
github-code
97
[ { "api_name": "jinja2.Environment", "line_number": 7, "usage_type": "call" }, { "api_name": "jinja2.FileSystemLoader", "line_number": 7, "usage_type": "call" }, { "api_name": "redis.StrictRedis", "line_number": 8, "usage_type": "call" }, { "api_name": "cherrypy.HT...
13156440200
import scrapy import json import copy from functools import partial from dateutil import parser class BlogSpider(scrapy.Spider): name = 'runsignup' download_delay = 0.25 #start_urls = ['https://runsignup.com/Race/FL/DaytonaBeach/DaytonaBeachHalf'] #start_urls=['https://runsignup.com/Race/NY...
chaserigby/racepass
crawlers/runsignup2.py
runsignup2.py
py
3,751
python
en
code
0
github-code
97
[ { "api_name": "scrapy.Spider", "line_number": 7, "usage_type": "attribute" }, { "api_name": "copy.copy", "line_number": 51, "usage_type": "call" }, { "api_name": "scrapy.Request", "line_number": 71, "usage_type": "call" } ]
41519111561
from __future__ import absolute_import import sys import traceback from time import time from datetime import datetime from contextlib import contextmanager from textwrap import indent from logging import getLogger _logger = getLogger(__name__) class PException(Exception): """An exception object that can accept ...
real-easypy/easypy
easypy/exceptions.py
exceptions.py
py
5,346
python
en
code
13
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "traceback.format_exc", "line_number": 23, "usage_type": "call" }, { "api_name": "time.time", "line_number": 25, "usage_type": "call" }, { "api_name": "textwrap.indent", ...
28149472696
# coding: utf-8 # In[37]: import numpy as np import matplotlib.pyplot as plt import cv2 import os from tqdm import tqdm DIR='C:/Users/Asus/Downloads/ML DATASETS/Dogs Vs Cats/' CATEGORIES = ['dog', 'cat'] train_path=os.path.join(DIR, 'train') IMG_SIZE = 100 for img in tqdm(os.listdir(train_path)): label = img....
GameLogist/Machine-Learning
Deep Learning/Dogs_vs_cats_CNN.py
Dogs_vs_cats_CNN.py
py
3,001
python
en
code
1
github-code
97
[ { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "tqdm.tqdm", "line_number": 18, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 1...
31485309379
from PyQt6.QtWidgets import QApplication, QMainWindow from PyQt6 import uic from PyQt6.QtGui import * from PyQt6.QtWidgets import * from PyQt6.QtCore import * from PyQt6 import QtWidgets, QtGui, QtCore from PyQt6.QtGui import * from PyQt6.QtWidgets import * from PyQt6 import * from PyQt6 import QtWidgets, QtGui, QtCo...
Carl-Walters-Portfolio/Product-Tracking-System
view/app.py
app.py
py
10,625
python
en
code
0
github-code
97
[ { "api_name": "sys.path.append", "line_number": 42, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 42, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 42, "usage_type": "call" }, { "api_name": "os.path", "line_num...
41283984082
import argparse import os count = 0 def get_directory(): parser = argparse.ArgumentParser(description='Count the number of JSON files in a directory') parser.add_argument('path', help='Path to target directory') args = parser.parse_args() return args.path target_dir = get_directory() if not os.pa...
patryk-jedrzejewski/TaskNeudea
search_dir.py
search_dir.py
py
548
python
en
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.listdir", "l...
71017359358
from flask import Flask, render_template, request #from Admission_New import calc import pandas as pd app = Flask(__name__)# interface between my server and my application wsgi import pickle model = pickle.load(open(r'C:\Users\nagap\Downloads\IBM\model.pkl','rb')) @app.route('/')#binds to an url def helloworld()...
smartinternz02/SBSPS-Challenge-10381-1691070396
app.py
app.py
py
3,800
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.render_template", ...
17833163907
import Globals from direct.gui.DirectGui import * from pandac.PandaModules import * from direct.actor.Actor import Actor from toon import Toon from GenderShop import GenderShop from ColorShop import ColorShop from BodyShop import BodyShop from ClothingShop import ClothingShop from NameShop import NameShop class MakeAT...
SamGoodin/Toontown
makeatoon/MakeAToon.py
MakeAToon.py
py
20,548
python
en
code
0
github-code
97
[ { "api_name": "GenderShop.GenderShop", "line_number": 15, "usage_type": "call" }, { "api_name": "BodyShop.BodyShop", "line_number": 65, "usage_type": "call" }, { "api_name": "ColorShop.ColorShop", "line_number": 85, "usage_type": "call" }, { "api_name": "ClothingS...
5926769298
""" This module deals with the AvailableBuildings object. """ __docformat__ = "google" from models.enums import Buildings from collections import Counter import random class AvailableBuildings: availability: list[str] """ The availability of each building based on the current buildings array. \n For ...
hwennnn/SimpCity
models/available_buildings.py
available_buildings.py
py
5,266
python
en
code
0
github-code
97
[ { "api_name": "models.enums.Buildings.BEACH", "line_number": 36, "usage_type": "attribute" }, { "api_name": "models.enums.Buildings", "line_number": 36, "usage_type": "name" }, { "api_name": "models.enums.Buildings.FACTORY", "line_number": 36, "usage_type": "attribute" ...
25987508861
# -*- coding: cp1252 -*-. # Created on 21/mag/2014 # @author: mda #!/usr/local/bin/python import datetime from pygeocoder import Geocoder from pygeolib import GeocoderError import re import rThinkGbl as gL import phonenumbers import inspect import urllib def SetNow(): # data corrente del run wrk = datetime.da...
micheledalonzo/rThink
rThinkFunctions.py
rThinkFunctions.py
py
8,036
python
en
code
0
github-code
97
[ { "api_name": "datetime.datetime.now", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "attribute" }, { "api_name": "rThinkGbl.StdCar", "line_number": 36, "usage_type": "call" }, { "api_name": "rThinkG...
73463724800
from http import HTTPStatus from urllib import parse from django.contrib.auth import get_user_model from django.test import TestCase, Client from django.urls import reverse from ..models import Post, Group from .constants import ( INDEX_URL_NAME, GROUP_LIST_URL_NAME, PROFILE_URL_NAME, POST_DETAIL_URL_...
OlegMusatov3000/hw05_final
yatube/posts/tests/test_urls.py
test_urls.py
py
5,695
python
en
code
0
github-code
97
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 19, "usage_type": "call" }, { "api_name": "django.test.TestCase", "line_number": 22, "usage_type": "name" }, { "api_name": "models.Group.objects.create", "line_number": 28, "usage_type": "call" }, { ...
23510010792
import os import js2py TRANSLATED_FILE_NAME = "text_validation.py" def translate(): # read js file with open('index.js', 'r') as file: js_code = file.read().split("module.exports")[0].strip() # augment and write to disk f = open("temp.js", "w") f.write(js_code) f.close() # trans...
hyroai/text-validation
translate_js2py.py
translate_js2py.py
py
487
python
en
code
0
github-code
97
[ { "api_name": "js2py.translate_file", "line_number": 18, "usage_type": "call" }, { "api_name": "os.remove", "line_number": 21, "usage_type": "call" } ]
31275919817
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Oct 2 14:51:29 2020 @author: peter """ import os import pandas as pd import geopandas as gpd import matplotlib as mpl import matplotlib.pyplot as plt import math import statistics import numpy as np import scipy.stats mpl.style.use('tableau-colorblin...
ppiont/cnn-soc-wagga
old/sample_statistics.py
sample_statistics.py
py
1,570
python
en
code
0
github-code
97
[ { "api_name": "matplotlib.style.use", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.style", "line_number": 19, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams.update", "line_number": 20, "usage_type": "call" }, { "api_name": ...
11437091806
import numpy as np import argparse import logging import os import matplotlib.pyplot as plt import cv2 import numpy as np import torch import torch.nn.functional as F from PIL import Image import cv2 import itertools from scipy.interpolate import LinearNDInterpolator # phi(x1, x2) = r^2 * log(r), where r = ||x1 - ...
XiangWeiJiang/Document_Geometry_Dewarping
optim/tps.py
tps.py
py
3,452
python
en
code
13
github-code
97
[ { "api_name": "torch.log", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.array", "line_numb...
45184016024
from django.contrib.auth.models import Permission, User from rest_framework import serializers from rest_framework_simplejwt.serializers import TokenObtainPairSerializer class UserSerializer(serializers.ModelSerializer): user_permissions = serializers.SlugRelatedField(many=True, read_only=True, slug_field="codena...
Qlas/VRPTW
backend/user/serializers.py
serializers.py
py
1,261
python
en
code
0
github-code
97
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 6, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 6, "usage_type": "name" }, { "api_name": "rest_framework.serializers.SlugRelatedField", "line_number": 7, ...
4022687815
import sys from pyspark.sql import SparkSession class PaidPaymentsProcessor: def __init__(self, app_name="BakeryPayments"): self.app_name = app_name def process(self, payments="./data/payments/payments.csv"): if len(sys.argv) > 1: payments = sys.argv[1] spark = SparkSes...
caioaraujo/bakery-payments-spark-processor
src/processors.py
processors.py
py
760
python
en
code
0
github-code
97
[ { "api_name": "sys.argv", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 15, "usage_type": "call" }, { "api_name": "...
20381610731
import sqlite3 data_base = sqlite3.connect('data_base_name') cursor = data_base.cursor() cursor.execute('CREATE TABLE IF NOT EXISTS table_name(name text,age int,info text)') data_base.commit() # # 数据增加 # cursor.execute('INSERT INTO table_name VALUES ("python",29,"最好的语言")') # cursor.execute('INSERT INTO table_name VALU...
BaoZT/SqliteLearning
Part1_BasicOperation.py
Part1_BasicOperation.py
py
1,250
python
en
code
0
github-code
97
[ { "api_name": "sqlite3.connect", "line_number": 2, "usage_type": "call" } ]
29848777898
from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from django.db import IntegrityError from django.db.models import fields from django.db.models.fields import TextField from django.forms import widgets from django.http import HttpResponseRedirect from ...
atulyd4/commerce
auctions/views.py
views.py
py
7,618
python
en
code
0
github-code
97
[ { "api_name": "django.forms.ModelForm", "line_number": 16, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 16, "usage_type": "name" }, { "api_name": "models.Listing", "line_number": 18, "usage_type": "name" }, { "api_name": "django.db.mod...
20680157685
"""Boxplots of the data""" import seaborn as sns import matplotlib.pyplot as plt import numpy as np from scipy.io import loadmat from scipy.stats import zscore from itertools import product from utils import rm_outliers from params import STATE_LIST, FREQ_DICT, CHANNEL_NAMES, SAVE_PATH SAVE_PATH /= "psd" RANDOM = 666 ...
arthurdehgan/sleep
visu_data_boxplot.py
visu_data_boxplot.py
py
1,714
python
en
code
1
github-code
97
[ { "api_name": "params.SAVE_PATH", "line_number": 11, "usage_type": "name" }, { "api_name": "params.CHANNEL_NAMES", "line_number": 14, "usage_type": "argument" }, { "api_name": "itertools.product", "line_number": 16, "usage_type": "call" }, { "api_name": "params.ST...
44961811266
import base58 from factom_did.client.constants import ENTRY_SCHEMA_V100 from factom_did.client.enums import DIDKeyPurpose, KeyType from factom_did.client.keys.abstract import AbstractDIDKey class DIDKey(AbstractDIDKey): """ Application-level key, which can be used for authentication, signing requests, encryp...
factomatic/py-factom-did
factom_did/client/keys/did.py
did.py
py
3,839
python
en
code
5
github-code
97
[ { "api_name": "factom_did.client.keys.abstract.AbstractDIDKey", "line_number": 8, "usage_type": "name" }, { "api_name": "factom_did.client.enums.DIDKeyPurpose.PublicKey", "line_number": 46, "usage_type": "attribute" }, { "api_name": "factom_did.client.enums.DIDKeyPurpose", "l...
11918085246
#!/usr/bin/python ''' Author: Marco Ragone, Computational Multiphase Transport Laboratory, University of Illinois at Chicago ''' import numpy as np import os from skimage.filters import gaussian import tensorflow as tf class Random_Imaging(): """ * Random_Imaging: class to perform random transformations...
mrcragone72/ColumnHeights-DeepLearning
scripts/dataset_scripts/dataset_utils.py
dataset_utils.py
py
3,368
python
en
code
0
github-code
97
[ { "api_name": "numpy.random.uniform", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 35, "usage_type": "attribute" }, { "api_name": "skimage.filters.gaussian", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy...
25582854847
import os import sys import enum import time import urllib import threading from abc import ABC, abstractmethod from typing import TYPE_CHECKING, Any, Callable if TYPE_CHECKING: import mpv from ..core.controller import Controller # noqa: F401 PlayerEvent = enum.Enum('PlayerEvent', 'VIDEO_OVER VIDEO_QUIT') ...
kpj/Vydia
vydia/extra/player.py
player.py
py
8,550
python
en
code
11
github-code
97
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 11, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 16, "usage_type": "call" }, { "api_name": "abc.ABC", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.Callable", "line_nu...
44856764069
from statistics import mean from test_model import Test class TrainFmModel(): def __init__(self,model, optimizer, data_loader, full_dataset, criterion, device, topk, log_interval=100): self.model = model self.optimizer = optimizer self.data_loader = data_loader self.full_dataset = ...
keyalp/ai-recommender
train_fm_model.py
train_fm_model.py
py
1,936
python
en
code
0
github-code
97
[ { "api_name": "statistics.mean", "line_number": 30, "usage_type": "call" }, { "api_name": "test_model.Test.testModel", "line_number": 40, "usage_type": "call" }, { "api_name": "test_model.Test", "line_number": 40, "usage_type": "name" } ]
21928430747
from os import remove from os.path import isfile, join from tempfile import NamedTemporaryFile from platformio.commands.check.defect import DefectItem from platformio.commands.check.tools.base import CheckToolBase from platformio.managers.core import get_core_package_dir class CppcheckCheckTool(CheckToolBase): d...
socallinuxexpo/scaleav-deb
opt/scaleavvenv/lib/python3.6/site-packages/platformio/commands/check/tools/cppcheck.py
cppcheck.py
py
4,716
python
en
code
1
github-code
97
[ { "api_name": "platformio.commands.check.tools.base.CheckToolBase", "line_number": 10, "usage_type": "name" }, { "api_name": "platformio.commands.check.defect.DefectItem.SEVERITY_HIGH", "line_number": 57, "usage_type": "attribute" }, { "api_name": "platformio.commands.check.defec...
3109002414
# # 吴恩达老师深度学习第一课例子 # import numpy as np import matplotlib.pyplot as plt import h5py import scipy from PIL import Image from scipy import ndimage import os import imageio from skimage.transform import resize import skimage dir_name = os.path.dirname(__file__) if dir_name == "": dir_name= "." #吴恩达老师的猫,通过网上下载 #有209...
asmcos/AIDocs
examples/dl_lession_week4.py
dl_lession_week4.py
py
21,446
python
en
code
6
github-code
97
[ { "api_name": "os.path.dirname", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "h5py.File", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.array", "line_number...
34629217293
# Importing Libraries import numpy as np import cv2 # img = cv2.imread('smarties.png') img = cv2.imread('shapes1.jpg') output = img.copy() gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # We blur the image as Hough Circle Transform works better with blurred images gray = cv2.medianBlur(gray, 5) circles = cv2.HoughCir...
mclods/gods-eye
24. hough_circle_transform/detecting_circles_using_hough_circle_transform.py
detecting_circles_using_hough_circle_transform.py
py
708
python
en
code
1
github-code
97
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 9, "usage_type": "attribute" }, { "api_name": "cv2.medianBlur", "li...
5194473285
import folium # library for maps import time import csv arr = [] rows = [] #instead of csv we had to use sql databases with open('file.csv', 'r') as file: reader = csv.reader(file) for row in reader: arr.append(row) larr = len(arr) + 1 while True: #send request to database ...
buldosik/300bytes
event_finder.py
event_finder.py
py
1,370
python
en
code
0
github-code
97
[ { "api_name": "csv.reader", "line_number": 10, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 24, "usage_type": "call" }, { "api_name": "folium.Map", "line_number": 29, "usage_type": "call" }, { "api_name": "folium.Marker", "line_number": 3...
26331420058
from termcolor import cprint class Road: def __init__(self, start, end, distance): self.start = start self.end = end self.distance = distance class Warehouse: def __init__(self, name, content): self.name = name self.content = content self.road_out = None ...
JohnGat01/New_Projects
practise_10/track_game.py
track_game.py
py
6,998
python
en
code
0
github-code
97
[ { "api_name": "termcolor.cprint", "line_number": 204, "usage_type": "call" }, { "api_name": "termcolor.cprint", "line_number": 214, "usage_type": "call" }, { "api_name": "termcolor.cprint", "line_number": 216, "usage_type": "call" }, { "api_name": "termcolor.cprin...
40988027626
from arena_bot import ArenaBot from models import Player, TaskProficiency from discord.ext.commands import Cog, Context, command class Core(Cog): """Cog holds Core commands""" def __init__(self, bot: ArenaBot): self.bot = bot @command() async def join(self, ctx: Context): """Join if...
GDWR/DiscordArena
bot/cogs/core.py
core.py
py
1,362
python
en
code
5
github-code
97
[ { "api_name": "discord.ext.commands.Cog", "line_number": 7, "usage_type": "name" }, { "api_name": "arena_bot.ArenaBot", "line_number": 10, "usage_type": "name" }, { "api_name": "discord.ext.commands.Context", "line_number": 14, "usage_type": "name" }, { "api_name"...
24457948037
DEBUG=True def log(s): if DEBUG: print(s) import torch # import visdom import argparse from ptsemseg.models import get_model from scipy.ndimage.interpolation import zoom from ptsemseg.utils import * # try: # import pydensecrf.densecrf as dcrf # except: # print( # "Failed to import pyden...
wkkxixi/segment_3D
test.py
test.py
py
9,217
python
en
code
0
github-code
97
[ { "api_name": "torch.from_numpy", "line_number": 28, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 58, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 58, "usage_type": "call" }, { "api_name": "torch.cuda", ...