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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
353790332 | from django.shortcuts import render
from rest_framework import status, viewsets
from rest_framework.decorators import action
from . import xchange_calculator
from . import models as Model
from rest_framework.views import APIView
from django.template import loader
from django.http import HttpResponse, HttpResponseRedir... | null | currency_exchange/views.py | views.py | py | 2,853 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.viewsets.ViewSet",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 24,
"usage_type": "call"
},
{
"api_name"... |
253476895 | from django.shortcuts import render
import os
from web import models
def dashboard(request, project_id):
project_name = models.Project.objects.filter(id=project_id).values('name')[0]['name']
path = '/Users/jamesccc/Downloads/django--master-2/web/static/media/' + str(request.tracer.user.id) + '/' + str(
... | null | web/views/manage.py | manage.py | py | 679 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "web.models.Project.objects.filter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "web.models.Project",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "web.models",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "os.... |
443617944 | from write import write
import os
import sys
sys.setrecursionlimit(26194)
import numpy as np
import random
import time
import pygame
pyg = pygame
disp = pygame.display
pyg.init()
disp.init()
"""Colors"""
WHITE = pyg.Color('white')
BLACK = pyg.Color('black')
GREEN = pyg.Color('green')
RED = pyg.Color('red')
YELLO... | null | Cards.py | Cards.py | py | 1,716 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.setrecursionlimit",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "os.path",
"... |
41835576 | import os
import shutil
import sys
import argparse
import gen_incar
def main(args):
## define a main function callable from another python script if necessary
parser = argparse.ArgumentParser(description='Generate all input files \
for defect calulations.')
p... | null | setup_dos.py | setup_dos.py | py | 2,954 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"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": "os.chdir",
"lin... |
55464888 | from django.urls import path
from .views import get_teachers, get_schedules, reservation_schedules, get_student
app_name = 'search'
urlpatterns = [
path('get_teachers/', get_teachers, name='get_teachers'),
path('get_schedules/', get_schedules, name='get_schedules'),
path('reservation_schedules/', reservati... | null | apps/search/urls.py | urls.py | py | 424 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.get_teachers",
"line_number": 6,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.get_sched... |
356239492 | """
Functionality for computing trajectories backward from a set of starting points
at a single point in time using the position scalars.
"""
from ..utils.grid_mapping import (
estimate_initial_grid_indecies,
estimate_3d_position_from_grid_indecies,
)
from ..utils.interpolation import interpolate_3d_fields
imp... | null | advtraj/integrate/backward.py | backward.py | py | 3,943 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "utils.interpolation.interpolate_3d_fields",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "utils.grid_mapping.estimate_initial_grid_indecies",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "utils.grid_mapping.estimate_3d_position_from_grid_ind... |
134999000 | import pygame as pg
import copy
def _parse_color(color):
if color is not None:
try:
return pg.Color(str(color))
except ValueError as e:
return pg.Color(*color)
return color
LOADED_FONTS = {}
LABEL_DEFAULTS = {
"font_path": None,
"font_size": 12,
... | null | data/tools/label.py | label.py | py | 2,444 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.Color",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.Color",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_numb... |
368187521 | # uncompyle6 version 3.7.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: C:\BitBucket\djmicrosip_apps\djmicrosip_actualizarcosto\djmicrosip_actualizarcosto\urls.py
# Compiled at: 2016-02-19 15:09:36
from django.conf.urls import patter... | null | pycfiles/djmicrosip_actualizarcosto-1.3.0/urls.py | urls.py | py | 588 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "views.index",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "views.actualizarView",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "views.Artic... |
238253391 | #!/usr/bin/env python
import roslib
roslib.load_manifest('franka_action_lib')
import numpy as np
import argparse
import sys
import os
import rospy
import cv2
from std_msgs.msg import String
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
# IMAGE_TOPICS_LIST = ['/camera1/color/image_ra... | null | manipulation/robot-interface/src/catkin_ws/src/franka_action_lib/scripts/extract_images_from_rosbag.py | extract_images_from_rosbag.py | py | 5,236 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "roslib.load_manifest",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv_bridge.CvBridge",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "rospy.Subscriber",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sensor_msgs.m... |
35611550 | import logging
from typing import Optional
import click
from scrapy.utils.python import garbage_collect
from opennem.api.export.map import PriorityType
from opennem.api.export.tasks import export_all_monthly, export_energy, export_power
from opennem.db.load_fixtures import load_bom_stations_json, load_fixtures
from o... | null | opennem/cli.py | cli.py | py | 4,431 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "click.group",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "click.command",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "click.group",
"line_n... |
420887604 | import numpy as np
import pandas as pd
import dash
import dash_core_components as dcc
import dash_html_components as html
from sklearn.linear_model import LinearRegression
import utils.AlphaVantageUtils as av
import utils.PostgresUtils as pg
import utils.ModelUtils as mdl
name = pg.get_symbol_name(av._TIC_MICROSOFT... | null | model/LinearRegressionModel.py | LinearRegressionModel.py | py | 1,938 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "utils.PostgresUtils.get_symbol_name",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "utils.PostgresUtils",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "utils.AlphaVantageUtils._TIC_MICROSOFT",
"line_number": 14,
"usage_type": "attrib... |
233405405 | '''
Created on Sep 19, 2014
@author: Albert
'''
import os
import commands
import logging
log = logging.getLogger()
from logger import log_with
from error import AuditError
auditError = AuditError()
try:
import json
except ImportError:
import simplejson as json
@log_with(log)
def isRunning(name='xend'):
... | null | modules/xm/xm.py | xm.py | py | 2,568 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "error.AuditError",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "commands.getoutput",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.debug",... |
268500881 | from py4dgeo.segmentation import *
from py4dgeo.m3c2 import M3C2
from py4dgeo.util import Py4DGeoError
import pytest
import ruptures
from .helpers import complex_timeseries, simple_jump
def test_segmentation(analysis):
# Basic assertions about the analysis loaded in fixture
assert len(analysis.distances.sha... | null | tests/python/test_segmentation.py | test_segmentation.py | py | 6,200 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytest.raises",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "py4dgeo.util.Py4DGeoError",
"line_number": 22,
"usage_type": "argument"
},
{
"api_name": "pytest.raises",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "py4dgeo.uti... |
535335479 | import os
import shutil
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report
from sklearn.utils import shuffle
from nerds.models import (
DictionaryNER, SpacyNER, CrfNER, BiLstmCrfNER,
ElmoNER, FlairNER, BertNER, TransformerNER,
EnsembleNER
)
from nerds.u... | null | examples/BioNLP/test_models.py | test_models.py | py | 4,901 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.exists",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "nerds.models.DictionaryNER",
... |
434649996 | #charlie mueller May 17th 2016
# Imports
import cx_Oracle
import socket
# For the parsing
import re
import DBConfigFile as cfg
########################
########################
##### usage: python dump_l1_prescales.py
#####
##### To dump prescales for a specific run, specify run number in test_query function
########... | null | ratemon/dump_l1_prescales.py | dump_l1_prescales.py | py | 2,111 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "socket.gethostname",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "DBConfigFile.dsn_info",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "DBConfigFile.dsn_info",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name... |
382850253 | from identity.printing import LabelBundle
from identity.model.id import PseudoRandomIdProvider
from identity.model.blinding import Blinding, BlindingType
from identity.model.security import User
import io
import csv
from faker.providers import BaseProvider
from openpyxl import Workbook
from identity.services.pm... | null | tests/faker.py | faker.py | py | 6,808 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "faker.providers.BaseProvider",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "identity.model.security.User",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "lbrc_flask.database.db.session.add",
"line_number": 29,
"usage_type": "call"
... |
91201153 | # Dependencies
import requests as req
# Define URL and query parameters
url = "http://api.worldbank.org/v2/"
params = {'format': 'json'}
# Get the list of lending types the world bank has
response = req.get(url + "lendingTypes", params=params).json()
lending_types = [lending_type["id"] for lending_type in response[1]... | null | Sub-Activities/06-Python-APIs/2/Activities/12-Stu_TwoCalls/Solved/12_Stu_TwoCalls_Solved.py | 12_Stu_TwoCalls_Solved.py | py | 1,087 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
}
] |
78043744 | import os
import numpy as np
import torch
import torch.utils.data.dataloader as dataloader
from tensorboardX import SummaryWriter
from torch.nn import Parameter
import time
from data_load import TextSet
import torch.optim as optim
# class MyRNNcell(torch.nn.Module):
# def __init__(self, inputsize, hidesize):
# ... | null | lab4/lstm.py | lstm.py | py | 7,065 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.LSTMCell",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "torch.cat",
"line_n... |
468543103 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from math import ceil
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from common.models import BackstageHTTPResponse, PageInfo
from common.views import BackstageBaseAPIView
from common.utils import gen_page_info
from common.utils ... | null | src/api/alert/views/shell.py | shell.py | py | 5,027 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "common.views.BackstageBaseAPIView",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "models.DayKline.objects.filter",
"line_number": 50,
"usage_type": "call"
},
{
... |
171240832 | # import the necessary packages
from sklearn.preprocessing import LabelBinarizer
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report
from keras.preprocessing.image import ImageDataGenerator
from keras.optimizers import RMSprop
from keras.optimizers import SGD
from kera... | null | keras-examples/finetuning/vgg_finetune.py | vgg_finetune.py | py | 7,221 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "keras.preprocessing.image.ImageDataGenerator",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "keras.applications.VGG16",
"line_number": 46,
"usage_type": "call"
... |
565895399 | from django.db import models
from datetime import *
from ring.mylib import get_level
import random
class User(models.Model):
openid = models.CharField(max_length=30, unique=True)
target = models.IntegerField(default=5000)
exps = models.IntegerField(default=0)
achievements = models.BigIntegerField(defa... | null | ring/models.py | models.py | py | 14,284 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "... |
168092207 | #!/usr/bin/python3
import inspect
import configparser
import platform
global conf_obj, hkr_obj
configfile_n = "config/hz_rr_config.ini"
hkr_config = "config/heizkreis.ini"
class Conf:
#obj = ""
#using_conf = ""
#initd = 0
def __init__(self,using_conf=""):
self.using_conf = ... | null | HZRR_203/Software/RPi/move_to_desktop_FROM_AKAZZ1.monitor_on_boot/_fallback_stable_version/hz_rr_config.py | hz_rr_config.py | py | 2,522 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "platform.system",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 34,
"usage_type": "call"
}
] |
232292613 | #-*- coding:utf-8 -*-
import numpy as np
from scipy.optimize import curve_fit
from BaseModel import BaseModel
class SinRegression(BaseModel):
def __init__(self, param = {}):
BaseModel.__init__(self, "sin-regression", param)
self.coefs = None
self._predict = None
def _sin_func(self, x... | null | lib/model/SinRegression.py | SinRegression.py | py | 1,846 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "BaseModel.BaseModel",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "BaseModel.BaseModel.__init__",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "BaseModel.BaseModel",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "n... |
241807463 | import abc
import os
import yaml
from rest_framework.exceptions import ValidationError
from .clients.rancher import RancherClient
from cloudlaunch import models as cl_models
import subprocess
class CMClusterTemplate(object):
def __init__(self, context, cluster):
self.context = context
self.cluste... | null | cloudman/clusterman/cluster_templates.py | cluster_templates.py | py | 4,761 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "abc.abstractmethod",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "abc.abstractmethod",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "abc.abstractmethod",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name"... |
278958548 | # -*- coding: utf-8 -*-
"""
This file is covered by the LICENSING file in the root of this project.
"""
import sys
sys.path.append("..")
from flask import g
from mongoengine import Q
from hackathon import Component, RequiredFeature
from hackathon.hmongo.models import Hackathon, User, UserHackathon
from hackathon.co... | null | open-hackathon-server/src/hackathon/hack/admin_manager.py | admin_manager.py | py | 6,756 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "hackathon.Component",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "hackathon.RequiredFea... |
347933950 | #
# 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 t... | null | ryu/app/openstate/playground/forwarding_consistency_1_to_many_with_2_tables.py | forwarding_consistency_1_to_many_with_2_tables.py | py | 11,318 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "ryu.base.app_manager.RyuApp",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "ryu.base.app_manager",
"line_number": 35,
"usage_type": "name"
},
{
"api_name"... |
583505546 | # Scheduler to DB
# Relus Corp
# Written By: Clay Tyler
# GOAL: the goal of the script is to actively read the scheduler dashboard
# and convert it into a queryable dataframe to be then uploaded to AWS S3
import gspread
from oauth2client.service_account import ServiceAccountCredentials
import pandas as pd
import nump... | null | scheduler/scheduler_db.py | scheduler_db.py | py | 5,542 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "gspread.auth... |
151127054 | import torch
import yaml
import torch.nn as nn
from yolov5_official.model import Detect
from yolov5_official.utils import *
import math
from yolov5_official.modules import *
def parse_model(par, inch):
# depth_multiple 和 width_multiple 用于对layer中的 channels 进行缩放
anchors, nc, gd, gw = par['anchors'], par['nc'],... | null | createModel.py | createModel.py | py | 3,519 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.BatchNorm2d",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "yolov5_official.model.Detect",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "torch... |
474655251 |
# coding: utf-8
# In[10]:
import numpy as np
import cv2
import matplotlib.pyplot as plt
import keras
from keras import backend as K
if K.backend()=='tensorflow':
K.set_image_dim_ordering("tf")
from skimage.color import rgb2gray
from scipy import ndimage as ndi
from keras.datasets import cifar10
from keras.utils... | null | Gabor weight initialiser.py | Gabor weight initialiser.py | py | 4,281 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "keras.backend.backend",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "keras.backend.set_image_dim_ordering",
"line_number": 13,
"usage_type": "call"
},
{
"api_name... |
606921356 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Sistemi Corporation, copyright, all rights reserved, 2022-2023
Martin Guthrie
"""
import logging
from core.test_item import TestItem
from public.prism.api import ResultAPI
import os
from public.prism.drivers.nrfprog.NRFProg import NRFProg, DRIVER_TYPE
NRF52833DK_ASS... | null | public/prism/scripts/example/nRF52833-DK/prog_P00xx.py | prog_P00xx.py | py | 2,823 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "core.test_item.TestItem",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "public.prism.drivers.nrfprog.NRFProg.DRIVER_TYPE",
"line_number": 38,
"usage_type": "name"
},... |
426557168 | # ommdb.py
import ConfigParser
import Sybase
import pkgutil
import re
import logging
import os.path
# logger = logging.getLogger(__name__)
logger = logging.getLogger('omserver.ommdb')
testProductKey = """16C1-036E-19CE-03D6"""
def getOneValue(sql):
# logger.info("getOneValue")
data = pkgutil.get_data(__p... | null | ommlib/ommdb.py | ommdb.py | py | 17,278 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pkgutil.get_data",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "Sybase.connect",
"lin... |
569550907 | # modules
import tcod
# game files
from bfrl import globals
from bfrl import constants
from bfrl import game
class Confuse:
"""
Once per turn, creature moves randomly, until confuse wears off.
"""
def __init__(self, old_ai, num_turns):
self.old_ai = old_ai
self.num_turns = num_turns
... | null | bfrl/ai.py | ai.py | py | 1,411 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tcod.random_get_int",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "bfrl.game.message",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "bfrl.game",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "bfrl.constants.COLOR_... |
13087985 | import functools
import json
import logging
import pyodbc
import xlrd
import time
from concurrent.futures import ProcessPoolExecutor
from contextlib import closing
from multiprocessing import Pool
from os import listdir
from os.path import isdir, join as pjoin
from sys import exc_info
indir = 'input'
def timer(func... | null | main.py | main.py | py | 13,663 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.perf_counter",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "time.perf_counter",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "xlrd.open_workboo... |
317690128 | from rest_framework import serializers
from clientes.models import Cliente
from clientes.validators import *
class ClienteSerializer(serializers.ModelSerializer):
class Meta:
model = Cliente
fields = '__all__'
def validate(self, data):
if not validate_cpf(data['cpf']):
ra... | null | clientes/serializers.py | serializers.py | py | 862 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "clientes.models.Cliente",
"line_number": 9,
"usage_type": "name"... |
509678172 | # Owner(s): ["module: dynamo"]
from torch._dynamo import config
from torch._dynamo.testing import make_test_cls_with_patches
try:
from . import (
test_export,
test_functions,
test_misc,
test_modules,
test_repros,
test_subgraphs,
test_unspec,
)
except Impo... | null | test/dynamo/test_dynamic_shapes.py | test_dynamic_shapes.py | py | 4,084 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch._dynamo.testing.make_test_cls_with_patches",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "torch._dynamo.config",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "torch._dynamo.config",
"line_number": 40,
"usage_type": "name"
},... |
529040515 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 20 12:00:06 2017
@author: chenqiling
"""
'''
#################
Connect to Google
#################
'''
from pytrends.request import TrendReq
# Login to Google. Only need to run this once, the rest of requests will use the same session.
pytrends =... | null | Foundation of Data Science/scraping and cleaning/code/googletrend.py | googletrend.py | py | 1,792 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytrends.request",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "pytrends.request.TrendReq",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pytrends.request.build_payload",
"line_number": 36,
"usage_type": "call"
},
{
"api_nam... |
340498996 | # !/usr/bin/env python3
# -*- encoding: utf-8 -*-
import sqlite3
# 连接到SQLite数据库
# 数据库文件test.db
# 如果文件不存在,会在动在当前目录创建:
conn = sqlite3.connect('test.db')
# 创建一个Cursor
cursor = conn.cursor()
# 获取查询结果
# 如果SQL语句带有参数,那么需要把参数按照位置传递给execute()方法,有几个?占位符就必须对应几个参数
# cursor.execute('select * from user where name=? and pwd=?', ('a... | null | 18.访问数据库/使用SQLite/sqlite_query.py | sqlite_query.py | py | 639 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlite3.connect",
"line_number": 9,
"usage_type": "call"
}
] |
93539469 | from django.conf.urls import patterns, include, url
from django.contrib import admin
from filebrowser.sites import site
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/filebrowser/', include(site.urls)),
url(r'^grappelli/', include('grappelli.urls')), # grappelli URLS
url(r'^admin/', include(... | null | engmin/urls.py | urls.py | py | 381 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.patterns",
"line_number": 7,
"usage_type": "call"
},
{
"api... |
443621163 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# author:haiton
# datetime:19-3-29 下午4:28
import torch
import torch.nn as nn
import pickle
import numpy as np
from model.module import GruDecoder
from allennlp.modules.elmo import Elmo, batch_to_ids
from model.layers import CharCNN, InputAttention, ScaledDotAttention
from r... | null | model/sense_generator_share_embedding.py | sense_generator_share_embedding.py | py | 11,488 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torch.nn.Embedding",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line... |
353780543 | from os import stat
from django.shortcuts import render
from django.http import HttpResponse
from datetime import datetime
from django.core.exceptions import ObjectDoesNotExist
from rest_framework.response import Response
from rest_framework.views import APIView
from .models import phonemodel
import base64
from .models... | null | OTP/views.py | views.py | py | 1,854 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.http.HttpResponse",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "rest_framework.views.APIView",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "models.phonemodel.objects.get",
"line_number": 21,
"usage_type": "call"
},
{
... |
239222900 | import numpy as np
from typing import Iterator, Tuple
from .table_generator import TableGenerator
class DatasetGenerator(object):
def __init__(self):
super().__init__()
def get_data(self, table_generator: TableGenerator, n_instances: int) -> Iterator[Tuple[str, str, str]]:
dataset = []
... | null | core/generators/dataset_generator.py | dataset_generator.py | py | 641 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "table_generator.TableGenerator",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "table_generator.get_table",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "typing.Iterator",
"line_number": 11,
"usage_type": "name"
},
{
"api_name... |
182889421 | from django.shortcuts import render
from django.http import HttpResponseRedirect
from cubeuser.models import Cubeuser
from .forms import LoginForm
# Create your views here.
def index(request):
if request.session.get('is_login') is None:
sesuser = 0
else:
email = request.session.get('user_emai... | null | mainurl/views.py | views.py | py | 1,565 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cubeuser.models.Cubeuser.objects.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cubeuser.models.Cubeuser.objects",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "cubeuser.models.Cubeuser",
"line_number": 14,
"usage_type": "n... |
212962608 | # -*- coding: utf-8 -*-
"""
Created on Wed May 27 22:28:44 2015
@author: npingel
"""
from astropy.io import fits
import numpy as np
import matplotlib.pyplot as pyplot
hduOnX_475=fits.open('/Users/npingel/Desktop/Research/FLAG/Results/Leo_On_X_475.fits')
hduOffX_476=fits.open('/Users/npingel/Desktop/Research/FLAG/Resu... | null | AveJanSpec.py | AveJanSpec.py | py | 2,841 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "astropy.io.fits.open",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "astropy.io.fits.open",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "astropy.io.... |
619979075 | import pickle
import numpy as np
from keras.models import load_model
from keras.preprocessing.sequence import pad_sequences
from posTagger import *
with open('nerTagger/max_len.pkl', 'rb') as f:
max_len = pickle.load(f)
with open('nerTagger/max_len_char_prefix.pkl', 'rb') as f:
max_len_char_prefix = pickle.lo... | null | nerTagger.py | nerTagger.py | py | 3,437 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pickle.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 1... |
386626544 | import networkx as nx
import matplotlib.pyplot as plt
G = nx.read_gml('karate.gml',label='id')
# G.clear()
# pos=nx.draw_spring(G)
# nx.draw_networkx_nodes(G,pos=pos)\
clique=nx.find_cliques(G)
nx.draw(G, with_labels=True)
# plt.savefig("zac.png")
print(list(clique))
plt.show() | null | communities/Com_Net.py | Com_Net.py | py | 282 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "networkx.read_gml",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "networkx.find_cliques",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "networkx.draw",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot... |
35047855 | from collections import deque
import sys
sys.setrecursionlimit(10000)
d, n = map(int, input().rstrip().split())
a = deque()
for i in range(int(n)):
a.append(int(input()))
def search(selected, position, step_list):
if position < -d or d < position:
return False
elif not step_list:
return ... | null | exercise/python_exercise/kabayaki.py | kabayaki.py | py | 820 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.setrecursionlimit",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 7,
"usage_type": "call"
}
] |
74961970 | # -*- coding: utf-8 -*-
import sys
from Ui_QtMainWindowLayout import Ui_MainWindow
from PyQt5.QtWidgets import QApplication, QMainWindow, QFileDialog, QMessageBox
import pandas as pd
import os
import chardet
class QtCombiner(QMainWindow):
def __init__(self, parent=None):
"""初始化"""
super(QtCombiner... | null | code/QtMain_excel.py | QtMain_excel.py | py | 6,007 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "Ui_QtMainWindowLayout.Ui_MainWindow",
"line_number": 20,
"usage_type": "call"
}... |
569543241 | import scrapy
from utils.date_util import DateUtil
from crawler.items import NewsItem
from bs4 import BeautifulSoup
from scrapy.http import Request, Response
import requests
import json
import socket
import re
import time
from datetime import datetime
# author : 詹婕妤
from crawler.spiders import BaseSpider
class Thaiz... | null | crawler/pass/thaizhonghua.py | thaizhonghua.py | py | 5,951 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "crawler.spiders.BaseSpider",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "socket.setdefaulttimeout",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": ... |
237934947 |
import json
import http.client
import time
class CBfxHist(object):
def __init__(self, mts_end):
self.mts_end = mts_end
self.obj_json_resp = None
self.url_netloc = 'api.bitfinex.com'
self.url_main_path = None
self.url_req_path = None
self.idx_mts_rec = None
def httpGet(self):
self.url_req_path =... | null | demo/py/bfx.http01.py | bfx.http01.py | py | 2,644 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "http.client.client.HTTPSConnection",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "http.client.client",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "http.client",
"line_number": 20,
"usage_type": "name"
},
{
"api_name":... |
543480077 | import torch
from torch.nn import utils
from all.environments import State
from .features import Features
class FeatureNetwork(Features):
def __init__(self, model, optimizer, clip_grad=0):
self.model = model
self.optimizer = optimizer
self.clip_grad = clip_grad
self._cache = []
... | null | all/approximation/feature_network.py | feature_network.py | py | 1,596 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "features.Features",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "features.detach",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "all.environments.State",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.no_grad... |
565271575 | #!/usr/bin/env python3
# load needed modules
import numpy as np
from keras.models import Model
from keras.layers import Dense, Activation, GRU, Flatten, LSTM, Flatten
from keras.layers import Dropout, BatchNormalization, Bidirectional, Input
from sklearn.model_selection import train_test_split
from sklearn.metrics... | null | ser_ravdess_lstm_meanstd.py | ser_ravdess_lstm_meanstd.py | py | 3,541 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "keras.... |
450076305 | # TestTsanSwift.py
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONTRIBUTO... | null | packages/Python/lldbsuite/test/functionalities/tsan/swift/TestTsanSwift.py | TestTsanSwift.py | py | 3,209 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "lldbsuite.test.lldbtest.TestBase",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "lldbsuite.test.lldbtest",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "lldbsuite.test.lldbtest.TestBase.compute_mydir",
"line_number": 26,
"usage_... |
363866648 | bl_info = {
"name": "OpenForge",
"author": "Devon Jones",
"version": (1, 0, 0),
"category": "Mesh",
"description": "Tools to help build gaming models for 3d printing",
"support": "COMMUNITY",
"blender": (2, 80, 0)
}
import bpy
import bmesh
boolean_operations = [
("DIFFERENCE", "Difference", "", 1),
("UNION",... | null | bin/2.80/openforge_addons.py | openforge_addons.py | py | 11,585 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "bpy.data",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "bmesh.from_edit_mesh",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "bpy.context",
"line_number": 82,
"usage_type": "attribute"
},
{
"api_name": "bpy.ops.object.mo... |
175337190 | from django.test import TestCase
from lists.models import List, Item
class ListAndItemModelsTest(TestCase):
def test_saving_items(self):
list_ = List()
list_.save()
item1 = Item()
item1.text = 'the first item'
item1.list = list_
item1.save()
item2 = Item(... | null | lists/tests.py | tests.py | py | 3,630 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.test.TestCase",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "lists.models.List",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "lists.models.Item",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "lists.models.I... |
161035828 | # *-* coding: utf-8 *-*
"""Database interface for dbling."""
import logging
from time import sleep
from celery import Task
from sqlalchemy import select, and_
from sqlalchemy.exc import IntegrityError, InvalidRequestError, DBAPIError
from sqlalchemy.orm import scoped_session, sessionmaker
from common.chrome_db impor... | null | crawl/db_iface.py | db_iface.py | py | 10,244 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlalchemy.orm.scoped_session",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "common.chrome_db.DB_ENGINE",
"line_number": 19,
"usage_type": "name"
},
{
... |
113011786 | import tkinter as tk
from tkinter import ttk, filedialog, simpledialog
import socket
import requests
import json
connected_userId = 0
connected_username = ""
folder_id = None
LARGEFONT =("Verdana", 35)
MEDIUMFONT =("Verdana", 20)
IP = "127.0.0.1"
PORT = 3839
ADDRESS = "http://127.0.0.1:5000"
# Create socket for server... | null | Client.py | Client.py | py | 18,488 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "socket.socket",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_DGRAM",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "tkinter.Fram... |
299841665 | import os
from linebot import LineBotApi, WebhookParser
from linebot.models import MessageEvent, TextMessage, TextSendMessage, ImageSendMessage
channel_access_token = os.getenv("LINE_CHANNEL_ACCESS_TOKEN", None)
def send_text_message(reply_token, text):
line_bot_api = LineBotApi(channel_access_token)
line_... | null | utils.py | utils.py | py | 955 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "linebot.LineBotApi",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "linebot.models.TextSendMessage",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "linebot.Li... |
451940838 | import os
import pathlib
import typing as tp
def repo_find(workdir: tp.Union[str, pathlib.Path] = ".") -> pathlib.Path:
# PUT YOUR CODE HERE
rep_dir = os.environ.get("GIT_DIR", ".git")
workdir = pathlib.Path(workdir).absolute()
if workdir != workdir.root:
workdir = workdir / rep_dir
if... | null | homework04/pyvcs/repo.py | repo.py | py | 1,170 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.Union",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"lin... |
607730120 | from django.urls import path
from django.views.generic import TemplateView
from radioastronomia import views
from radioastronomia import apiviews
app_name = "radioastronomia"
urlpatterns = [
#urls para informacion
path('index', views.RegionCampanaListView.as_view(), name="index"),
path('lista/antenas', v... | null | src/project_module3/radioastronomia/urls.py | urls.py | py | 3,845 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "radioastronomia.views.RegionCampanaListView.as_view",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "radioastronomia.views.RegionCampanaListView",
"line_number": 11,
"us... |
493299645 | import math, json, os, sys
import numpy as np
import _pickle as cPickle
import keras
from keras.applications.resnet50 import ResNet50, preprocess_input
from keras.layers import Dense, Flatten
from keras.models import Model, load_model
from keras.preprocessing.image import ImageDataGenerator
from PIL import Image
from... | null | Source_code/Fine_tune/ResNet50_finetune.py | ResNet50_finetune.py | py | 3,905 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.abspath",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
282901737 | # -*- coding: utf-8 -*-
import click
import logging
from datetime import datetime
from pathlib import Path
from dotenv import find_dotenv, load_dotenv
import pandas as pd
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import f1_score, roc_auc_score
from sklearn.model_selection import train_... | null | src/models/train_model.py | train_model.py | py | 5,302 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.sqrt",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "sklearn.cluster.KMeans",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "pandas.get_dummies"... |
233326471 | import math
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.shortcuts import get_object_or_404
from character.models import SpeziesAttribut, Spezies, SpeziesVorteil, SpeziesNachteil, Fertigkeit
from .models import *
# trigger to post_save: add attribute und fertigkeit... | null | ppServer/create/signals.py | signals.py | py | 4,580 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "character.models",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "character.models",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "character.models.Fertigkeit.objects.all",
"line_number": 18,
"usage_type": "call"
},
{
"api_nam... |
81476430 | import sys
import tensorflow as tf
from .utils import transform_net, mlp
from .flags import FLAGS
# Main class
class pointnet(object):
'''Define a network model and run training
resnet implementation
'''
def __init__(self):
'''initialization
Requires a list of parameters as python ... | null | src/networks/pointnet.py | pointnet.py | py | 5,201 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.variable_scope",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "utils.transform_net",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "flags.FLAGS.TRAINING",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name"... |
192104521 | import torch
from torch import nn
def weighted_binary_cross_entropy(sigmoid_x, targets, pos_weight, weight=None, size_average=True, reduce=True):
"""
Args:
sigmoid_x: predicted probability of size [N,C], N sample and C Class. Eg. Must be in range of [0,1], i.e. Output from Sigmoid.
targets: tru... | null | lib/loss_functions/weighted_bce_loss.py | weighted_bce_loss.py | py | 2,904 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 26,
"usage_type": "name"
}
] |
270135111 | """
get_tags
Created by: Martin Sicho
On: 27.01.21, 9:31
"""
import os
DOCKER_REPO_PREFIX = 'sichom' if not 'GENUI_DOCKER_IMAGE_PREFIX' in os.environ else os.environ['GENUI_DOCKER_IMAGE_PREFIX']
IMAGES = ('genui-base', 'genui-base-cuda', 'genui-main', 'genui-worker', 'genui-gpuworker')
NVIDIA_CUDA_VERSION = '' if not... | null | get_tags.py | get_tags.py | py | 1,976 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "importlib.util.util.spec_from_file_location",
"line_number": 16,
"usage_type": "call"
},
{
"api_na... |
606002894 | #!/usr/bin/env python -O
"""
This is the test class for testing Allocation module algorithms and models.
"""
# -*- coding: utf-8 -*-
#
# rtk.tests.allocation.TestAllocation.py is part of The RTK Project
#
# All rights reserved.
# Copyright 2007 - 2017 Andrew Rowland andrew.rowland <AT> reliaqual <DOT> ... | null | tests/unit/TestAllocation.py | TestAllocation.py | py | 16,105 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.insert",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
... |
88228864 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# utils.py
"""
Utility functions for pyPALM
Copyright (c) 2018, David Hoffman
"""
import numpy as np
import pandas as pd
from xgboost import XGBClassifier
from sklearn.preprocessing import StandardScaler, RobustScaler, PolynomialFeatures
from sklearn.pipeline import make_... | null | utils.py | utils.py | py | 6,607 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 100,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"l... |
394788151 | import os
import numpy
import shutil
import json
from shock import Client as ShockClient
from biokbase.CompressionBasedDistance.Helpers import extract_seq, run_command, make_job_dir, timestamp, CommandError
from biokbase.userandjobstate.client import UserAndJobState
from multiprocessing import Pool
from itertools impor... | null | deployment/lib/biokbase/CompressionBasedDistance/Worker.py | Worker.py | py | 15,274 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.basename",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 56,
"usage_type": "attribute"
},
{
"api_name": "os.path.getsize",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
238226176 | # uncompyle6 version 3.7.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: /tmp/pip-install-jkXn_D/django/django/template/loaders/filesystem.py
# Compiled at: 2018-07-11 18:15:31
"""
Wrapper for loading templates from the filesystem.
""... | null | pycfiles/ka_lite_static-0.17.5-py2-none-any/filesystem.py | filesystem.py | py | 1,879 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.template.loader.BaseLoader",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.TEMPLATE_DIRS",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 25,
"usage_type": "name"
... |
405587044 | # Copyright 2013 – present by the SalishSeaCast Project contributors
# and The University of British Columbia
#
# 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
#
# https://www.apache.o... | null | nowcast/figures/shared.py | shared.py | py | 15,201 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "nowcast.figures.website_theme.figures",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "nowcast.figures.website_theme",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "matplotlib.image.image.imread",
"line_number": 81,
"usage_type":... |
208503218 | from django.core.management.base import BaseCommand, CommandError
from sentry_sdk import capture_message
from ...models import Category
import offapi.management.commands._api as offapi
import offapi.management.commands._updatedb as update
class Command(BaseCommand):
help = 'call the OFF api and populate the DB'
... | null | offapi/management/commands/populate.py | populate.py | py | 814 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "offapi.management.commands._api.ApiRetriever",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "offapi.management.commands._api",
"line_number": 12,
... |
485026540 | from multiprocessing import Process
from solver import solver
if __name__ == '__main__':
tasks = [
'a_example',
'b_little_bit_of_everything',
'c_many_ingredients',
'd_many_pizzas',
'e_many_teams'
]
for task in tasks:
process = Process(target=solver, args=(... | null | lorenzo/main.py | main.py | py | 352 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "multiprocessing.Process",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "solver.solver",
"line_number": 16,
"usage_type": "name"
}
] |
31138418 | # -*- coding: utf-8 -*-
"""
Exemple d'animation d'entités : création d'une super classe EntiteAnime et
appel des méthodes d'animation des entités par itération et surcharge dynamique
"""
import pygame
from pygame import Color
class EntiteAnimee :
""" Un objet représente une entité qui est animée dans une fenêtre P... | null | ExempleSurchargeDynamique.py | ExempleSurchargeDynamique.py | py | 5,926 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.draw.ellipse",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "pygame.Color",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "pygame.draw.rect",
... |
345795530 | import tensorflow as tf
import gym
import numpy as np
env = gym.make("CartPole-v1").env
with tf.Session() as sess:
saver = tf.train.import_meta_graph("./DeepDrive - MeanRew: 200.000000-163.meta")
saver.restore(sess = sess, save_path="./DeepDrive - MeanRew: 200.000000-163")
graph = tf.get_default_graph()
... | null | CartPole/run.py | run.py | py | 809 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gym.make",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "tensorflow.Session",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "tensorflow.train.import_meta_graph",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tensorflo... |
653968667 | from celery.schedules import crontab, timedelta
from celery import Celery, task
from conciertos.conciertos.spiders.madrid import *
from drop import *
from graficas import *
from correo import *
import os
from subprocess import call
from datetime import datetime
# Crea usando RPC para devolver los datos, y el broker A... | null | servidor/tasks.py | tasks.py | py | 1,779 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "celery.Celery",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "celery.schedules.crontab",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime... |
139331769 | # Copyright 2020 Huawei Technologies Co., Ltd.All Rights Reserved.
#
# 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 ap... | null | mindinsight/mindconverter/graph_based_converter/generator/__init__.py | __init__.py | py | 3,887 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.match",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "generator.Generator",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "common.code_fragment.CodeFragment",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "genera... |
466776469 | from typing import List
import random
class TrainingSet:
"""
Representation of training pairs as list of data and list of correct answers
Attributes
----------
data : List[List[float]]
list of input data (represented as vectors)
answers : List[List[float]]
list of answers (rep... | null | TrainingSet.py | TrainingSet.py | py | 4,031 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.List",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": ... |
427172938 | # -*- coding: utf-8 -*-
"""
tasks
~~~~~~~~~~~~~~
A brief description goes here.
:date: 2019:05:23 11:40:26
:copyright: (c) 运维管理 by author.
:license: private, see LICENSE_FILE for more details.
"""
from rq import get_current_job
from flask import current_app
from OMServerApp import db
from OMSer... | null | OMServerApp/users/tasks.py | tasks.py | py | 1,491 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rq.get_current_job",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "models.Task.query.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "models.Task.query",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "model... |
576020432 | #!/bin/python
# -*- coding: utf-8 -*-
import emcee
import numpy as np
import pandas as pd
from .parser import DSGE
from .stats import summary, pmdm_report
from .engine import preprocess, func_dispatch
from .stuff import *
from .tools import *
from .filtering import *
from .estimation import prep_estim, swarms, mcmc, k... | null | pydsge/clsmethods.py | clsmethods.py | py | 10,630 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.diagonal",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.stack",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.stack",
"line_number"... |
651998801 | #!/usr/bin/env python3
import os
import numpy as np
from os import path
# MuJoCo imports
import mujoco_py
DEFAULT_SIZE = 500
class MujocoEnv():
""" Superclass for all MuJoCo environments. Adapted by DLR and ZAL.
based on: https://github.com/openai/gym/blob/6df1b994bae791667a556e193d2a215b8a1e397a/gym/en... | null | environments/MuJoCo/controller/simulation_interface.py | simulation_interface.py | py | 5,007 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_... |
546088789 | import pandas as pd
import os
from pages.PageListaArtigos import PageListaArtigos
from pages.PageAnais import PageAnais
from steps.Anais import Anais
from steps.ListaArtigos import ListaArtigos
from utils.ArquivosUtils import ArquivosUtils
class ExtracaoUtils:
def __init__(self, driver, caminho_extracao, log):
... | null | AutomacaoExtracaoDados/utils/ExtracaoUtils.py | ExtracaoUtils.py | py | 4,814 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "steps.ListaArtigos.ListaArtigos",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "page... |
629084599 |
import numpy as np
import cPickle, gzip
import matplotlib.pyplot as plt
import os
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
from matplotlib import cm
os.chdir('/home/samuel/Desktop/Github/MNISTClassification')
train=pd.read_csv('train.csv')
for i in range(10):
t=train[train.label=... | null | dataVisualisation.py | dataVisualisation.py | py | 1,196 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.chdir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",... |
386619518 | from rest_framework.permissions import BasePermission
from events.models import Event
class IsOrganizer(BasePermission):
message = "you must be the event organizer!"
def has_permission(self, request, view):
event = Event.objects.get(id=view.kwargs['event_id'])
return event.organizer == request.user
def has_ob... | null | events_api/permissions.py | permissions.py | py | 426 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.permissions.BasePermission",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "events.models.Event.objects.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "events.models.Event.objects",
"line_number": 7,
"usage_type": "at... |
259451029 | from pymongo import MongoClient
from tools.config import Config
import rollbar
class MongoCrud(Config):
COLLECTION_REGISTER = "progress_alert_register"
COLLECTION_PROGRESS = "progress_alert_progress"
def mongo_collection(self, collection_name):
try:
uri = "mongodb+srv://{0}:{1}@{2}/{3... | null | tools/mongo_crud.py | mongo_crud.py | py | 3,141 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tools.config.Config",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "tools.config.Config.MONGO_USER",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "tools.config.Config",
"line_number": 13,
"usage_type": "name"
},
{
"api_na... |
285808637 | from imutils import face_utils
import numpy as np
import dlib
import os
import cv2
import joblib
from sklearn.svm import SVC
import training
clf = SVC(kernel='linear')
tl = ''
tt = ''
def train_or_load_facial_expression_recognition_model(train_image_paths, train_image_labels):
tl = train_image_labels
... | null | FaceAndEmotionsRecognition/process.py | process.py | py | 1,508 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sklearn.svm.SVC",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "joblib.load",
"line_nu... |
374204657 |
import argparse
import json
import numpy as np
from numpy.random import seed
import torch
import os
def main(args, repetition):
labelfile = open(os.path.join(args.dataset_path, args.dataset_name,'train_labels.txt'),'r')
labels = [int(x.strip()) for x in labelfile.readlines()]
samples_by_label = {}
s... | null | src/generate_kshot_dataset.py | generate_kshot_dataset.py | py | 2,465 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 1... |
587817932 | import unittest
from selenium import webdriver
from django.test import TestCase
from .models import LinkedinQuery, LinkedinContacts
# models test
class ModelTests(TestCase):
"""LinkedinQuery Model"""
# Testing model instance creation
def create_Linkedin_Query(self, country = "Egypt", company = "Surv", de... | null | linkedin_scrapper/tests.py | tests.py | py | 2,173 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.test.TestCase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "models.LinkedinQuery.objects.create",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.LinkedinQuery.objects",
"line_number": 12,
"usage_type": "attribute"
},
... |
642838845 | import cv2
import rect
import numpy as np
class Scanner(object):
def __init__(self):
pass
def __del__(self):
pass
def auto_canny(self, image, sigma=0.33):
v = np.median(image)
lower = int(max(0, (1.0 - sigma) * v))
upper = int(min(255, (1.0 + sigma) * v))
... | null | document.py | document.py | py | 3,476 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.median",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.Canny",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 31,... |
441929025 | #!/usr/local/bin/python3
#!/usr/bin/env python
import psycopg2
import cgi
import pyproj
import mapGenerator
############################################################
HEADER = "Content-Type: text/html; charset=UTF-8\n\n" \
+ "<html><head><title>Search Results</title>" \
+ "</head><body>"
FOOTER = "... | null | Chapter 08/Windows/DISTAL/cgi-bin/showResults.py | showResults.py | py | 2,560 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "psycopg2.connect",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "cgi.FieldStorage",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pyproj.Geod",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "mapGenerator.generateMa... |
295008737 | # coding: utf-8
'''
This script creates 3-channel gray images from FER 2013 dataset.
It has been done so that the CNNs designed for RGB images can
be used without modifying the input shape.
This script requires two command line parameters:
1. The path to the CSV file
2. The output directory
It generates the i... | null | gen_record.py | gen_record.py | py | 2,015 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "numpy.ravel",
"line_... |
209397051 | #VOCARM Project
#Convolutional Neural Network
#Richard Masson
import tensorflow as tf
from keras.layers import Dense, Activation, Flatten, Dropout, BatchNormalization, Conv2D, MaxPooling2D
from keras.models import Sequential, Model
from keras import regularizers, optimizers
from keras import backend as K
from keras.op... | null | cnn.py | cnn.py | py | 8,183 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.config.experimental.list_physical_devices",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "tensorflow.config",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.config.experimental.set_memory_growth",
"line_number":... |
50289957 | """
@Name: scheduler
@Description: ''
@Author: Lucas Yu
@Created: 2018/9/13
@Copyright: ©GYENNO Technology,Shenzhen,Guangdong 2018
@Licence:
"""
import networkx as nx
import path
from .common import MyProcessor
class AppGraph(object):
def __init__(self):
self.para = dict()
self.... | null | bak/recognition_pre_fog_simple_pipe/bak/recognition_pre_fog_dag/commons/scheduler.py | scheduler.py | py | 4,524 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "networkx.DiGraph",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "path.Path",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "path.Path",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "common.MyProcessor",
"line_n... |
295722694 | import os
import random
import numpy as np
from random import shuffle
import matplotlib.pyplot as plt
from PIL import Image
import sys
sys.path.append('C:\\Users\\Nick\\Desktop\\Ava\\Programs')
from Library.General import FileThings as FT
"""
TODO
- clean up
"""
### IMAGE FILE ###
def load_data_labels(filepaths,... | null | Library/General/DataThings.py | DataThings.py | py | 2,965 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "random.shuffle",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "Library.General.FileThings... |
58413481 | # coding:utf-8
import json
from tornado import httpclient, gen
from tornado.ioloop import IOLoop
@gen.coroutine
def fetch(url):
try:
response = yield httpclient.AsyncHTTPClient().fetch(url)
data = response.body if isinstance(response.body, str) else response.body.decode(errors='ignore')
js... | null | lib/GetJsonFromHttp.py | GetJsonFromHttp.py | py | 480 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tornado.httpclient.AsyncHTTPClient",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tornado.httpclient",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torn... |
452645232 | from setuptools import setup
import setuptools
with open("README.md", 'r', encoding='utf8') as f:
long_description = f.read()
setup(
name = 'cptools', # 包名称
version = '1.1.1', # 版本号,我个人喜欢从1开始
author = 'GentleCP',
author_email = '574881148@qq.com',
description = 'Tools used by CP',
long_... | null | pypi_install_script/cptools-1.1.1.tar/setup.py | setup.py | py | 990 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "setuptools.setup",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 21,
"usage_type": "call"
}
] |
41201632 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pylab, math
import numpy as np
import matplotlib.pyplot as plt
from scipy import integrate
from scipy import signal
#Esta funcion modula y decodifica una cadena de bits para cierto AWGN
def tarea4(P_ruido, frec, muestras, bits):
#Onda portadora. Referencia para... | null | tarea4.py | tarea4.py | py | 3,556 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.linspace",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pylab.plot",
"line_number"... |
514010793 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import wx
import wx.lib.buttons as buttons
#import datetime
from datetime import datetime, timedelta
import pyTCExam
import pyTCExamApp
import pyTCExamTest
import pyTCExamCommon
import pyTCExamHtmlWindowQuestionGui as question_gui
#---------------------------------------... | null | pyTCExamTestGui.py | pyTCExamTestGui.py | py | 16,554 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "wx.Panel",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "wx.Panel.__init__",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "wx.Panel",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "wx.NewId",
"line_nu... |
117055681 | """
Задание 1.
Реализуйте кодирование строки "по Хаффману".
У вас два пути:
1) тема идет тяжело? тогда вы можете, опираясь на пример с урока, сделать свою!!! версию алгоритма
Разрешается и приветствуется изменение имен переменных, выбор других коллекций, различные изменения
и оптимизации.
2) тема понятна? постар... | null | Урок 8. Практическое задание/task_1.py | task_1.py | py | 2,505 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.deque",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 27,
"usage_type": "call"
}
] |
591238290 | import kivy
kivy.require('1.0.1') # replace with your current kivy version !
import HomeHelpService_Database as DB
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.gridlayout import GridLayout
from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition
from kivy.lang import Builder
... | null | HomeHelpService_API.py | HomeHelpService_API.py | py | 2,710 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "kivy.require",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "kivy.uix.boxlayout.BoxLayout",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "kivy.properties.ObjectProperty",
"line_number": 22,
"usage_type": "call"
},
{
"api_name"... |
571893140 | import time
import os, sys
import sched
cmd_str1 = "spark-submit --class edu.bupt.iot.spark.common.RecentData /home/spark/iot.jar"
cmd_str2 = "spark-submit --class edu.bupt.iot.spark.common.RecentDevice /home/spark/iot.jar"
# cmd_str1 = "ls"
# cmd_str2 = "ls -lh"
# 初始化sched模块的scheduler类
# 第一个参数是一个可以返回时间戳的函数,第二个参数可以在... | null | analysis_time.py | analysis_time.py | py | 1,442 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sched.scheduler",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.system",
"line_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.