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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
23228731915 | import sys
import time
import random
import pygame
from event_listener import event_listener
from functions import render_all, one_dimensional_list, update_frames
sys.path.insert(1, 'player')
from yoshi import Yoshi
from movement import move_all, set_direction, move
sys.path.insert(1, 'eggs')
from egg import Egg
... | mignoe/Games | yoshi-snake-game/game.py | game.py | py | 2,214 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "sys.path.insert",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.path.insert",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_nu... |
27239543439 | # from django.shortcuts import render
from django.views.generic import ListView, DetailView, UpdateView, CreateView, DeleteView # импортируем класс, который говорит нам о том, что в этом представлении мы будем выводить список объектов из БД
from .models import Post
from datetime import datetime
from .filters import Po... | pvlrmv/newspaper | NewsPaper/news/views.py | views.py | py | 4,311 | python | ru | code | 0 | github-code | 36 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "models.Post",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "models.Post.objects.order_by",
"line_number": 18,
"usage_type": "call"
},
{
"api_name":... |
22985216912 | from collections import deque
from threading import Thread
class Sequencer:
def __init__(self, name):
self.name = name
self.file = open(name, "wb")
self.queue = deque()
self.running = False
self.byte_sequence = []
self.thread = Thread(target=self._writer_thread)
... | muthuprabhu-kp/FTOU | Server/ByteSequencer.py | ByteSequencer.py | py | 2,482 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 12,
"usage_type": "call"
}
] |
11303986062 | from enum import Enum
import logging
from pathlib import Path
from transitions import Machine
from ..config import ALBUM_FOLDER_NAME_TEMPLATE
from ..config import MUSIC_PATH_NAME
from ..config import TRACK_FILE_NAME_TEMPLATE
from ..config import VA_ALBUM_FOLDER_NAME_TEMPLATE
logger = logging.getLogger(__name__)
c... | pisarenko-net/cdp-sa | hifi_appliance/state/ripper.py | ripper.py | py | 5,818 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "config.MUSIC_PATH_NAME",
... |
35658675778 | """The emails tests module."""
import pytest
from tests.fixtures.auth import USER_EMAIL
from communication.notifications.email import mail_managers, mail_user
from users.models import User
pytestmark = pytest.mark.django_db
def test_mail_managers(mailoutbox):
"""Should send an email to the system managers."""
... | webmalc/d8base-backend | communication/tests/email_tests.py | email_tests.py | py | 1,000 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pytest.mark",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "communication.notifications.email.mail_managers",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "users.models.User",
"line_number": 22,
"usage_type": "name"
},
{
... |
31482133421 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | pamarquez/pipelineHW | components/aws/sagemaker/batch_transform/src/batch_transform.py | batch_transform.py | py | 2,183 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "common._u... |
31474544931 | #!/home/apollo/anaconda3/bin/python3
#-*- coding: utf-8 -*-
#******************************************************************************
# Author : jtx
# Create : 2020-03-31 19:05
# Last modified: 2020-04-09 14:18
# Filename : patent_kbp.py
# Description : 专利-->企业 关系添加
#*****************************... | RogerJTX/KbpPipeline_ExpertSystem | patent/patent_relation.py | patent_relation.py | py | 10,621 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path.dirna... |
16129130585 | # from pandas import *
# from pylab import *
# import numpy as np
# from matplotlib import pyplot as plt
# mpl.rcParams['font.sans-serif'] = ['SimHei'] # 加载中文字体的神奇呀
# idx = Index(np.arange(1,7))
# df = DataFrame(np.random.randn(6, 2), index=idx, columns=['', 'count'])
# valss = np.array([['总数', 100], ['嘿嘿', 10], ['流皮'... | czasg/ScrapyLearning | czaSpider/dump2/数据分析个人版/诚信数据咯/画图抱佛脚.py | 画图抱佛脚.py | py | 7,890 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "numpy.arange",
"line_number": 143,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 145,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 145,
"usage_type": "name"
},
{
"api_name": "numpy.ar... |
27278263299 | import redis
class RedisClient:
def __init__(self):
self.client = redis.Redis(
host='127.0.0.1',
port=6379,
db=0
)
def db_health(self):
if self.client.ping():
print("PONG")
else:
print("Connection failed to db")
| kliu2python/allsee | utils/redis_client.py | redis_client.py | py | 315 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "redis.Redis",
"line_number": 6,
"usage_type": "call"
}
] |
28786462902 | import pandas as pd
import geopandas as gpd
import osmnx as ox
from h3 import h3
from rich.progress import track
from urbanpy.utils import geo_boundary_to_polygon
from typing import Sequence, Union
__all__ = [
"merge_geom_downloads",
"filter_population",
"remove_features",
"gen_hexagons",
"merge_sh... | EL-BID/urbanpy | urbanpy/geom/geom.py | geom.py | py | 15,013 | python | en | code | 85 | github-code | 36 | [
{
"api_name": "typing.Sequence",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "geopandas.GeoDataFrame",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "geopandas.GeoDataFrame",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "pa... |
17849746047 | from .data_metabolite_to_standard_name_dict import data_metabolite_to_standard_name_dict
from ..complete_dataset_class import CompleteDataset, natural_distribution_anti_correction, check_negative_data_array
from scripts.src.common.config import DataType, Direct, Keywords as CommonKeywords
from ..common_functions import... | LocasaleLab/Automated-MFA-2023 | scripts/data/renal_carcinoma/specific_data_parameters.py | specific_data_parameters.py | py | 5,412 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "c13_glucose_enrichment_plasma.glucose_enrichment_plasma_dict",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "config.default_glucose_infusion_labeled_ratio",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "common_functions.glucose_infusion_inpu... |
26469617014 | from ....key import Address
from ....hint import MBC_USER_STATISTICS, MBC_VOTING_CANDIDATE
from ....common import Int, MitumFactor, _hint, concatBytes
class Candidate(MitumFactor):
def __init__(self, address, nickname, manifest, count):
assert len(manifest) <= 100, 'manifest length is over 100! (len(manif... | ProtoconNet/mitum-py-util | src/mitumc/operation/document/blockcity/base.py | base.py | py | 2,222 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "common.MitumFactor",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "common._hint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "hint.MBC_VOTING_CANDIDATE",
"line_number": 9,
"usage_type": "argument"
},
{
"api_name": "key.Addres... |
9340019814 | # -*- coding: utf-8 -*-
"""
Created on Sat Oct 21 11:01:53 2017
@author: PiotrTutak
"""
import numpy as np
import scipy.linalg as lg
import matplotlib.pyplot as plt
print("Podaj L1 L2 L3 L4")
L=[float(x) for x in input().strip().split()]
print('Podaj k S q alfa tInf')
k,S,q,alfa,tInf=(float(x) for x in input().stri... | ptutak/MES | zad01.py | zad01.py | py | 748 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.array",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "scipy.linalg.solve",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "scipy.linalg",
"line_n... |
1298646891 | from moviepy.editor import *
import os
from natsort import natsorted
L =[]
for root, dirs, files in os.walk("D:\\Sujay\\German\\Best Way to Learn German Language-Full Beginner Course-A1.1\\New folder"):
#files.sort()
files = natsorted(files)
for file in files:
if os.path.splitext(file)... | Sujay-Mhaske/Join-video | vid_join.py | vid_join.py | py | 565 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.walk",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "natsort.natsorted",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
21052629609 | import requests
from bs4 import BeautifulSoup
import json
tokens = []
for x in range(1, 12):
result = requests.get("https://etherscan.io/tokens?p=" + str(x))
c = result.content
soup = BeautifulSoup(c, "html.parser")
samples = soup.find_all("tr")
for sample in samples:
try:
... | markchipman/inklin | get_tokens.py | get_tokens.py | py | 673 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 25,
"usage_type": "call"
}
] |
32829769716 | from collections import deque
# BFS 함수 정의
def bfs(sx, sy, ex, ey):
# 시작 지점이 목표 지점과 같은 경우, 함수 종료
if sx == ex and sy == ey:
return
queue = deque([(sx, sy)])
# 나이트가 움직일 수 있는 방향 벡터 정의
dx = [-2, -1, 1, 2, 2, 1, -1, -2]
dy = [1, 2, 2, 1, -1, -2, -2, -1]
while queue:
x, y = queu... | veluminous/CodingTest | 백준 실전 문제/[백준 7562 DFS&BFS] 나이트의 이동.py | [백준 7562 DFS&BFS] 나이트의 이동.py | py | 1,306 | python | ko | code | 0 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 9,
"usage_type": "call"
}
] |
70811192105 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
import logging
import datetime
from google.appengine.api import xmpp
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.api import taskqueue
import gaetalk
import config
import utils
class XMPPSub(web... | lilydjwg/gaetalk | chatmain.py | chatmain.py | py | 4,035 | python | en | code | 22 | github-code | 36 | [
{
"api_name": "google.appengine.ext.webapp.RequestHandler",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.ext.webapp",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "gaetalk.try_add_user",
"line_number": 19,
"usage_type": "call... |
43823721553 | import json
import random
import re
import os
import time
from concurrent.futures import ThreadPoolExecutor, as_completed
from tqdm import tqdm
import requests
from template import *
proxies = {
'http': '127.0.0.1:9898',
'https': '127.0.0.1:9898',
}
ori_keys = json.load(open("../../data/120_key1.json"))
keys ... | bigdante/nell162 | backup/verification/chatgpt_gen_yes_no/utils.py | utils.py | py | 5,313 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 36,... |
74704594025 | import pandas as pd
import numpy as np
import regex as re
# the usual import horror in python
# https://stackoverflow.com/questions/35166821/valueerror-attempted-relative-import-beyond-top-level-package
from ...config.config import Config
class ExperimentalPlan:
'''
Class for creating an experimental Plan bas... | csRon/autodoe | src/preProcessor/experimentalPlans/experimentalPlan.py | experimentalPlan.py | py | 6,290 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "config.config.Config",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "config.config.planType",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "config.config",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "numpy.... |
3276810925 | from django.contrib.auth import get_user_model
from django.db.models import F, Sum
from django.http.response import HttpResponse
from django_filters.rest_framework import DjangoFilterBackend
from djoser.views import UserViewSet as DjoserUserViewSet
from recipes.models import (AmountIngredientRecipe, Favorite, Follow,
... | MihVS/foodgram-project-react | backend/foodgram/api/views.py | views.py | py | 7,796 | python | ru | code | 0 | github-code | 36 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "djoser.views.UserViewSet",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "rest_framework.generics.get_object_or_404",
"line_number": 40,
"usage_type": ... |
72136189865 | import os
from flask import jsonify, current_app
from flask_mail import Message
from werkzeug.utils import secure_filename
from PIL import Image
from api import mail
QUESTIONS_PER_PAGE = 5
def paginator(request, data):
page = request.args.get("page", 1, type=int)
start = (page - 1) * QUESTIONS_PER_PAGE
... | dennisappiah/pong-game-api | api/utils.py | utils.py | py | 1,591 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "werkzeug.utils.secure_filename",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "flask.curren... |
43471363833 | import pandas as pd
import numpy as np
# from sklearn.linear_model import LogisticRegression
# from omegaconf import DictConfig, OmegaConf
from loguru import logger
import joblib
import click
# from dataclasses import dataclass
# from hydra.core.config_store import ConfigStore
# from sklearn.pipeline import Pipeline... | made-mlops-2022/mlops-andrey-talyzin | ml_project/src/models/predict_model.py | predict_model.py | py | 1,397 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "loguru.logger.info",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "pandas.read_csv",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "joblib.load",
"l... |
28451867185 | from rest_framework import serializers
from core.models import Tag,Ingredient
class TagSerializers(serializers.ModelSerializer):
'''serializer for the object'''
class Meta:
model = Tag
fields = ('id', 'name')
read_only_fields = ('id',)
class IngredientSerializer(serializers.ModelSeria... | Manu1John/recipe-app-api | app/recipe/serializers.py | serializers.py | py | 486 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "core.models.Tag",
"line_number": 8,
"usage_type": "name"
},
... |
15853176936 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import warnings
import unittest
from collections import OrderedDict
from w3lib.form import encode_multipart
class EncodeMultipartTest(unittest.TestCase):
def test_encode_multipart(self):
data = {'key': 'value'}
with warnings.catch_war... | bertucho/epic-movie-quotes-quiz | dialogos/build/w3lib/tests/test_form.py | test_form.py | py | 2,473 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "warnings.catch_warnings",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "w3lib.form.encode_multipart",
"line_number": 14,
"usage_type": "call"
},
{
"api_nam... |
38591539805 | from elasticsearch import Elasticsearch
from search import search_user_query
class ESClient:
def __init__(self):
self.es = Elasticsearch("http://localhost:9200")
def extract_songs(self, resp):
songs = []
hits = resp["hits"]["hits"]
for i in range(len(hits)):
songs.append(hits[i]["_source"])
... | PasinduUd/metaphor-based-search-engine | API/es_client.py | es_client.py | py | 2,414 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "search.search_user_query",
"line_number": 67,
"usage_type": "call"
}
] |
27792793140 | import random
import os
from model import *
from world import *
import numpy as np
import torch
import matplotlib.pyplot as plt
from datetime import datetime
mem, nomem, mem_vd, nomem_vd = [False, False, False, False]
mem = True
env_title = 'Tunl Mem'
if mem or nomem:
ld = 40
elif mem_vd or nomem_vd:
len_dela... | dongyanl1n/sim-tunl | run.py | run.py | py | 7,488 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "torch.optim.Adam",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "torch.optim",
"line_number": 85,
"usage_type": "attribute"
},
{
"api_name": "numpy.float32",
"line_number": 93,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros_like... |
22163631798 | #!/usr/bin/env python
import csv
import gzip
import json
import os
import re
import sys
import pathlib
import sqlite3
from shapely.geometry import Polygon
from sqlite3 import Error
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
DATA_DIR = os.path.join(SCRIPT_DIR, os.path.join('..', '..', 'outputs', 'butte')... | typpo/ca-property-tax | scrapers/butte/create_parcels_db.py | create_parcels_db.py | py | 4,941 | python | en | code | 89 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
570436896 | import logging
from .geomsmesh import geompy
def sortFaces(facesToSort):
"""tri des faces par surface"""
logging.info('start')
l_surfaces = [(geompy.BasicProperties(face)[1], i, face) for i, face in enumerate(facesToSort)]
l_surfaces.sort()
facesSorted = [face for _, i, face in l_surfaces]
return facesSo... | luzpaz/occ-smesh | src/Tools/blocFissure/gmu/sortFaces.py | sortFaces.py | py | 362 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "logging.info",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "geomsmesh.geompy.BasicProperties",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "geomsmesh.geompy",
"line_number": 8,
"usage_type": "name"
}
] |
5668664706 | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import numpy as np
import sklearn.metrics as metrics
import seaborn as sns
from mosaic import features
from mosaic import contexts
from mosaic import image_io
from mosaic import plots
from mosaic import data... | joshloyal/Mosaic | mosaic/grid/scatter_grid.py | scatter_grid.py | py | 4,542 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "mosaic.features.minmax_scale",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "mosaic.features",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "mosaic.features.minmax_scale",
"line_number": 44,
"usage_type": "call"
},
{
"api_nam... |
35127026935 | import os
import numpy as np
import pickle
from dataclasses import dataclass
import itertools
from multiprocessing import Pool
import PIL
from noise_reducers.grayscale_gibbs_noise_reducer import GrayscaleGibbsNoiseReducer
from noise_reducers.grayscale_gradient_noise_reducer import GrayscaleGradientNoiseReducer
from no... | Dawidsoni/noise-reduction | noise-reduction/generate_grayscale_statistics.py | generate_grayscale_statistics.py | py | 4,224 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "dataclass... |
41047380685 | """By: Xiaochi (George) Li: github.com/XC-Li"""
import xml.etree.ElementTree as ET
from xml.etree.ElementTree import ParseError
from bs4 import BeautifulSoup
def bs_parser(file_name, target_id):
"""
XML Parser implemented by Beautiful Soup Package
Args:
file_name(str): path to the document
... | XC-Li/FiscalNote_Project | deployment/util_code/xml_parser.py | xml_parser.py | py | 5,003 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "x... |
41561590327 | from api.core.workflow import workflow
from flask import request
import api.DAL.data_context.admin.user_update as user_update
import api.DAL.data_context.admin.user_insert as user_insert
import api.DAL.data_context.admin.user_select as user_select
from api.core.admin.credentials import Credentials
from api.core.admin... | RyanLadley/agility | api/core/workflow/admin_workflow.py | admin_workflow.py | py | 2,156 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.loads",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "api.core.sanitize.fo... |
14582084682 | # -*- coding: utf-8 -*-
# @Author : Devin Yang(pistonyang@gmail.com), Gary Lai (glai9665@gmail.com)
__all__ = ['CosineWarmupLr', 'get_cosine_warmup_lr_scheduler', 'get_layerwise_decay_params_for_bert']
from math import pi, cos
from torch.optim.optimizer import Optimizer
from torch.optim.lr_scheduler import LambdaLR
... | PistonY/torch-toolbox | torchtoolbox/optimizer/lr_scheduler.py | lr_scheduler.py | py | 11,278 | python | en | code | 409 | github-code | 36 | [
{
"api_name": "torch.optim.optimizer.Optimizer",
"line_number": 68,
"usage_type": "argument"
},
{
"api_name": "math.cos",
"line_number": 99,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 99,
"usage_type": "name"
},
{
"api_name": "torch.optim.opti... |
4200242133 | import gevent
def eat(name):
print('%s start task' % name)
gevent.sleep(2)
print('%s end task' % name)
return name + " finished callback"
def play(name):
print('%s start task' % name)
gevent.sleep(1)
print('%s end task' % name)
return name + " finished callback"
def callback(greenl... | Marcia0526/how_to_learn_python | coroutine/gevent_demo.py | gevent_demo.py | py | 1,215 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "gevent.sleep",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "gevent.sleep",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "gevent.spawn",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "gevent.spawn",
"line_number... |
40568525715 | import logging
from dcs.point import MovingPoint
from dcs.task import EngageTargets, EngageTargetsInZone, Targets
from game.ato.flightplans.cas import CasFlightPlan
from game.utils import nautical_miles
from .pydcswaypointbuilder import PydcsWaypointBuilder
class CasIngressBuilder(PydcsWaypointBuilder):
def add... | dcs-liberation/dcs_liberation | game/missiongenerator/aircraft/waypoints/casingress.py | casingress.py | py | 1,579 | python | en | code | 647 | github-code | 36 | [
{
"api_name": "pydcswaypointbuilder.PydcsWaypointBuilder",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "dcs.point.MovingPoint",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "game.ato.flightplans.cas.CasFlightPlan",
"line_number": 13,
"usage_type":... |
70719921064 | import numpy as np
from ..patch import Patch
from ..parcel import Parcel
class PropertyDeveloper:
def __init__(self, world, agent_type, view_radius=5, memory=100):
self.world = world
self.view_radius = view_radius
self.memory = memory
self.position = np.random.choice(world.patches.f... | LFRusso/strabo | strabo/agents/property.py | property.py | py | 8,249 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.random.choice",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "patch.parcel",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "patch.parcel"... |
4472644976 | import pygame as pg
from gui.widgets.animated_widget import AnimatedWidget
from data.constants import *
class BackgroundImage(AnimatedWidget):
def __init__(self, x, y, w, h, image):
super().__init__()
self.pos = x, y
self.image = pg.transform.smoothscale(pg.image.load(image).convert_alpha... | IldarRyabkov/BubbleTanks2 | src/gui/widgets/background_image.py | background_image.py | py | 834 | python | en | code | 37 | github-code | 36 | [
{
"api_name": "gui.widgets.animated_widget.AnimatedWidget",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "pygame.transform.smoothscale",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.transform",
"line_number": 11,
"usage_type": "attribute"
... |
23942544871 | """Assorted algorithms to verify end-to-end compiler functionality.
These tests include:
- Sum of array of integers
- Recursive Fibonacci sum
"""
import pytest
import tempfile
import functools
import os
from acctools import compilers
ACC_PATH=os.environ.get("ACC_PATH", os.path.join(os.path.dirname(__file__), "../... | alexking35h/acc | functional/test_algorithms.py | test_algorithms.py | py | 2,059 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.environ.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numbe... |
74541806822 | #!/usr/bin/env python
# -*- encoding:utf-8 -*-
import logging
import time
import gzip
import random
from six.moves.urllib.error import URLError
from six.moves.urllib.request import Request, build_opener, HTTPCookieProcessor
from six.moves.urllib.parse import urlencode
from six.moves.http_cookiejar import CookieJar
fr... | liuyug/utils | network.py | network.py | py | 3,623 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "six.moves.urllib.parse.urlencode",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "six... |
69904891626 | from setuptools import setup
# To use a consistent encoding
from codecs import open
from os import path
with open('README.rst') as f:
long_desc = f.read()
setup(name='glucid',
version='0.5.0',
description='Configure the Lucid 8824 AD/DA Audio Interface via \
a Serial Connection',
ur... | danmechanic/glucid | setup.py | setup.py | py | 1,879 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "codecs.open",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_number": 9,
"usage_type": "call"
}
] |
1710822043 | import logging
import warnings
import torch
import numpy as np
from data import data_utils
from data.ofa_dataset import OFADataset
logger = logging.getLogger(__name__)
warnings.filterwarnings("ignore", "(Possibly )?corrupt EXIF data", UserWarning)
def collate(samples, pad_idx, eos_idx):
if len(samples) == 0:
... | evdcush/musketeer | data/nlg_data/summary_dataset.py | summary_dataset.py | py | 7,516 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "data.data_utils.collate_tokens",
"line_number": 18,
"usage_type": "call"
},
{
"api_name"... |
37722788260 | '''
商品详情页面
'''
from common.base import Base
good_url ='http://ecshop.itsoso.cn/goods.php?id=304'
class Buy_Good(Base):
'''页面点击立即购买'''
# 商品名字
good_name_loc=('class name','goods_style_name')
# 商品牌子
good_brand_loc=('css selector','a[href="brand.php?id=20"]')
# 购买数量框
number_loc=('id','number'... | 15008477526/- | web_aaaaaaaa/page/good_details3.py | good_details3.py | py | 2,403 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "common.base.Base",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "common.base.open_browser",
"line_number": 72,
"usage_type": "call"
}
] |
24481282090 | import logging
class Singleton(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
return cls._instances[cls]
class Logger(object):
__metaclass__ = Singleton
def __in... | shalseban/wikiepedia-top-pageviews | src/main/python/logger.py | logger.py | py | 809 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "logging.Formatter",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.FileHan... |
43587647307 | import argparse as _argparse
import os as _os
import sys as _sys
from colorama import Fore as _Fore
from colorama import init as _colorama_init
from contexttimer import Timer as _Timer
from src import merge as _merge
from src import parse as _parse
if __name__ == '__main__':
"""
Example: python merge.p... | PSS-Tools-Development/pss-api-parser | merge.py | merge.py | py | 2,353 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "colorama.init",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path",
"l... |
8266325142 | import anki
from aqt import mw
import re
col = anki.collection.Collection('C:/Users/clept/AppData/Roaming/Anki2/Iván/collection.anki2')
deck_name = 'Seguridad social test'
search_query = '"deck:' + deck_name + '"'
cards = col.find_cards(search_query)
for card_id in cards:
# Get the card
card = col.get_car... | IvanDiazCostoya/anki-card-add-sort-field | main.py | main.py | py | 1,195 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "anki.collection.Collection",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "anki.collection",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "re.search",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "re.sub",
... |
34056654418 | import math
import torch
import torch.nn as nn
class PositionalEncoding(nn.Module):
def __init__(self, d_model, dropout=0.1, max_len=5000):
super().__init__()
self.dropout = nn.Dropout(p=dropout)
position = torch.arange(max_len).unsqueeze(1)
div_term = torch.exp(torch.arange(0, d... | yutotom/COVID-19-Forecasts | deep_learning/nets.py | nets.py | py | 4,463 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.nn.Dropout",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_num... |
4898894473 | import os
import sys
from PyQt5 import QtGui, QtWidgets
"""
from datetime import datetime,timedelta
from threading import Timer
"""
print('poggo')
class SystemTrayIcon(QtWidgets.QSystemTrayIcon):
def __init__(self,icon,parent=None):
QtWidgets.QSystemTrayIcon.__init__(self,icon,parent)
s... | verentino/PU_PDT_TimeUp | tray_old.py | tray_old.py | py | 1,936 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PyQt5.QtWidgets.QSystemTrayIcon",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QSystemTrayIcon.__init__",
"line_number": 12,
"usage_type": "call"
... |
35941618047 | from flask import Flask, render_template, url_for, flash, redirect, request, session, make_response
from flask_wtf.file import FileField, FileAllowed
from flask_sqlalchemy import SQLAlchemy
from datetime import datetime
from flask_bcrypt import Bcrypt
from flask_wtf import FlaskForm
from wtforms import StringField, Pa... | infknight/SILT | app.py | app.py | py | 37,771 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "flask_bcrypt.Bcrypt",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "flask_log... |
35735822351 | import re
import webbrowser
import markdown
import dominate
from dominate.util import raw
from dominate.tags import *
from argparse import ArgumentParser
import shutil
import tempfile
import json
import os
from logging import *
import time
import bs4
import base64
from urllib.parse import unquote_plus
basicConfig(leve... | iTecAI/trilium-tools | pdf-export/trilium_to_pdf.py | trilium_to_pdf.py | py | 11,045 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "markdown.Markdown",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "tempfile.TemporaryDirectory",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "shutil.unpack_archive",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "u... |
11916959214 | from django import forms
from .models import Comment ,Blog,Category
class BlogForm(forms.ModelForm):
category = forms.ModelChoiceField(
queryset=Category.objects.all().order_by('name'))
class Meta:
model = Blog
fields = ['title', 'featured_image', 'content','category']
... | minarefaat1002/blog_website | blogs project/blog/forms.py | forms.py | py | 804 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.forms.ModelChoiceField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "d... |
5967270915 | # Sun Oct 27 15:40:29 2019
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
# Configurations
mpl.rcParams['font.family'] = 'serif'
mpl.rcParams['font.size'] = 20
mpl.rcParams['font.weight'] = 'medium'
mpl.rcParams['font.style'] = 'normal'
mpl.rcParams['font.serif'] = 'DejaVu Serif'
mpl.rcPara... | NingDaoguan/JI | PO6007-MSTPS/HW/HW3.py | HW3.py | py | 4,599 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.rcParams",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name"... |
43354784770 | import json
from typing import Any, List
import numpy as np
import torch
from mmhuman3d.core.conventions.cameras import (
convert_cameras,
convert_K_3x3_to_4x4,
convert_K_4x4_to_3x3,
)
class CameraParameter:
def __init__(self,
name: str = 'default',
H: int = 1080,
... | hanabi7/point_cloud_smplify | mmhuman3d/core/cameras/camera_parameter.py | camera_parameter.py | py | 13,594 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "numpy.array",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "numpy.ndarray",
"line_number": 69,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 70,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
... |
17978578215 | # 导入操作系统库
import os
# 更改工作目录
os.chdir(r"D:\softwares\applied statistics\pythoncodelearning\chap3\sourcecode")
# 导入绘图库
import matplotlib.pyplot as plt
# 导入支持向量机模型
from sklearn import svm
# 导入决策边界可视化工具
from sklearn.inspection import DecisionBoundaryDisplay
# 导入数据集生成工具
from sklearn.datasets import make_blobs
# 导入绘图库中的字体管理... | AndyLiu-art/MLPythonCode | chap3/sourcecode/Python4.py | Python4.py | py | 1,925 | python | zh | code | 0 | github-code | 36 | [
{
"api_name": "os.chdir",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "matplotlib.font_manager.FontProperties",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.font_manager",
"line_number": 16,
"usage_type": "name"
},
{
"api_name":... |
9190017437 | # imports
# scipy/anaconda imports
import pandas
from scipy import stats
import numpy
# python standard library imports
import math
import statistics
import copy
import collections
import time
nan = float("nan")
def fit_line(x_data, y_data):
"""
performs a linear fit to the data and return the slope, y-intercept, R... | Kramer-Lab-Team-Algae/vO2-per-LEF-scripts | Data Analysis/MathHelper.py | MathHelper.py | py | 6,671 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "scipy.stats.linregress",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "scipy.stats",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "scipy.stats.chisquare",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "scipy.stats"... |
1158088849 | import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from utils import INPUT_SHAPE, batch_generator
from keras.models import Sequential
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint
from keras.layers import Lambda, Conv2D, Dropout, Dense, Flatten... | thomashiemstra/self_driving_car_simulation | train.py | train.py | py | 2,585 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "keras.models.Sequential",
"line_number": 25,
"usage_type": "call"
},
{
"... |
25947442218 | import os
import sqlite3
from datetime import datetime, timedelta
import telebot
bot = telebot.TeleBot(os.getenv("BOT_TOKEN"))
memes_chat_id = int(os.getenv("MEMES_CHAT_ID"))
flood_thread_id = int(os.getenv("FLOOD_THREAD_ID", 1))
memes_thread_id = int(os.getenv("MEMES_THREAD_ID", 1))
conn = sqlite3.connect("memes.db... | dzaytsev91/tachanbot | cron_job_message_count.py | cron_job_message_count.py | py | 1,258 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "telebot.TeleBot",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 9,
... |
24267348983 | import pandas as pd
import geocoder
import math
from RR import *
class TreeOp:
def __init__(self, path=None):
# The path is the path of the csv file. Call this function to create the R-Trees
# Will Create R-Entries and then those entries will be search
# X is the longitude, Y is the Latit... | munawwar22HU/Ehsas | Source/RTreeOperations.py | RTreeOperations.py | py | 3,426 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "geocoder.google",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "geocoder.google",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_n... |
42236411796 | from pick import pick
import re
import sys
result = ""
selected = []
all_feature = []
def loadDB(filename):
# 加载产生式数据库
dictionary = {}
all = []
global all_feature
with open(filename, 'r') as f:
for line in f.readlines():
# 按行加载
if line[0] == "#":
con... | littlebear0729/Production-system | identify_system.py | identify_system.py | py | 2,137 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "re.findall",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pick.pick",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 69,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 70,
... |
17585730612 | from __future__ import annotations
from collections import defaultdict
from starwhale import Job, handler, evaluation
from starwhale.utils.debug import console
PROJECT_URI = "https://cloud.starwhale.cn/project/349"
JOB_URI_TEMPLATE = "%s/job/{job_id}" % PROJECT_URI
JOB_IDS = [
"845",
"844",
"843",
"8... | star-whale/starwhale | example/llm-leaderboard/src/analysis.py | analysis.py | py | 3,516 | python | en | code | 171 | github-code | 36 | [
{
"api_name": "collections.defaultdict",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 35,
"usage_type": "call"
},
{
"api_name"... |
38326596416 | import pandas as pd
from matplotlib import pyplot as plt
from oemof.tools import logger
import logging
import q100opt.plots as plots
from q100opt.buildings import BuildingInvestModel, SolarThermalCollector
from q100opt.scenario_tools import ParetoFront
from q100opt.setup_model import load_csv_data
logger.define_loggi... | quarree100/q100opt | examples/single_building/example_house_with_solarthermal.py | example_house_with_solarthermal.py | py | 3,764 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "oemof.tools.logger.define_logging",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "oemof.tools.logger",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "logging.INFO",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name":... |
73974471145 | import logging
from datetime import datetime
from time import sleep
from typing import Union, Optional, Tuple, List, Sequence
import mariadb
from mariadb import Cursor, Connection
from accounting_bot import utils
from accounting_bot.exceptions import DatabaseException
logger = logging.getLogger("ext.accounting.db")
... | Blaumeise03/AccountingBot | accounting_bot/ext/accounting_db.py | accounting_db.py | py | 11,837 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "mariadb.Error",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "accounting_bot.except... |
26944213809 | # -*- coding: utf-8 -*-
'''
@author: davandev
'''
import logging
import os
import traceback
import sys
import davan.config.config_creator as configuration
import davan.util.constants as constants
from davan.util import cmd_executor as cmd_executor
from davan.http.service.base_service import BaseService... | davandev/davanserver | davan/http/service/picture/PictureService.py | PictureService.py | py | 4,701 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "davan.http.service.base_service.BaseService",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "davan.http.service.base_service.BaseService.__init__",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "davan.http.service.base_service.BaseService",
... |
28721865338 | # usage: python dropprofiles.py
# looks through mongo argo:argo and lists ids
from pymongo import MongoClient
client = MongoClient('mongodb://database/argo')
db = client.argo
mongoprofiles = open("mongoprofiles", "w")
mongoids = [x['_id'] for x in list(db.argo.find({}, {'_id':1}))]
for x in mongoids:
mongoprofil... | argovis/ifremer-sync | audit/mongoids.py | mongoids.py | py | 363 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 6,
"usage_type": "call"
}
] |
32137328654 | import datetime
import json
import os
from datetime import timezone
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from sklearn.decomposition import PCA
from sklearn.model_selection import KFold, ParameterGrid, train_test_split
from prism_kondo.experiment_utils import (
add_random_n... | lurue101/Ruecker_MA | prism_kondo/noise_experiments.py | noise_experiments.py | py | 13,013 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.random.RandomState",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.round",
... |
12006624886 | #! /usr/bin/env python3
import sys
sys.path.insert(0, '/home/pi/soco') # Add soco location to system path
import time
from soco import SoCo
from soco.snapshot import Snapshot
print("Starting Doorbell Player...")
### Setup
# Define doorbell MP3 file as bellsound and set doorbell volume
bellsound = "http... | ronschaeffer/sonosdoorbell | SonosDoorbellPlayer.py | SonosDoorbellPlayer.py | py | 5,389 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "sys.path.insert",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "soco.SoCo",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "soco.SoCo",
"line_number": ... |
10179832367 | #!/usr/bin/python3
"""
Prints the titles of the first 10 hot posts listed for a given subreddit
"""
import requests
def top_ten(subreddit):
"""
Prints the titles of the first
10 hot posts listed for a given subreddit
"""
if subreddit is None or not isinstance(subreddit, str):
print("Non... | jamesAlhassan/alx-system_engineering-devops | 0x16-api_advanced/1-top_ten.py | 1-top_ten.py | py | 756 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
}
] |
18198988741 | """Providers filters file."""
from django.db import models
import django_filters
from tersun.common.filters import SearchComboboxBaseFilter
from tersun.providers import models as provider_models
class ProviderFilter(SearchComboboxBaseFilter):
"""Provider filter class."""
class Meta:
"""Meta class f... | SonnyKundi/teebeauty_backend | tersun/providers/filters.py | filters.py | py | 671 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tersun.common.filters.SearchComboboxBaseFilter",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "tersun.providers.models.Provider",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "tersun.providers.models",
"line_number": 16,
"usage_... |
32578660748 | import cv2 as cv
import numpy as np
image = cv.imread('img.jpg')
imageGray = cv.cvtColor(image,cv.COLOR_BGR2GRAY)
imageGrayCanny = cv.Canny(image,100,150)
cv.imshow('canny',imageGrayCanny)
contours, hierarchy = cv.findContours(imageGrayCanny,cv.RETR_EXTERNAL,cv.CHAIN_APPROX_NONE)
contours_poly = [None] *... | mycatdoitbetter/projects-opencv2-python | t31 - t45/t-32/t-32.py | t-32.py | py | 1,040 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "cv2.Canny",
"line_nu... |
71249270184 | """
Core client functionality, common across requests.
"""
import collections
import random
import requests
import time
from datetime import datetime
from datetime import timedelta
RETRIABLE_STATUSES = {500, 503, 504}
class AbstractRestClient:
"""Performs requests to APIs services."""
def __init__(self, b... | ifreddyrondon/address-resolver | addressresolver/core/client.py | client.py | py | 5,786 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.Session",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "datetime.dateti... |
14537963306 | # 주식 비교 및 분석
# 1. 주식 비교
# 야후 파인낸스 사용
# 필요 라이브러리는 yfinance, pandas-datareader
# 주식 시세 구하는 함수는 get_data_yahoo()
# get_data_yahoo(조회할 주식 종목 [, start=조회 기간의 시작일] [, end=조회 기간의 종료일])
from pandas_datareader import data as pdr
import yfinance as yf
yf.pdr_override()
sec = pdr.get_data_yahoo('063160.KS', start='2020-08-17')
... | drafighter/dra_investar | stock_basic.py | stock_basic.py | py | 655 | python | ko | code | 0 | github-code | 36 | [
{
"api_name": "yfinance.pdr_override",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas_datareader.data.get_data_yahoo",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas_datareader.data",
"line_number": 12,
"usage_type": "name"
},
{
... |
18074097517 | from django.conf.urls import patterns, include, url
from django.conf import settings
from django.conf.urls.static import static
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
#
urlpatterns = patterns('',
url(r'^index$', 'Users.views.start'),
url(r'... | ggarri/photoDiary | Users/urls.py | urls.py | py | 512 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "dj... |
2124363907 | import torch
import torch.nn as nn
class RNN_Classifier(torch.nn.Module):
def __init__(self, input_size, hidden_size, output_size, num_layers = 1, batch_first = True, use_gpu = True):
super(RNN_Classifier, self).__init__()
self.hidden_size = hidden_size
self.input_size = input_size
... | nhatleminh1997/ASL_detection | RNN_classifer.py | RNN_classifer.py | py | 1,041 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.nn",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.RNN",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number... |
40895132002 | from flask import Flask, render_template, request, Response, url_for,jsonify
from flask_sqlalchemy import SQLAlchemy
from flask_weasyprint import HTML, render_pdf
import ast
import json
import dicttoxml
from datetime import datetime
from model import Reports
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_UR... | webbyfox/suade | app.py | app.py | py | 1,494 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "model.Reports.query.all",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "model... |
9376474634 | import numpy as np
import cv2
import sys
from math import sqrt
sys.setrecursionlimit(10000)
class MandelbrotSet:
def __init__(self, size, numColors):
self.size = size
self.c = 0
self.img = np.zeros((size,size,3), dtype='uint8')
self.pallet = []
self.generatePallet(numColors)... | cleiston/Fractals | MandelbrotSet.py | MandelbrotSet.py | py | 1,684 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.setrecursionlimit",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_nu... |
38197374041 | import matplotlib.pylab as plt
import matplotlib.patches as mpatch
import numpy as np
import pandas as pd
# Get alcohol consumption level and GSP
YEAR = 2009
df = pd.read_csv("cache/niaaa-report.csv")
df = df[df.Year == YEAR]
df2 = pd.read_csv("cache/usgs_state_2009.csv", dtype={"Gross State Product": np.float64},
... | hmly/data-science | demo-analysis/demo-analysis.py | demo-analysis.py | py | 1,586 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.float64",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pandas.crosstab",
... |
21107263411 | """Utility functions for building models."""
from __future__ import print_function
import collections
import time
import os
import numpy as np
import tensorflow as tf
from .utils import iterator_utils
from .utils import misc_utils as utils
from .utils import data_utils
__all__ = [
"get_initializer", "get_device... | panchgonzalez/nmor | nmor/model_helper.py | model_helper.py | py | 7,400 | python | en | code | 22 | github-code | 36 | [
{
"api_name": "tensorflow.random_uniform_initializer",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.initializers.glorot_normal",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras",
"line_number": 29,
"usage_type": "at... |
17904371974 | import pandas as pd
import tensorflow as tf
import psycopg2
import configparser as cf
import numpy as np
import key_driver_analysis as kda
SQL_COLUMN_NAMES = ['nct_id',
'start_date',
'study_type',
'enrollment_type',
'phase',
... | nastacio/clinical-bi | src/main/py/ct_data.py | ct_data.py | py | 8,474 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "numpy.r... |
73974487785 | import random
import unittest
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
from accounting_bot.ext.checklist import CheckList, Task, RepeatDelay
class ChecklistTest(unittest.TestCase):
def test_expire(self):
# noinspection PyTypeChecker
checklist = C... | Blaumeise03/AccountingBot | tests/test_checklist.py | test_checklist.py | py | 3,556 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "accounting_bot.ext.checklist.CheckList",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 15,
"usage_type": "call"
},
{
... |
27705271301 | import yfinance as yf
import requests
from datetime import datetime
def calculate_dma(ticker, days):
data = yf.download(ticker, period='1mo')
data['DMA'] = data['Close'].rolling(window=days).mean()
return data
def generate_signal(live_price, dma):
if live_price > dma:
return "buy"
else:
... | vajjhala/dma-btc | dma-btc.py | dma-btc.py | py | 946 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "yfinance.download",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "datetime.datetime... |
34182723957 | # coding=utf-8
from __future__ import print_function
"""负责从主网址中爬取出需要的网址"""
import datetime
import logging
import bs4
import requests
import re
import tools.newspublish
from bs4 import BeautifulSoup
from models import *
from .tools.bloomfilter import BloomFilter
from Spider.autonews.tools.svmutil import *
from .objec... | zqkarl/Spider | Spider/autonews/url_spider.py | url_spider.py | py | 26,835 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sys.platform",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "re.match",... |
42982956826 | import redis
#import hazelcast
import logging
import random
import azlog
log = azlog.getLogger(__name__)
def SetupCacheConn(type,ip,port,key,ssl):
if (type=="redis"):
if (ssl=="yes"):
r=SetupRedisSSLConn(ip,port,key)
else:
r=SetupRedisConn(ip,port,key)
else:
... | Azure/HPC-Accelerator | scenarios/batch/code/src/utils.py | utils.py | py | 2,295 | python | en | code | 9 | github-code | 36 | [
{
"api_name": "azlog.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "redis.Redis",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "redis.StrictRedis",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"li... |
20672750408 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from graph_tool.all import *
import numpy as np
from pathos.multiprocessing import ProcessingPool as Pool
import tqdm
import pickle
def swir(n, z, rho0, kappa, mu, eta, num_ensamble):
pER = z/n
ss = 1 - mu - kappa
ww = 1 - eta
np.random.seed(num_ensamble)... | VolodyaCO/erSWIR | implementation.py | implementation.py | py | 7,234 | python | es | code | 1 | github-code | 36 | [
{
"api_name": "numpy.random.seed",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.poisson",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.random... |
2848517125 | #############################################################################################################################################
__filename__ = "main.py"
__description__ = """Represents main program.
"""
__author__ = "Anand Iyer"
__copyright__ = "Copyright 2016-17, Anand Iyer"
__credits__ = ["Ana... | ananddotiyer/DDE-Lite | ExcelWriter/main.py | main.py | py | 9,200 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "re.search",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "support.isdigit",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "support.lexer_setup",
"line_numb... |
29595058013 | from fontTools.ttLib import TTFont
import random, copy, os, time, base64
# Measure creation time
start = time.time()
# Read original TTF/OTF font file
f = TTFont('font.ttf')
# Find font's longest CMAP table
cmap = f['cmap']
longestCMAPtable = None
for t in cmap.tables:
if not longestCMAPtable or len(t.cmap) > len(l... | yanone/geheimsprache | geheimsprache.py | geheimsprache.py | py | 1,928 | python | en | code | 12 | github-code | 36 | [
{
"api_name": "time.time",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "fontTools.ttLib.TTFont",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "copy.copy",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_n... |
6319889570 | import json
import socket as s
import selectors
import threading
import types
import logging
logger = logging.getLogger("Main." + __name__)
class SocketHandler:
socket = None
sel = selectors.DefaultSelector()
selector_timeout = 4
doShutdown = threading.Event()
connected_sockets = []
handl... | Nickiel12/Church-Programs | Android/android_server/Classes/SocketHandler.py | SocketHandler.py | py | 5,396 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "selectors.DefaultSelector",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "threading.Event",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "socket.soc... |
6911896789 | import json
from pydantic import BaseModel
from pdf_token_type_labels.TokenType import TokenType
from pdf_features.Rectangle import Rectangle
SCALE_RATIO = 0.75
class SegmentBox(BaseModel):
left: float
top: float
width: float
height: float
page_number: int
segment_type: TokenType = TokenType... | huridocs/pdf_metadata_extraction | src/data/SegmentBox.py | SegmentBox.py | py | 1,091 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pdf_token_type_labels.TokenType.TokenType",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "pdf_token_type_labels.TokenType.TokenType.TEXT",
"line_number": 16,
"usage_t... |
73137151144 | import pytest
from registry_schemas import validate
# Properties can be anything, using show* for testing.
REGISTRATIONS_TABLE = {
'showColumn1': True,
'showColumn2': False,
'showColumn3': True,
'showColumn4': False
}
# Properties can be anything, using misc* for testing.
MISC_PREFERENCES = {
'pr... | bcgov/registry-schemas | tests/unit/common/test_user_profile.py | test_user_profile.py | py | 2,351 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "registry_schemas.validate",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 76,
"usage_type": "attribute"
}
] |
8649507511 | """
============================
Author:柠檬班-木森
Time:2020/5/12 20:40
E-mail:3247119728@qq.com
Company:湖南零檬信息技术有限公司
============================
"""
import time
import unittest
from selenium import webdriver
from ddt import ddt, data
from web_08day.page.page_login import LoginPage
from web_08day.page.page_index import ... | huchaoyang1991/py27_web | web_08day(web自动化用例编写和PO模式)/testcase/test_login_02.py | test_login_02.py | py | 1,630 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "w... |
22078953220 | from enum import Enum
import random
import copy
random.seed(None)
def setSeed(s):
random.seed(s)
"""
Basic enumerated class to specify colors when needed.
"""
class Color(Enum):
WHITE = 0
BLACK = 1
GREEN = 2
RED = 3
BLUE = 4
GOLD = 5
@classmethod
def mapToColor(self, color):
... | ckpalma/splendor-ai | gym-master/gym/envs/splendor/structure.py | structure.py | py | 36,935 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "random.seed",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "random.seed",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 57,
... |
15166686250 | from matplotlib import pyplot as plot
plot.rcParams [ "savefig.facecolor" ] = "w"
plot.rcParams [ "savefig.edgecolor" ] = "b"
lab_value , title_numb = 'Lab_None' , 0
def setLab ( text = None ) :
global lab_value
if text : lab_value = text
print ( 'lab value:' , lab_value )
def save () :
global t... | AmalLight/deepL_RL | saveFigure.py | saveFigure.py | py | 2,204 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 4,
"usage_type": "attribute"
},
{
"ap... |
37558477516 | from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth.hashers import make_password, check_password
from superadmin.models import User, UserGroup, Account, AccountChangeLog
from .forms import RawLoginForm
# Create your views here.
def user_login(request):
if request.session.get('us... | lymen/localusermanager | user/views.py | views.py | py | 2,564 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "forms.RawLoginForm",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "forms.RawLoginForm",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "super... |
8546055493 | import random
import pygame as pg
from creature import Creature
def draw_creatures(list):
i= 0
for i in range(len(list)):
list[i].draw()
def replication(creatures, display, border_rect, start_speed,\
start_sense, start_energy, speed_mutation, sense_mutation, nutrition, color):
for creature in ... | lkh-767572/natural-selection-of-traits | methods.py | methods.py | py | 2,031 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "creature.food_count",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "creature.energy_used",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "creature.energy",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name"... |
32736730593 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 3/9/19 7:49 PM
# @Author : zchai
import itertools
import os
import torch
from allennlp.data.dataset_readers.seq2seq import Seq2SeqDatasetReader
from allennlp.data.iterators import BucketIterator
from allennlp.data.token_indexers import SingleIdTokenIndexer
fr... | adamsZQ/couplet_generator | couplet_generator/seq2seq_allen.py | seq2seq_allen.py | py | 4,703 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "couplet_generator.my_logger.Logger",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "couplet_generator.utils.conf",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 46,
"usage_type": "call"
},
... |
9661100905 | from __future__ import print_function
import sys
import time
import numpy as np
import cv2 as cv
import matplotlib.pyplot as plt
from useFunc.detectAndTrack import *
from useFunc.utils import *
from useFunc.featMatch import *
if __name__ == '__main__':
# Params
intv_EM = 4 # interval to implement
# - foc... | dexter2406/MonoVision_MotionEstimation | MoVis_EM.py | MoVis_EM.py | py | 2,416 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWriter_fourcc",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FPS",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "cv2.CAP... |
29719010517 | from functools import reduce
def flip_data(arr, curr, l):
"""flip the data accounting for wrapping"""
# base case
if l == 1:
return
# get the subset
subset = []
for i in range(l):
n = (curr + i) % len(arr)
subset.append(arr[n])
# reverse
subset = subset[::-1]
... | yknot/adventOfCode | 2017/10_02.py | 10_02.py | py | 2,192 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "functools.reduce",
"line_number": 39,
"usage_type": "call"
}
] |
30988421589 | import json
import os
from flask import Flask, request, jsonify
app = Flask(__name__)
here = os.path.dirname(__file__)
state_path = os.path.join(here, "state.json")
@app.route("/")
def home():
with open(state_path) as f:
return jsonify(json.load(f))
@app.route("/<page>", methods=["GET", "POST"])
def ... | tartopum/atelier | fake_arduino/server.py | server.py | py | 1,307 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number... |
27338086141 | # inspired from: https://codehandbook.org/how-to-read-email-from-gmail-using-python/
# https://github.com/jay3dec/pythonReadEmail
# Python 3.8^ standard libraries
from traceback import print_exc
from imaplib import IMAP4_SSL
from email import message_from_bytes
from base64 import b64decode
from uuid import uuid4
from ... | PAR-iTY/on-the-spot | python/on-the-spot-mail.py | on-the-spot-mail.py | py | 13,406 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "imaplib.IMAP4_SSL",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "email.message_f... |
73139030824 | import numpy as np
from scipy.ndimage import maximum_filter
from operator import itemgetter
# implementation with pure functional procedure
# it could be refactored as object-oriented way....
def find_spot(mesh, N):
""" find view spots in a landscape """
try:
validate_mesh_grid(mesh)
grid = scale_to_grid(... | easz/view_spot_finder | view_spot_finder/finder.py | finder.py | py | 4,367 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "operator.itemgetter",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "scipy.ndimage.maximum_filter",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.swapaxes",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy... |
74649265384 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import unittest
from BeautifulReport import BeautifulReport
from utils.my_logger import logger
from utils.get_path import *
from scp import SCPClient
import paramiko
import os
import time
def make_report(name):
base_dir = os.path.split(os.path.split(os.path.abspath(__f... | iospeng/python | pycharm_demo/pythonProject2/utils/report.py | report.py | py | 1,550 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.split",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_n... |
23420574740 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('stock', '0201_auto_20160926_1614'),
]
operations = [
migrations.RenameField(
model_name='transferenciastock',
... | pmmrpy/SIGB | stock/migrations/0202_auto_20160926_1825.py | 0202_auto_20160926_1825.py | py | 1,333 | python | es | code | 0 | github-code | 36 | [
{
"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.RenameField",
"line_number": 14,
"usage_type": "call"
},
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.