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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
20754862266 | import ezdxf
from ezdxf.enums import TextEntityAlignment
def Draw_device(filename, square_size, circle_radius, text):
# 创建新的DXF文档
doc = ezdxf.new()
msp = doc.modelspace()
# 计算正方形的顶点坐标
square_vertices = [
(0, 0),
(square_size, 0),
(square_size, square_size),
(0, squa... | Demonwuwen/zwpycad | drawtool/square_circle.py | square_circle.py | py | 1,073 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "ezdxf.new",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "ezdxf.enums.TextEntityAlignment.LEFT",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "ezdxf.enums.TextEntityAlignment",
"line_number": 30,
"usage_type": "name"
}
] |
19220459274 | from django import forms
from django.conf import settings
from django.core.mail import send_mail
from django.template import loader
from django.template import RequestContext
from django.contrib.sites.models import Site
attrs_dict = { 'class': 'required' }
class ContactForm(forms.Form):
def __init__(self, data=N... | shinojosa2050/miraflores | contactanos/forms.py | forms.py | py | 2,847 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.forms.Form",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.for... |
12801992757 | #Converts a json annotation file to txt that works with darklabel
import argparse
import json
import time
categories = {"0":"ignored", "1":"swimmer", "2":"boat","3":"jetski","4":"life_saving_appliances","5":"buoy"}
if __name__ == '__main__':
scriptTime = time.time()
parser = argparse.ArgumentParser()
pars... | Ben93kie/SeaDronesSee | utils/jsonTotxt.py | jsonTotxt.py | py | 1,633 | python | en | code | 45 | github-code | 21 | [
{
"api_name": "time.time",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_numb... |
38273710359 | import telebot
from telebot import types
from bots.chatbot import getResponse
from bots.aiml_bot import getAimlResponse
from utils.check_language import checkIsRussian, checkIsEnglish
bot = telebot.TeleBot('5807632118:AAGTEY5tZcDYUW72H7NXFpsIy2BmCiF83ms')
@bot.message_handler(commands=['start'])
def start(message):
... | Sevochka/chat-bot | telegram.py | telegram.py | py | 2,409 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "telebot.TeleBot",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "telebot.types.ReplyKeyboardMarkup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "telebot.types",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "telebo... |
18600503045 | from pathlib import Path
import numpy as np
import pandas as pd
import geopandas as gpd
import seaborn as sns
import matplotlib.pyplot as plt
from shapely import from_wkt
from scipy import stats
sns.set_theme(context='paper', style='darkgrid', font='Arimo')
np.random.seed(42)
data_dir = Path(__file__).parents[1] / 'd... | mneyrane/SF-fire-analysis | 02-analysis/fire_incidents_vs_zones.py | fire_incidents_vs_zones.py | py | 2,140 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "seaborn.set_theme",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
... |
74495324534 | import pygame_gui
import pygame
def draw_boundary_limits(screen, x_min, x_max, y_min, y_max, color=(0, 255, 0)):
pygame.draw.line(screen, color, (x_min, y_min), (x_min, y_max), 2) # Left vertical line
pygame.draw.line(screen, color, (x_max, y_min), (x_max, y_max), 2) # Right vertical line
pygame.draw.line... | luigipacheco/X-arm-scripts | App/ui.py | ui.py | py | 2,867 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.draw.line",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pygame.draw.line",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"li... |
15335698464 | from gql import gql, Client
from gql.transport.aiohttp import AIOHTTPTransport
from gql.transport.websockets import WebsocketsTransport
import time
from jwt import encode
from os import getenv
class GQLService:
@staticmethod
def make_token():
secret = getenv("GQL_ACCOUNT_SECRET")
message = {
... | codeday/discord-authbot | src/services/gqlservice.py | gqlservice.py | py | 6,951 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.getenv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "jwt.encode",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "gql.gql",
"line_number": 22,
"... |
2971024692 |
import socket
import json
import os
import base64
# import logging
from time import sleep
from FtpMessage import FtpMessage
from FtpMessage import FtpCredentials
from FtpMessage import FtpData
from FtpMessage import FtpMessageEncoder
class FtpClient:
MAX_BYTES = 65536
def __init__(self, server_address, se... | nyucel/blm304 | vize/130401064/FTPClient/FtpClient.py | FtpClient.py | py | 7,885 | python | en | code | 8 | github-code | 21 | [
{
"api_name": "socket.socket",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_DGRAM",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "socket.timeo... |
16271979776 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('widgetbox', '0012_auto_20150731_1019'),
]
operations = [
migrations.AlterField(
model_name='button',
... | logitnet/djangocms-widgetbox | widgetbox/migrations/0013_auto_20150731_1024.py | 0013_auto_20150731_1024.py | py | 520 | python | en | code | 0 | github-code | 21 | [
{
"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.AlterField",
"line_number": 14,
"usage_type": "call"
},
{... |
8917686564 | """小米净水器组件传感器,净水器无法控制所以只有传感器"""
import logging
from homeassistant.helpers.entity import Entity
from ..mi_water_purifier import SENSOR_TYPES
from ..mi_water_purifier import DOMAIN
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_devices, discovery_info=None):
"""初始化小米净水器传感器"""
if d... | hwyzleo/home-assistant-components | mi_water_purifier/custom_components/mi_water_purifier/sensor.py | sensor.py | py | 1,971 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "mi_water_purifier.DOMAIN",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "mi_water_purifier.SENSOR_TYPES.values",
"line_number": 20,
"usage_type": "call"
},
{
"a... |
23105376109 | import paramiko
import json
import os
from flask import Flask, render_template,flash
from wtforms import StringField, SubmitField
from flask_wtf import Form
from flask_bootstrap import Bootstrap
from flask_script import Manager
app = Flask(__name__)
app.config['SECRET_KEY'] = 'wuyu'
Bootstrap(app)
manager = Manager(a... | summerzhangft/svn | svnup/hello.py | hello.py | py | 4,146 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask_bootstrap.Bootstrap",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask_script.Manager",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask_wtf.... |
29476361261 | import torch
import torch.nn as nn
import torch
import numpy as np
input_dim = 21
hidden_dim = 100
class Encoder(nn.Module):
def __init__(self):
super(Encoder, self).__init__()
self.lstm = nn.LSTM(input_dim, hidden_dim, num_layers=2, batch_first=True)
self.dropout = nn.Dropout(p=0.2)
... | bengisucam/AnnotateProteinUniverse | model.py | model.py | py | 1,578 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.nn.LSTM",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
42825704238 | from django.shortcuts import get_object_or_404
from django.contrib.auth import get_user_model
from rest_framework.response import Response
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import IsAuthenticated
from profiles.models import Profile
User = get_user_mode... | Prashant-Sethi/tweetme-dj-react | profiles/api/views.py | views.py | py | 1,070 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "rest_framework.response.Response",
"line_number": 30,
"usage_type":... |
71235314613 | import pytest
import numpy as np
from numpy.testing import assert_allclose
from jellium.bridge import bridge
def test_bridge():
var = 1
seed = 42
np.random.seed(seed)
state = np.random.get_state()
steps = 10
EPS = 1e-2
sample_bridge = bridge(var, steps, state)
#test endpoints
ass... | Christian-Hirsch/jellium | tests/test_bridge.py | test_bridge.py | py | 930 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.random.seed",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.get_state",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.random... |
16481326427 | #-*- coding: utf-8 -*-
u"""
.. moduleauthor:: Martí Congost <marti.congost@whads.com>
"""
from xml.sax.saxutils import escape, quoteattr
from cocktail import schema
from woost import app
from woost.models import (
Publishable,
LocaleMember,
Controller,
with_default_controller
)
@with_default_controll... | marticongost/woost.extensions.sitemap | woost/extensions/sitemap/sitemap.py | sitemap.py | py | 4,107 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "woost.models.Publishable",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "cocktail.schema.String",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "cocktail.schema",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "cockt... |
1355881538 | import asyncio
from datetime import datetime
from abc import ABC, abstractmethod
from evdev import UInput
from ev_core.config import Config
# CONSTANTS used by this file
STD_DELAY = 100e-3
LAST_ACCESSED = "last_accessed"
TRIGGER = "trigger"
FREQUENCY = "frequency"
TRIGGER_OFF = "trigger_off"
########################... | werpu/input_pipe | src/main/python/ev_core/drivers/basedriver.py | basedriver.py | py | 6,488 | python | en | code | 13 | github-code | 21 | [
{
"api_name": "abc.ABC",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "evdev.UInput",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "ev_core.config.Config",
"... |
13325961722 | from typing import List
def create_array(length: int = 1000) -> List[int]:
array = []
num = 1
while len(array) < length:
if not (num % 3 == 0 or str(num)[-1] == '3'):
array.append(num)
num += 1
return array
def main():
array = create_array()
t =... | victorborneo/Marathon-Problems | CodeForces/1560/A-Dislike_of_Threes.py | A-Dislike_of_Threes.py | py | 460 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 4,
"usage_type": "name"
}
] |
73036457013 | import unittest
import numpy
from cupy import testing
@testing.gpu
class TestContent(unittest.TestCase):
_multiprocess_can_split_ = True
@testing.for_float_dtypes()
@testing.numpy_cupy_array_equal()
def check_unary_inf(self, name, xp, dtype):
a = xp.array([-3, dtype('inf'), -1, -dtype('inf... | LiuFang816/SALSTM_py_data | python/pfnet_chainer/chainer-master/tests/cupy_tests/logic_tests/test_content.py | test_content.py | py | 879 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "cupy.testing.for_float_dtypes",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cupy.testing",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "cupy... |
71691495094 | """Test the Parse module"""
import pytest
from names import Names
from scanner import Scanner
from scanner import Symbol
from devices import Devices
from network import Network
from monitors import Monitors
from parse import Parser
file_no_errors = "testFiles/no_errors.txt"
file_errors = "testFiles/errors... | ClintonIgwegbu/Logic-Simulator | test_parse.py | test_parse.py | py | 7,868 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "names.Names",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "scanner.Scanner",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "devices.Devices",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "network.Network",
"li... |
70486929014 | import os
from os import path
import sys
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from django.core.files.base import ContentFile
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'buynsell.settings')
import django
django.setup()
import requests
from bs4 import BeautifulSoup
from trade.model... | Dokeey/Buy-Sell | util/crall.py | crall.py | py | 2,917 | python | en | code | 4 | github-code | 21 | [
{
"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.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
8269897070 | from collections import defaultdict
import sys
input = sys.stdin.readline
n, m, k = map(int, input().split())
array = [list(map(int, input().split())) for _ in range(n)]
result = [[5] * n for _ in range(n)]
tree = defaultdict(list)
for _ in range(m):
x, y, z = map(int, input().split())
tree[(x - 1, y - 1)].a... | s2lee/PS | BOJ/Simulation/16235.py | 16235.py | py | 1,286 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.stdin",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "collections.defaultdict",
"line_number": 10,
"usage_type": "call"
}
] |
15098545287 | import xml.etree.ElementTree as XML
import jenkins_jobs.modules.base
from jenkins_jobs.errors import JenkinsJobsException
import logging
import sys
import random
def archive(parser, xml_parent, data):
"""yaml: archive
Archive build artifacts
:arg str artifacts: path specifier for artifacts to archive
... | gtest-org/test11 | jenkins_jobs/modules/publishers.py | publishers.py | py | 128,529 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.SubElement",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 26,
"usage_type": "name"
},
{
"api_name... |
30444500412 | from typing import Iterable
import attr
import pandas as pd # type: ignore
from . import base
from . import utils
@attr.s(auto_attribs=True)
class Record(base.StatRecord):
"""StatRecord to store in DB."""
interval_start_timestamp: int
interval_end_timestamp: int
service_id: int
total_bytes: int... | perses76/ppc | ppc/kpi1.py | kpi1.py | py | 1,914 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "attr.s",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.Grouper",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "typing.Iterable",
"line_number": 57,
"usage_type": "name"
},
{
"api_name": "attr.astuple",
"line_number"... |
28552370554 | import numpy as np
import numpy.ma as ma
from scipy.special import eval_legendre, eval_chebyt
from enum import Enum
class BasisFunctions(Enum):
LEGENDRE1D = 0
LEGENDRE1DX = 1
LEGENDRE1DY = 2
ZERNIKE = 3
ZERNIKE_FRINGE = 3
ZERNIKE_OSA = 4
ZERNIKE_FRINGE_CONSTRAINED = 5
CHEBYSHEV = 6
def... | Gjjring/image_stack | src/imagestack/basis_functions.py | basis_functions.py | py | 8,238 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "enum.Enum",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "scipy.special.eval_chebyt",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "scipy.special.eval_legendre",
"line_number": 95,
"usage_type": "call"
},
{
"api_name": "scipy.... |
6542518784 | import numpy as np
import networkx as nx
import random
import pickle
def read_graph(path="./randomwalks/cn_assertions_filtered.tsv"):
'''
Reads the input network in networkx.
'''
G = nx.read_edgelist(path, nodetype=str, data=(('edge_type', str),), create_using=nx.DiGraph(), delimiter="\t")
for edge in G.edg... | Wluper/Retrograph | randomwalks_utility/random_walks.py | random_walks.py | py | 8,438 | python | en | code | 19 | github-code | 21 | [
{
"api_name": "networkx.read_edgelist",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "networkx.DiGraph",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
... |
38890142688 | from ..helper.auth_methods import AuthMethod
from ..model.containers import Containers
from ..model.readings import Readings
from ..model.notification import Notification
from ..model.users import User
from ..model.meal_ingredients import MealsIngredient
from ..model.meals import Meals
from ..model.shopping import Shop... | trustedcoder/smart_container_api | app/main/business/container_business.py | container_business.py | py | 28,081 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "model.users.User.decode_auth_token",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "model.users.User",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "model.containers.Containers.query.filter",
"line_number": 27,
"usage_type": "call"
... |
2655568391 | import sys
from collections import namedtuple
Segment = namedtuple('Segment', 'start end')
def optimal_points(segments):
points = []
# Get starts & ends of segments (easier to sort)
start = [s[0] for s in segments]
end = [s[1] for s in segments]
# Sort start, end so that element w leftmost start... | IAjimi/Data-Structures-and-Algorithms-Coursera | 1 - Algorithmic Toolbox/Week 3 - Greedy Algorithms/week3_part5_collecting_signatures.py | week3_part5_collecting_signatures.py | py | 1,082 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.namedtuple",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.stdin.read",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 32,
"usage_type": "attribute"
}
] |
29653540970 | from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.views.decorators.csrf import csrf_exempt
from apps.admin.utils.decorator import access_required
from apps.admin.utils.exception_handling import ExceptionHandler
from apps.public.views.forms import CheckoutForm
from apps.publ... | NobleSF/Cobra | apps/public/views/manual_checkout.py | manual_checkout.py | py | 2,480 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "apps.public.models.Cart.objects.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "apps.public.models.Cart.objects",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "apps.public.models.Cart",
"line_number": 18,
"usage_type": "name... |
5209518872 | """
download model weights to /data
wget -O - https://pyannote-speaker-diarization.s3.eu-west-2.amazonaws.com/data-2023-03-25-02.tar.gz | tar xz -C /
wget -P /data/whisper https://openaipublic.azureedge.net/main/whisper/models/d7440d1dc186f76616474e0ff0b3b6b879abc9d1a4926b7adfa41db2d497ab4f/medium.en.pt
# wget -P /data... | meronym/speaker-transcription | predict.py | predict.py | py | 7,296 | python | en | code | 70 | github-code | 21 | [
{
"api_name": "cog.BasePredictor",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "lib.audio.AudioPreProcessor",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pyannote.audio.pipelines.SpeakerDiarization",
"line_number": 29,
"usage_type": "call"
},
... |
74014009333 | # -*- coding: utf-8 -*-
import time
import tempfile
import subprocess
from fdfgen import forge_fdf
from c3smembership.gnupg_encrypt import encrypt_with_gnupg
from pyramid_mailer.message import (
Message,
Attachment,
)
DEBUG = False
#DEBUG = True
def generate_pdf(appstruct):
"""
this function receives... | AnneGilles/c3sMembership | c3smembership/utils.py | utils.py | py | 10,610 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "tempfile.NamedTemporaryFile",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tempfile.NamedTemporaryFile",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 31,
"usage_type": "call"
},
{
"api_name"... |
22810460556 | import json
import random
from typing import Callable, Generic, List, Type, TypeVar, Union
from fastapi.encoders import jsonable_encoder
from pydantic.tools import parse_raw_as
from pymongo.database import Database as MongoDB # type: ignore
from chafan_core.app import crud, models, schemas
from chafan_core.app.cache... | ctrln/chafan-core | chafan_core/app/recs/indexing.py | indexing.py | py | 5,566 | python | en | code | null | github-code | 21 | [
{
"api_name": "chafan_core.app.models.Site",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "chafan_core.app.models",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "random.sample",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": ... |
21809517022 | from __future__ import annotations
import rich.repr
from rich.align import Align
from rich.console import Group, RenderableType
from rich.padding import Padding
from rich.panel import Panel
from rich.style import Style
from rich.text import Text
from textual.reactive import Reactive
from textual.widget import Widget
... | chelnak/jenkins-tui | src/jenkins_tui/widgets/nav.py | nav.py | py | 2,575 | python | en | code | 25 | github-code | 21 | [
{
"api_name": "textual.widget.Widget",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "textual.reactive.Reactive",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "rich.text.Text",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "rich.t... |
7299692087 | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 10 12:33:37 2013
@author: Yuxiang Wang
"""
import numpy as np
import matplotlib.pyplot as plt
def main():
pass
if __name__ == '__main__':
main()
tip_name = ['d635', 'plate']
spec_list = [':sk', '-sk', ':ok', '-ok']
label_list = ["Gulati(1995): plate", "Mod... | yw5aj/HS2014 | fig/mag_curve.py | mag_curve.py | py | 1,349 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.a... |
18170611458 | # Tingbot App for listening to BBC Radio
#
# Requires mpg123:
# apt-get install mpg123
#
import tingbot
import json
import atexit
from tingbot import *
from subprocess import Popen, check_call
with open('stations.json') as stations_file:
stations = json.load(stations_file)
state = {
'station': 0,
'vol... | njh/bbcradio-tingapp | bbcradio.tingapp/main.py | main.py | py | 1,534 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "atexit.register",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "subprocess.Popen",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "subprocess.check_call... |
24666154451 | #!/bin/env python3.6
# Macros
########
CAMERA_INDEX=1
REFRESH_INTERVAL=0.01
velocity = 127
prevvar = 0
# Keymap
########
keymap = {
1:66,
2:68,
3:70,
4:71,
5:73,
6:75,
7:77,
8:78,
9:80,
10:82
}
# Import list
#############
# In[1]:
import time
impo... | dolaram/iSynth- | code/virtualkeyboard/music_vkeyboard_nomyo.py | music_vkeyboard_nomyo.py | py | 4,780 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.close",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 49,
"usage_type": "name"
},
{
"api_name": "fluidsynth.Synth",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "matplotlib... |
42734276515 | import json
custo = 0
with open("estoque.json", "r") as file:
conteudo = file.read()
produtos = json.loads(conteudo)["produtos"]
for prod in produtos:
quantidade = int(prod["quantidade"])
valor = float(prod["valor"])
custo += quantidade*valor
print(custo) | gabriellaec/desoft-analise-exercicios | backup/user_098/ch159_2020_06_22_18_57_29_273130.py | ch159_2020_06_22_18_57_29_273130.py | py | 294 | python | pt | code | 0 | github-code | 21 | [
{
"api_name": "json.loads",
"line_number": 7,
"usage_type": "call"
}
] |
35653755353 | from django.conf.urls import patterns, include, url
from mysite import settings
import views
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
('^hello/$', views.hello),
('^time/$', views.current_datetime),
('^welcome/$'... | judymou/cs145 | mysite/mysite/urls.py | urls.py | py | 1,338 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "views.hello",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "views.current_datetime",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "... |
25809173031 | import itertools
import pkg_resources
import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration
classes = (
'demoman',
'engineer',
'heavyweapons',
'medic',
'pyro',
'scout',
'sniper',
'soldier',
'spy'
)
events = {
'classkills': 'kill',
'classdeaths': 'dea... | Forty-Bot/trends.tf | trends/util.py | util.py | py | 1,140 | python | en | code | 13 | github-code | 21 | [
{
"api_name": "itertools.islice",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "pkg_resources.require",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pkg_resources.... |
30788112941 | """
File for computing statistics of heatmaps.
May eventually be merged into the explore interface.
"""
import requests
import numpy as np
import pylab as plt
from IPython import embed
from heatmaps.visualization import sCollapseToSrcName, applyCollapse
from heatmaps.services import LITERATURE_ID, TOTAL_TERM_ID... | tgbugs/heatmaps | stats.py | stats.py | py | 7,047 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "heatmaps.services.heatmap_service",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "heatmaps.services.summary_service",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "heatmaps.services.sortstuff",
"line_number": 14,
"usage_type": "call"... |
19609333740 | # -*- coding: utf-8 -*-
"""ORM Models for Wishlist entities."""
from __future__ import annotations
import uuid
from typing import Any, Dict, List
from pydantic import HttpUrl
from sqlalchemy.dialects.postgresql import UUID
from core.database.models.security import User
from core.services import get_product_name
from... | devalv/yawm | backend/core/database/models/wishlist.py | wishlist.py | py | 6,612 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "sqlalchemy.dialects.postgresql.UUID",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "core.database.models.security.User.id",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "core.database.models.security.User",
"line_number": 22,
"u... |
42217301555 | import sys
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QDialog, QApplication
from PyQt5.uic import loadUi
from PyQt5.QtGui import QPixmap
import sqlite3
class performance(QDialog):
def __init__(self):
super(performance, self).__init__()
loadUi("PERFOMANCE.ui",self)
self... | Myrausman/HUMAN-RESOURCE-MANAGEMENT-SYSTEM | Final Version/Actual code/interfaces/performance.py | performance.py | py | 3,423 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PyQt5.uic.loadUi",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidge... |
31356846196 | import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import itertools
from scipy.ndimage import imread
import functools
import tensorflow as tf
from .resnet_v1 import resnet_arg_scope, resnet_v1_50
from tensorflow.contrib import learn
from tensorflow.contrib.learn.python.learn.estimators imp... | tyler-romero/LandUseClassification | land_use/land_use_classification_utils.py | land_use_classification_utils.py | py | 14,636 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tensorflow.contrib",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "revoscalepy.RxSqlServerData",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "revoscalepy.rx_import",
"line_number": 33,
"usage_type": "call"
},
{
"api_nam... |
33886336497 | import os
import time
import json
from pyspark.sql import SparkSession
from pyspark.sql.types import *
from pyspark.sql.functions import *
from kafka_lib import delete_topic, compact_topic
spark = SparkSession\
.builder\
.appName("gaia")\
.getOrCreate()
spark.sql("SET spark.sql.shuffle.partitions=1"... | marmbrus/gaia | spark.py | spark.py | py | 5,521 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 11,
"usage_type"... |
21550389240 | # -*- coding: utf-8 -*-
from scrapy.pipelines.images import ImagesPipeline
import MySQLdb
import MySQLdb.cursors
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
# class FilmspiderPipeline(object):
... | orangelewis/CLOnline | apps/article/FilmSpider/FilmSpider/pipelines.py | pipelines.py | py | 1,361 | python | en | code | 7 | github-code | 21 | [
{
"api_name": "scrapy.pipelines.images.ImagesPipeline",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "MySQLdb.connect",
"line_number": 27,
"usage_type": "call"
}
] |
7441436252 | # -*- coding: utf-8 -*-
import json
import logging
from collections import OrderedDict
from .context import OrderedDictFormatter, JSONFormatter
import unittest
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
try:
str = unicode
except NameError:
pass
log_buffer = Stri... | pivotal-energy-solutions/json_log_handler | tests/test_logging.py | test_logging.py | py | 3,123 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "io.StringIO",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
... |
42112835319 | import cv2
import os
import sys
import re
import numpy as np
import matplotlib.pyplot as plt
eldir = "media/" + sys.argv[1]
#eldir = "media/afternoon"
if eldir.endswith("/") != True:
eldir = eldir + "/"
allfiles = os.listdir(eldir)
p = re.compile("[0-9]{1,2}.jpg$")
losfiles = [ i for i in allfiles if p.searc... | JavRoNu/Portofolio-Web-Rodil | pyscripts/reparing.py | reparing.py | py | 2,168 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 22... |
33635087983 | import MetaTrader5
import MetaTrader5 as mt5
import logging
from datetime import datetime
import pytz
from dateutil.relativedelta import relativedelta
class Trade:
def __init__(self):
if not mt5.initialize():
print("initialize() failed, error code =", mt5.last_error())
quit()
... | nerusm/MT5Monitor_EMACross_DBv1 | mt5monitor_dbv1/trade/test_trade.py | test_trade.py | py | 2,089 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "MetaTrader5.initialize",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "MetaTrader5.last_error",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "MetaTrader5.account_info",
"line_number": 17,
"usage_type": "call"
},
{
"api_name":... |
30638016410 | """
Solution for 325. Maximum Size Subarray Sum Equals k
https://leetcode.com/problems/maximum-size-subarray-sum-equals-k/
"""
from typing import List
class Solution:
"""
Runtime: 116 ms, faster than 95.36% of Python3 online submissions for Maximum Size Subarray Sum Equals k.
Memory Usage: 15.8 MB, less than 100... | KKosukeee/CodingQuestions | LeetCode/325_maximum_size_subarray_sum_equals_k.py | 325_maximum_size_subarray_sum_equals_k.py | py | 1,351 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 12,
"usage_type": "name"
}
] |
21229415750 | from Crypto.Util.number import *
from secret import flag
import json
def genkey():
p = getPrime(512)
q = getPrime(512)
e = 0x10001
n = p*q
return n,e
def enc(c,e,n):
c=ord(c)
return pow(c,e,n)
n,e=genkey()
f=open("flag.enc","w")
ciphertext = [ enc(flag[i],e,n) for i in range(len(flag)) ]
f.write("N = {}\ne... | an0n5urf/spybits-writeups | Easy p3asy/chall.py | chall.py | py | 386 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "secret.flag",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 24,
"usage_type": "call"
}
] |
7961867771 | import os
import sys
import copy
import numpy as np
import json
from tqdm import tqdm
from torchvision import transforms
import torch
from torch import nn
import traceback
sys.path.append(os.path.join("..","Preprocesamiento"))
from Preprocesamiento import Custom_Transforms
from Preprocesamiento.dataLoader import belug... | Abdigal1/belugas_classification | Train_utils/Multi_parameter_train.py | Multi_parameter_train.py | py | 7,884 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
74128340531 | import gc
import logging
import os
import shutil
import hydra
import torch
import torch.multiprocessing as mp
from omegaconf import OmegaConf
from comus.clustering import salient_objects_clustering, save_pseudolabels_saliency
from comus.semseg import eval_model, save_pseudolables_model, self_training
from comus.utils... | zadaianchuk/comus | comus/main.py | main.py | py | 2,254 | python | en | code | 19 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "omegaconf.OmegaConf.register_new_resolver",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "omegaconf.OmegaConf",
"line_number": 17,
"usage_type": "name"
},
{
"a... |
74534069813 | import argparse
import gzip
import os
import sys
import time
import cv2
import numpy
import tensorflow as tf
from PIL import Image
from six.moves import urllib
from six.moves import xrange
from nets import nets_factory
flags = tf.app.flags
flags.DEFINE_integer("epoch", 25, "Epoch to train [25]")
flags.DEFINE_integer(... | lesliejackson/YOLOv1_tensorflow | yolo_v1.py | yolo_v1.py | py | 13,502 | python | en | code | 15 | github-code | 21 | [
{
"api_name": "tensorflow.app",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.contrib",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "numpy.maximum",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "numpy.maxim... |
5447882546 | import pygame
import math
from random import randint
pygame.init()
spider_img = [pygame.image.load(f'/images/sprite/spider_{i}.png').convert_alpha() for i in range(1, 5)]
spit_img = [pygame.image.load(f'images/sprite/spit_{i}.png').convert_alpha() for i in range(1, 6)]
spit_bat_img = [pygame.image.load(f'images/sprite... | kolyasalubov/UA-12-10-23.PythonFundamentals | LitvischenkoYevhen/FP/main.py | main.py | py | 19,175 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.image.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
... |
72861651252 | from flask import Flask, render_template, redirect, request
import speech_recognition as sr
def contentPOST():
transcript = ""
if request.method == "POST":
print("FORM DATA RECEIVED Send Post Request")
if "file" not in request.files:
return redirect(request.url)
file = req... | yaolei/speech-recognition-and-translate | models/speechFeed.py | speechFeed.py | py | 767 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.request.method",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "flask.request.files",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "flask.r... |
9005337696 | from hashlib import sha256
from flask import Flask
# username, hash, [friends list], [public vs. private],
# friends list: [friend1-friend2-friend3-friend4]
import random
import smtplib
from email.mime.text import MIMEText
import random
def send_email(subject, body, sender, recipients, password):
msg = MIMEText(... | elijah-bae-raw/tartanhack | hackathon/user.py | user.py | py | 7,978 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "email.mime.text.MIMEText",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "smtplib.SMTP_SSL",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "email.mime.te... |
35485842863 | import numpy as np
from Masters.Funcs import *
import matplotlib.pyplot as plt
Mstar = 1.2e30
au = 1.496e11
year = 3.154e+7
#Setup
x='a'
a1=2.5*au
e1=0.998
s1=0
a2=2.4*au
e2=0.997
s2=1
def TPrecess(a,e):
Tp=0.15*((1-(e**2.))/(1-(0.999**2.)))*((a/au)**2.5) #in MYrs
wp = (2 * np.pi) / Tp
return (Tp,wp)
(Tp1,... | TomMCallingham/SpaggetiAstro | Masters/Relativty/Precession.py | Precession.py | py | 4,408 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.pi",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "numpy.arange",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot... |
14955961925 | import numpy as np
import sys
np.set_printoptions(threshold=sys.maxsize)
from tkinter import *
import random
import minesweeperAI1
import minesweeperAI2
import json
import argparse
# Here, we are creating our class, Window, and inheriting from the Frame
# class. Frame is a class from the tkinter module. (s... | gdwyer3/Minesweeper_ML | source/minesweeperGameEngine.py | minesweeperGameEngine.py | py | 15,271 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.maxsize",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "minesweeperAI1.AI1",
... |
10171584412 | from __future__ import print_function
from os import chdir, environ
from os.path import realpath, dirname
import sys
if sys.version_info.major < 3:
print("ERROR: FATSLiM needs python 3. Python 2 is not supported anymore.")
sys.exit(1)
from setuptools import setup, find_packages
from setuptools import Extension... | FATSLiM/fatslim | setup.py | setup.py | py | 9,171 | python | en | code | 19 | github-code | 21 | [
{
"api_name": "sys.version_info",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout",
"line_n... |
18197702442 | import os
import time
import psycopg2
from sqlalchemy import create_engine, exc
while True:
try:
if "DB_CONNECTION_STRING" in os.environ:
conn = create_engine(os.environ["DB_CONNECTION_STRING"]).connect()
if "PGDB_CONNECTION_STRING" in os.environ:
# conn = create_engine(
... | sahilGupta89/large_flask_app | large_app/python/wait_for_db.py | wait_for_db.py | py | 711 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
... |
4354685460 | import os
import logging
from pathlib import Path
from zipfile import ZipFile
DIRECTORY = Path(__file__).parents[2].joinpath('assets')
# start set logger block
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
formatter = logging.Formatter(
'[%(asctime)s %(levelname)s %(name)s:%(lineno)d]: %(mes... | jetarciaga/penbrothers-automation | app/scripts/zip_extract_handler.py | zip_extract_handler.py | py | 961 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "logging.Formatter",
... |
43050372947 | # -*- coding: utf-8 -*-
import numpy as np
from import_data import read_path
from keras.utils import np_utils
from sklearn.cross_validation import train_test_split
class Dataset:
def __init__(self, path_name):
#训练集
self.train_images = None
self.train_labels = None
#验证集
... | RoggerLuo/stock-node-spider | make_dataset.py | make_dataset.py | py | 2,839 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "import_data.read_path",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sklearn.cross_validatio... |
11380074897 | """medicine_list table create
Revision ID: f749ec59f00b
Revises: 6ca0f83d3545
Create Date: 2022-04-04 13:15:40.195689
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f749ec59f00b'
down_revision = '6ca0f83d3545'
branch_labels = None
depends_on = None
def upgr... | Arif-Badhon/echamber_backend | src/alembic/versions/f749ec59f00b_medicine_list_table_create.py | f749ec59f00b_medicine_list_table_create.py | py | 1,242 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "alembic.op.create_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
13048689973 | """Contains only code to display the attached picture in the GUI window.
"""
from tkinter import Tk, Label
from PIL import ImageTk, Image
root = Tk()
image = Image.open("wizard.jpg")
image = ImageTk.PhotoImage(image)
label = Label(root, image=image)
label.pack()
root.mainloop()
| Xag8031/Computer-Programming-2 | GUI Basics/program4.py | program4.py | py | 281 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tkinter.Tk",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PIL.ImageTk.PhotoImage",
"line_n... |
4806640432 | # Author:zqbin
# @Time:2023/10/10 14:14
# @Author:14988
# @Site:
# @File:demo04_test.py
# @Software:PyCharm
import pytest
import requests
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from jsonpath import jsonpath
def text_is_not_n... | FoXM999/ceniu | p96/ui_day04/demo04_test.py | demo04_test.py | py | 1,987 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "pytest.fixture",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "requ... |
11877028186 | __author = 'Robin'
from selenium import webdriver
import unittest
from selenium.common.exceptions import NoSuchElementException,TimeoutException
import traceback
class VisitSogouByChrome(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome()
def test_implicitlyWait(self):
url ... | johnsonliu33/SeleniumAuto | 二、WebDriver的API详解/36、隐式等待.py | 36、隐式等待.py | py | 834 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "se... |
13071434009 | #!/usr/bin/python
#############################################################################################################################################
# Saras
#
# Copyright (C) 2019, Mahendra K. Verma
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# m... | roshansamuel/saras_dev | tests/channelTest/checkChannel.py | checkChannel.py | py | 6,970 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.use",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 60,
"usage_type": "name"
},
{
"api_name": "matp... |
24711306023 | import taichi as ti
from taichi.math import vec2,vec3
from time import sleep
ti.init(arch = ti.cpu)
bg_color = (0.8,0.8,0.8)
max_ctrl_n,max_n = 100,10*2**10
radius = 0.01
CHAIKIN,BSPLINE3,POINT4=0,1,2
detail_names = ['Chaikin','3-order uniform BSpline','4-point interpolatory']
N = ti.field(ti.i32,1) # current... | PrinceNeZha/Graphics | Geometry/SubdivisionCurve.py | SubdivisionCurve.py | py | 3,545 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "taichi.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "taichi.cpu",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "taichi.field",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "taichi.i32",
"line_number"... |
21141420640 | import os
import zipfile
def zip_ya(start_dir):
start_dir = start_dir # 要压缩的文件夹路径
file_news = start_dir + '.zip' # 压缩后文件夹的名字
z = zipfile.ZipFile(file_news, 'w', zipfile.ZIP_DEFLATED)
for dir_path, dir_names, file_names in os.walk(start_dir):
f_path = dir_path.replace(start_dir, '') # 这一句很重... | wmpscc/ArxivDailyOverview | code/tools/zip_tools.py | zip_tools.py | py | 674 | python | en | code | 20 | github-code | 21 | [
{
"api_name": "zipfile.ZipFile",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "zipfile.ZIP_DEFLATED",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.walk",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.sep",
"line_nu... |
74534215732 | from rest_framework import routers
from . import views
router = routers.DefaultRouter()
router.register('user', views.UserViewSet)
router.register('fediuser', views.FediverseUserViewSet)
router.register('post', views.PostViewSet)
urlpatterns = [
routers.url(r'^me/$', views.myUserViewSet.as_view({'get': 'get'}), n... | YuzuRyo61/CrossPlan | restAPI/urls.py | urls.py | py | 365 | python | en | code | 8 | github-code | 21 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "rest_framework.routers",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "rest_framework.routers.url",
"line_number": 10,
"usage_type": "call"
},
{
... |
403134553 | import re
from PySide2.QtWidgets import QSpinBox
from typing import Optional
from livia.process.analyzer.FrameAnalyzerMetadata import FrameAnalyzerPropertyMetadata
from livia_ui.gui.configuration.widgets.WidgetFactory import WidgetFactory, WidgetWrapper
class IntWidgetWrapper(WidgetWrapper[int]):
def __init__(se... | sing-group/livia-ui | livia_ui/gui/configuration/widgets/IntWidgetFactory.py | IntWidgetFactory.py | py | 1,351 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "livia_ui.gui.configuration.widgets.WidgetFactory.WidgetWrapper",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PySide2.QtWidgets.QSpinBox",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "livia_ui.gui.configuration.widgets.WidgetFactory.WidgetF... |
34528057691 | import pickle
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.shortcuts import render_to_response
from google.appengine.ext import db
from google.appengine.api import users
from stats import models
def index(request):
return list(request)
def add(request, id, key, value):
char... | damonkohler/statsmonkey | stats/views.py | views.py | py | 1,419 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "stats.models.Chart.get_or_create",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "stats.models.Chart",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "stats.models",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": ... |
1132283353 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
path = "Korea_Data.xlsx"
df = pd.read_excel(path,index_col = 0,names = ["age","population","births","deaths"],skiprows = 1)
dfName = pd.read_excel(path,usecols=[0],names = ["name"],skiprows = 1)
ageName = np.array(dfName["name"])
femaleSize = np.... | Lylilaaaa/pythonwork | hw3_119010162.py | hw3_119010162.py | py | 2,864 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_excel",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_... |
17681435047 | """Unit tests for the OpenWeatherMap provider."""
import os
import pytest
from wxdat.providers import openweather
@pytest.fixture(scope="module")
def vcr_config():
return {
"filter_query_parameters": ["appid"],
}
@pytest.fixture(scope="function")
def station():
"""Return a configured Ambient ... | jheddings/wxdat | tests/test_openweather.py | test_openweather.py | py | 1,180 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "pytest.fixture",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pytest.skip",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "wxdat.providers.openweather.Stat... |
14431487241 | import os
from canvasapi import Canvas
import janitor
from pprint import pprint
from joblib.parallel import Parallel, delayed
import requests
import re
import pandas as pd
STUDENT_CSV = '/Users/vmasrani/dev/phd/teaching/553/grading/students.csv'
def pmap(f, arr, n_jobs=-1, prefer='threads', verbose=10):
return Pa... | plai-group/canvas_grading_tools | canvas_upload.py | canvas_upload.py | py | 4,798 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "joblib.parallel.Parallel",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "joblib.parallel.delayed",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name":... |
22167962214 | import numpy as np
import os
import sys
import random
import torch
from torchvision import transforms
import cv2
from kernelphysiology.dl.pytorch.vaes import model as vqmodel
from kernelphysiology.dl.pytorch.utils.preprocessing import inv_normalise_tensor
from kernelphysiology.transformations import colour_spaces
f... | ArashAkbarinia/kernelphysiology | python/src/kernelphysiology/dl/experiments/panoptic/predict_imagenet.py | predict_imagenet.py | py | 11,787 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "torchvision.datasets.ImageFolder",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "torchvision.datasets",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "numpy.asarray",
"line_number": 45,
"usage_type": "call"
},
{
"api_name... |
19971300144 | import torch
import torch.nn as nn
import torch.nn.functional as F
import aux_funcs as af
import model_funcs as mf
class Block(nn.Module):
'''Depthwise conv + Pointwise conv'''
def __init__(self, in_channels, out_channels, stride=1):
super(Block, self).__init__()
conv_layers = []
conv... | vf0rk/sdn_attack | architectures/CNNs/MobileNet.py | MobileNet.py | py | 3,631 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
18956376511 | import os
import sys
import cPickle
import multiprocessing
import logging
log = logging.getLogger("nice.se")
log_stats = logging.getLogger("stats")
import utils
from stats import getStats
stats = getStats()
import config_parser as config
SE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "../sym_exec"))... | mcanini/nice | nice/sym_exec.py | sym_exec.py | py | 6,430 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "stats.getStats",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
... |
12918015149 | # COMP 4107, Fall 2018
# Assignment 1, Question 1
#
# Jules Kuehn
# 100661464
#
# Yunkai Wang
# 100968473
import numpy as np
import scipy.linalg as sp
from scipy.spatial import KDTree
'''
matrix of A by users for items
copied from lecture note 'linear algebra'
page 49
'''
A = np.array([
[3, 1, 2, 3],
[4, 3, 4... | juleskuehn/comp4107 | A1/submission/q1-fixed.py | q1-fixed.py | py | 2,109 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "scipy.linalg.svd",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "scipy.linalg",
"line_num... |
3198625508 | from django import forms
from django.core.exceptions import ValidationError
from django_filters import DateFilter
from allauth.account.forms import SignupForm
from django.contrib.auth.models import Group
from .models import Post
class PostForm(forms.ModelForm):
header = forms.CharField(min_length=3)
time_post... | IstominDanil/NewPortal | NewPortal/news/forms.py | forms.py | py | 1,264 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.... |
17673386391 | # -*- mode:python; coding:utf-8; -*-
# author: Eugene Zamriy <ezamriy@cloudlinux.com>
# created: 2018-10-07
"""build_node.build_node_config module unit tests."""
import platform
import os
from pyfakefs.fake_filesystem_unittest import TestCase
import yaml
from build_node.build_node_config import BuildNodeConfig
__a... | AlmaLinux/albs-node | tests/build_node/build_node_config_test.py | build_node_config_test.py | py | 2,799 | python | en | code | 8 | github-code | 21 | [
{
"api_name": "pyfakefs.fake_filesystem_unittest.TestCase",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "platform.node",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.expanduser",
"line_number": 23,
"usage_type": "call"
},
{
"api_n... |
29358265051 | from imutils import paths
import face_recognition
import pickle
import cv2
import os
def setup():
# setup paths for directiories and pickle file (dataset)
dataset = "./data_fetch"
dataset_old = "./src_sync_data/datasets/dataset_old"
pkl_file = "./src_sync_data/datasets/encodings.pkl"
return dataset... | pryjmi/BP_2023 | piApp/src_sync_data/datasets/encode_faces.py | encode_faces.py | py | 3,004 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "imutils.paths.list_images",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "imutils.paths",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
... |
7415206062 | from sklearn import tree
from sklearn.naive_bayes import GaussianNB
from sklearn.neighbors import KNeighborsClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score
import numpy as np
#[height, weight, shoe size]
X = [[181, 80, 44], [177, 70, 43], [160, 60, 38], [154, 5... | Lena365/Python_for_Data_Science_Siraj | gendre_prediction_demo.py | gendre_prediction_demo.py | py | 1,829 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sklearn.tree.DecisionTreeClassifier",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.tree",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "sklearn.naive_bayes.GaussianNB",
"line_number": 20,
"usage_type": "call"
},
{
"a... |
38358491172 | #!/usr/bin/env python
from collections import OrderedDict
from importlib import import_module
from jinja2 import Environment, FileSystemLoader
import properties
try:
from properties_inheritance_graph import make_graph
import nxpd
except ImportError:
print('Graphs will not be rendered in docs')
# --------... | seequent/lfview-resources-scene | docs/scripts/build_docs.py | build_docs.py | py | 3,540 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "lfview.resources.scene.scene",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "lfview.resources.scene",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "lfview.resources.scene.slide",
"line_number": 23,
"usage_type": "attribute"
},... |
23340436290 | import os
from six import iteritems
from itertools import product
import pandas as pd
import pypsa
from add_electricity import load_costs, update_transmission_costs
idx = pd.IndexSlice
opt_name = {"Store": "e", "Line" : "s", "Transformer" : "s"}
def assign_carriers(n):
if "carrier" not in n.loads:
n.l... | PyPSA/pypsa-za | scripts/make_summary.py | make_summary.py | py | 15,067 | python | en | code | 12 | github-code | 21 | [
{
"api_name": "pandas.IndexSlice",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pandas.Series",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pandas.MultiIndex.from_product",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "p... |
38223189466 | #! /Users/mhb/anaconda3/envs/gridmaps2/bin/python
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import cartopy.io.shapereader as shpreader
import datetime as dt
import maidenhead as mh
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import sqlite3
# Covert X,Y coordina... | mihobu/ham-radio | great-circle-map/genmap-allqsos.py | genmap-allqsos.py | py | 6,761 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cartopy.crs.PlateCarree",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cartopy.crs",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "sqlite3.connect",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame"... |
15098556047 | import xml.etree.ElementTree as XML
import jenkins_jobs.modules.base
from jenkins_jobs.modules.builders import create_builders
def timeout(parser, xml_parent, data):
"""yaml: timeout
Abort the build if it runs too long.
Requires the Jenkins `Build Timeout Plugin.
<https://wiki.jenkins-ci.org/display/J... | gtest-org/test11 | jenkins_jobs/modules/wrappers.py | wrappers.py | py | 30,070 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "xml.etree.ElementTree.SubElement",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 49,
"usage_type": "name"
},
{
"api_name": "xml.etree.ElementTree.SubElement",
"line_number": 52,
"usage_type": "call"
},
... |
42044339938 | # 1
a = ('Time is money ')
b = ('No money - no honey.')
c = []
for i in a:
for j in b:
if i == j:
c.append(i)
break
print(c)
print()
# 2
from collections import Counter
str = 'Life is series of choices.'
s = tuple(str)
print(dict(Counter(s)))
print()
# 3
temp = (24, 25, 24, 23... | Alex404err0r/v90-academy-homeworks | hw-5-tuple/main.py | main.py | py | 480 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "collections.Counter",
"line_number": 22,
"usage_type": "call"
}
] |
40549590322 | from copy import deepcopy
from datetime import datetime
from unittest.mock import MagicMock
from uuid import uuid4
import mongomock
import pytest
from common.types import SocketAddress
from monkey_island.cc.models import Agent
from monkey_island.cc.repositories import (
IAgentRepository,
MongoAgentRepository,... | guardicore/monkey | monkey/tests/unit_tests/monkey_island/cc/repositories/test_mongo_agent_repository.py | test_mongo_agent_repository.py | py | 7,444 | python | en | code | 6,367 | github-code | 21 | [
{
"api_name": "uuid.uuid4",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "monkey_island.cc.models.Agent",
... |
70445529333 | from bokeh.plotting import figure, ColumnDataSource
from utils import get_population_data, save_bokeh
from bokeh.models import HoverTool, NumeralTickFormatter, Legend
from bokeh.palettes import Category10_10
# Read the data and choose its subset
data = get_population_data("../data/clean_data.csv")
source ... | zofiakk/DAV | lab8/scripts/bokeh_plot1_data1.py | bokeh_plot1_data1.py | py | 1,779 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "utils.get_population_data",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bokeh.plotting.ColumnDataSource",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bokeh.plotting.figure",
"line_number": 14,
"usage_type": "call"
},
{
"ap... |
73038733493 | from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
from sklearn.preprocessing import LabelEncoder
def binary_ks_curve(y_true, y_probas):
"""This function generates the points necessary to calculate the KS Statistic curve.
Args:
y_true (array-like, sh... | LiuFang816/SALSTM_py_data | python/reiinakano_scikit-plot/scikit-plot-master/scikitplot/helpers.py | helpers.py | py | 3,666 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "numpy.asarray",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.sort",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.sor... |
23504009985 | import scanpy as sc
import anndata as ad
from scipy import sparse
import pandas as pd
def draw_tsne(data, title, color):
"""
Visualization of prediction using tSNE Algorithm.
Parameters
----------
data: Anndata
Anndata for visualization.
title: str
title of pictur... | BioX-NKU/scButterfly | scButterfly/draw_cluster.py | draw_cluster.py | py | 3,419 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "scanpy.settings.set_figure_params",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "scanpy.settings",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "scanpy.pp.pca",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "... |
11848630034 | from google.oauth2 import service_account
from google.cloud import bigquery
import pandas as pd
import numpy as np
from sklearn import preprocessing
client = bigquery.Client(project="dataminingproject-364904")
print('fetching zillow data')
#Print your current data
for dataset in client.list_datasets():
print(datase... | bhargavpshah98/Data-Mining | test.py | test.py | py | 1,052 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "google.cloud.bigquery.Client",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "google.cloud.bigquery",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "skl... |
18174880488 | """
This script will map the digits dataset to two dimensions using
PCA, and then render the transformed datapoints to a scatterplot.
"""
from sklearn.decomposition import PCA
import pandas as pd
import matplotlib.pyplot as plt
def main():
train = pd.read_csv('data/digits/train.csv')[:10000]
Y = train['label... | njhazelh/MachineLearning | hw3/2d_pca.py | 2d_pca.py | py | 613 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.decomposition.PCA",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "m... |
26411625432 | from mtgaobjects import MtgaDeck, MtgaMatch, BLANK_TILE
##########################################################################
## Lib handling the additional functions like fetching visuals, etc. from external sources
##
## Main API: https://scryfall.com/docs/api/cards/arena
#
import requests
import json
import ti... | AlanFromJapan/MTGA-experiments | mtganalyzer/mtgalib.py | mtgalib.py | py | 1,840 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "mtgaobjects.BLANK_TILE",
"line... |
35898354452 | import discord, random, argparse, os.path, itertools, traceback
import numpy as np
from socket import timeout
from discord.ext import commands as bot
from fehwiki_parse import *
from difflib import SequenceMatcher
import feh_cache
class MagikarpJump:
"""The game we don't play anymore."""
def __init__(self, ... | monkeybard/lukas-bot | utilities.py | utilities.py | py | 52,270 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "discord.ext.commands",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "random.choice",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.command",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "disco... |
23837201280 | """
Imports data from Tableau Dashboard into the database. This assumes the database has been created with the proper
models and the data exist in the project directory in /ubc-pair-grade-data.
"""
from app import create_app
from config import Config
from app.models import TableauDashboardGrade, Subjects
import unitte... | DonneyF/ubcgrades | app/tests/db_relationships.py | db_relationships.py | py | 1,094 | python | en | code | 27 | github-code | 21 | [
{
"api_name": "unittest.TestCase",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "app.create_app",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "config.Config",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "app.app_conte... |
74793137333 | from scipy import stats
def sign_test(data1, data2, alpha, method='single'):
if len(data1) != len(data2) or (method != 'single' and method != 'double'):
print('两组数据维数不同,无法进行计算!\n')
return None
# 单总体分位数符号检验
def sign_single_test(data, mu0):
n = len(data)
n_posi = 0
f... | EricGao-Byte/My_Python_Practice | 数据分析代码/第二章 非参数秩方法/ex2.2.py | ex2.2.py | py | 1,756 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "scipy.stats.binom",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scipy.stats",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "scipy.stats.binom",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "scipy.stats",
"li... |
8128174420 | import os
from PIL import Image
import pytesser
def preprocess(image_path):
with Image.open(image_path) as im:
i = 0
mypalette = im.getpalette()
home = os.path.abspath(os.path.dirname(image_path))
try:
while 1:
im.putpalette(mypalette)
n... | huangy10/PatentData2 | pytesser/test.py | test.py | py | 2,947 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "PIL.Image.open",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "os.path.abspath",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 1... |
72721329974 | import pytest
import os, sys
import logging
from collections import namedtuple
import numpy as np
from datastream import data_type, parse_data
TRACEBACK_FMT = 'File "%(pathname)s", line %(lineno)d:'
# logging.basicConfig(stream=sys.stdout, filemode='w', level=logging.INFO, format='%(name)s:%(funcName)s:line %(lineno)d... | timjolson/datastream | tests/test_parse_data.py | test_parse_data.py | py | 1,691 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.basicConfig",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "logging.DEBUG",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "logging.info",... |
5939584959 | ###############
#MODELO 1
###############
import sys,pygame,math
from random import randint
#Clase
class Pieza:
def __init__(self, px,py,flow, angle,lon,sz,width,show,adj):
self.px = px
self.py = py
self.flow = flow
self.angle = angle
self.lon = lon
self.lonx... | jeslev/Numerico2014I | Parcial/sistema.py | sistema.py | py | 6,740 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "math.cos",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "math.radians",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "math.sin",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "math.radians",
"line_number": 19,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.