id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
6644003
""" Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve. 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 agre...
StarcoderdataPython
1910037
import logging import sys logger = logging.getLogger('') logger.setLevel(logging.DEBUG) handler = logging.StreamHandler(sys.stderr) handler.setLevel(logging.DEBUG) formatter = logging.Formatter('%(levelname)-8s %(message)s') handler.setFormatter(formatter) logger.addHandler(handler)
StarcoderdataPython
3468045
<filename>migrations/versions/3361a5e3e546_.py """empty message Revision ID: 3<PASSWORD> Revises: <PASSWORD> Create Date: 2020-04-05 20:28:21.986854 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision = '<PASSWORD>' down_revision ...
StarcoderdataPython
11263920
<reponame>ahriknow/ahriknow # Generated by Django 3.0.4 on 2020-04-10 06:40 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('notebook', '0006_auto_20200409_0940'), ] operations = [ migrations.CreateModel( name='Tag', ...
StarcoderdataPython
4808333
<filename>coursebuilder/third_party/gae_mini_profiler/templatetags.py # Copyright 2020 Google LLC # # 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/LICEN...
StarcoderdataPython
5158474
<filename>data/transcoder_evaluation_gfg/python/COUNT_PAIRS_TWO_SORTED_ARRAYS_WHOSE_SUM_EQUAL_GIVEN_VALUE_X_1.py # Copyright (c) 2019-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # def f_gold ( ar...
StarcoderdataPython
3533880
import numpy as np import pandas as pd from regression import (logreg, utils) from sklearn.preprocessing import StandardScaler def main(): # load data with default settings X_train, X_val, y_train, y_val = utils.loadDataset(features=['Penicillin V Potassium 500 MG', 'Computed tomography of chest and abdomen',...
StarcoderdataPython
11270270
<gh_stars>1-10 import numpy as np # ======================================================================== def p0_printer(par): iproc = par.rank def printer(*args, **kwargs): if iproc == 0: print(*args, **kwargs) return printer # ==================================================...
StarcoderdataPython
8013462
<reponame>Nullius-2020/SSL-Competitioin-Top-10-solution # coding: utf8 # Copyright (c) 2020 PaddlePaddle Authors. 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 # ...
StarcoderdataPython
5090598
import pytest # from pytest import approx # approx wasn't working on numpy arrays, use the builtin numpy testing functions from HSTPBin import PyPeekXTF from HSTB.drivers import HDCSio from HSTB.drivers import hipsio import numpy # @pytest.fixture # creates an object used in the parameters of a function # @pytest.f...
StarcoderdataPython
206939
from setuptools import setup, find_packages long_description = ''' Headliner is a sequence modeling library that eases the training and **in particular, the deployment of custom sequence models** for both researchers and developers. You can very easily deploy your models in a few lines of code. It was originally bu...
StarcoderdataPython
9719911
# -*- coding:utf8 -*- # File : desc_discogan_edges2shoes_cnn.py # Author : <NAME> # Email : <EMAIL> # Date : 4/2/17 # # This file is part of TensorArtist. import re from tartist.app import gan from tartist.app.gan import GANGraphKeys from tartist.core import get_env, get_logger from tartist.core.utils.naming imp...
StarcoderdataPython
6656598
import json import datetime from copy import deepcopy from inflection import underscore, pluralize def set_root_name(object, root_name=None): if(root_name): return root_name else: if(object): object_type = type(object) if(object_type is list): return plu...
StarcoderdataPython
3485307
<filename>meiduo_mall/meiduo_mall/apps/oauth/migrations/0002_remove_oauthqquser_is_delete.py # Generated by Django 2.1.8 on 2019-05-30 12:51 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('oauth', '0001_initial'), ] operations = [ ]
StarcoderdataPython
8055520
import numpy as np import matplotlib.pyplot as plt import MatplotlibSettings xi = 0.5 x, y = [-1, 1, xi, xi, 1, -1, -xi, -xi, -1], [1, 1, xi, -xi, -1, -1, -xi, xi, 1] x1, y1 = [-xi, 0, -xi], [xi, 0, -xi] x2, y2 = [xi, 0, xi], [xi, 0, -xi] x3, y3 = [-xi, xi, xi, -xi], [1, 1, -1, -1] plt.axis("off") plt.arrow(-1.2, 0,...
StarcoderdataPython
6419496
<reponame>christophesaintjean/IntroProgS1_2020 lettres = 'abcd' for i, lettre in enumerate(lettres): print(i, lettre) for il in enumerate(lettres): print(il)
StarcoderdataPython
8158706
<reponame>steel-a/python-pandas-tutorial<gh_stars>0 def rootPackageFunction(): print('This is the rootPachageFunction')
StarcoderdataPython
6415872
from dataclasses import dataclass from quran.domain.entity import Entity @dataclass class Audio(Entity): id: str ayah_id: str ayah_number: int edition_id: str type: str # Translation or Arabic audio: str
StarcoderdataPython
3426380
# SPDX-License-Identifier: MIT # Copyright © 2020 <NAME> # ============================================================================== """High-level converter functions and CLI entry point""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __fu...
StarcoderdataPython
56057
import torch import torch.nn as nn import torchvision.models as models class EncoderCNN(nn.Module): def __init__(self, embed_size): super(EncoderCNN, self).__init__() resnet = models.resnet50(pretrained=True) for param in resnet.parameters(): param.requires_grad_(False) ...
StarcoderdataPython
12810463
<filename>core/domain/exp_domain.py<gh_stars>1-10 # coding: utf-8 # # Copyright 2014 The Oppia Authors. 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://ww...
StarcoderdataPython
1667313
import base64 import json import logging import os import subprocess import tempfile import zipfile from datetime import datetime import jwt import requests from celery import shared_task from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import serialization from django.apps ...
StarcoderdataPython
9787827
<gh_stars>0 import streamlit as st import json import requests import pandas as pd from pygooglenews import GoogleNews import nltk nltk.data.path.append('./nltk.txt') nltk.download('vader_lexicon') import plotly.graph_objects as go st.set_page_config(page_title="News Classifier by Akash",page_icon='📰',lay...
StarcoderdataPython
1999610
# Generated by Django 3.2.4 on 2021-07-05 15:55 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('pokefriend', '0003_alter_trainer_last_modified'), ] operations = [ migrations.AlterModelOptions( name='trainer', opt...
StarcoderdataPython
5086263
import pandas as pd import numpy as np import matplotlib import matplotlib.pyplot as plt from sklearn import preprocessing matplotlib.use("Agg") import datetime from finrl.apps import config from finrl.neo_finrl.preprocessor.yahoodownloader import YahooDownloader from finrl.neo_finrl.preprocessor.preprocessors import...
StarcoderdataPython
6571269
# ========================================= # IMPORT / EXPORTs # -------------------------------------- import rootpath rootpath.append() from collections import *
StarcoderdataPython
1726766
from base import BaseDataLoader import data_loader.polyphonic_dataloader as poly from data_loader.seq_util import seq_collate_fn class PolyMusicDataLoader(BaseDataLoader): def __init__(self, batch_size, data_dir='jsb', split='train', shuffle=True...
StarcoderdataPython
4903794
import os import json LEDGER_CHANNELS = { channel: settings for channels in json.loads(os.getenv('LEDGER_CHANNELS')) for channel, settings in channels.items() } LEDGER_MSP_ID = os.getenv('LEDGER_MSP_ID') LEDGER_USER_NAME = os.getenv('LEDGER_USER_NAME') LEDGER_PEER_HOST = os.getenv('LEDGER_PEER_HOST') LED...
StarcoderdataPython
4816022
<gh_stars>1-10 """ Data and methods to retrieve app specific configuration """ import json import requests APP_ID = { "HOME": "00000000-0000-0000-0000-000000000000", "YOUTUBE": "YouTube", "NETFLIX": "Netflix", "TICTACTOE": "TicTacToe", "GOOGLE_MUSIC": "GoogleMusic", "PLAY_MOVIES": "PlayMovies...
StarcoderdataPython
3472488
#! /usr/bin/env python import time from context import RRT, utils from RRT import RRT import utils from utils import adjustable_random_sampler as sampler from utils import los_optimizer as path_optimizer import matplotlib.pyplot as plt if __name__ == '__main__': # List of obtacles as a list of lists of po...
StarcoderdataPython
1637266
# -*- coding: utf-8 -*- """ Created on Mon Dec 17 16:06:20 2018 @author: adam.rees """ import unittest import DBEISCarbonFactors class test_InstanceNames(unittest.TestCase): def setUp(self): pass def test_new_flat_class_creation(self): try: # Create a class fo...
StarcoderdataPython
3518760
<reponame>LC231/csws-week1<gh_stars>0 age = 12 if age < 4: price = 0 elif age < 18: price = 25 else: price = 40 print(f"Your admission cost is ${price}.") # doesnt have to end with an else statement
StarcoderdataPython
1852727
<reponame>kafi2016/chainer-kafi<filename>chainer/functions/evaluation/accuracy.py import numpy import six from chainer import cuda from chainer import function from chainer.utils import type_check class Accuracy(function.Function): def __init__(self, ignore_label=None): self.ignore_label = ignore_label ...
StarcoderdataPython
4947356
import configparser import json import os import pprint import pytest from src.common import kubeclient env_config_data = [ ("wait_for_res_to_appear_num_attempts", 15, int), ("wait_for_res_to_appear_interval_secs", 1, int), ("wait_for_pod_to_be_done_num_attempts", 100, int), ("wait_for_pod_to_be_don...
StarcoderdataPython
6433585
<gh_stars>1-10 #!/usr/bin/python ## ## THmain.py ## ## Written by <NAME> - January 2016 ## ## The main function for the CL version of TourneyHelper from THAssistant import THAssistant def main(): print "Welcome to TourneyHelper" print "What would you like to do?" print "\t1 - Calculate Prize Pool Distribu...
StarcoderdataPython
108040
<filename>modules/pretrain_options.py from collections import OrderedDict pretrain_opts = OrderedDict() pretrain_opts['use_gpu'] = True pretrain_opts['init_model_path'] = './models/imagenet-vgg-m.mat' pretrain_opts['model_path'] = './models/rt_mdnet.pth' pretrain_opts['log_dir'] = './log' pretrain_opts['batch_frames...
StarcoderdataPython
1763998
<reponame>BeryJu/passbook # Generated by Django 3.1 on 2020-08-23 22:46 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("authentik_crypto", "0002_create_self_signed_kp"), ("authentik_providers_proxy", "0002_proxyp...
StarcoderdataPython
6457356
<filename>mypyapp/imagemanager.py import os import torch from flask import current_app from PIL import Image from torchvision import models, transforms from werkzeug.utils import secure_filename from . import db from .models import TrainingFile class ImageManager: def __init__(self, file, label): self....
StarcoderdataPython
4920663
# Copyright 2014 Mirantis, Inc. # # 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 ...
StarcoderdataPython
73793
from typing import List from models.metrics import MetricBase # from models.modeltrainer import ModelTrainerBase class CallbackBase(object): def __call__(self, *args, **kwargs): raise NotImplementedError def on_train_begin(self, *args, **kwargs): raise NotImplementedError def on_epoch...
StarcoderdataPython
1640580
from django.contrib.auth.decorators import permission_required from django.contrib.auth.models import User from django.core.exceptions import SuspiciousOperation from django.db.models import Q from django.forms import model_to_dict from django.shortcuts import render from endportal import utils from logs.models import...
StarcoderdataPython
12860605
import re import copy from collections import defaultdict from string import Template # initialize the dictionary for the methods with checked exceptions such as {fake method: real method} method_dict_checked = {'deleteRecord' : 'delete', \ 'editText' : 'setText_new', \ 'insertData' : 'insert_new', \ 'setLayout...
StarcoderdataPython
4909396
<gh_stars>1-10 import os import mozumder from ...models.development import * from .models import * from .templates import * from .views import * from .urls import * from .admin import * from ..utilities.name_case import * from shutil import copyfile def write_app(app_obj): app_name = app_obj.name ...
StarcoderdataPython
1861576
<filename>fetch_cord/run_command.py #from __future__ import annotations from typing import List import subprocess def run_command(command: List[str], shell: bool = False): return subprocess.run( command, encoding="utf-8", stdout=subprocess.PIPE, shell=shell ).stdout class BashError(Exception): ...
StarcoderdataPython
5041313
<reponame>RaymondDashWu/generative-structures-dapp import hashlib from typing import Union from eth_typing import Hash32 def hash_eth2(data: Union[bytes, bytearray]) -> Hash32: """ Return SHA-256 hashed result. Note: this API is currently under active research/development so is subject to change wit...
StarcoderdataPython
263754
<reponame>SamLubbers/rebel_backup<filename>generate_key.py #!/usr/bin/env python3 from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.asymmetric import rsa from cryptography.hazmat.primitives import serialization if __name__ == '__main__': private_key = rsa.generate_priva...
StarcoderdataPython
3203915
from . import e1 from . import e2 from . import e3 from . import destijl
StarcoderdataPython
1801191
#********************************************************** #* CATEGORY JARVIS HOME AUTOMTION #* GROUP SPEECH TO TEXT #* AUTHOR <NAME> <<EMAIL>> #********************************************************** #Jarvis Home Automation #Copyright (C) 2017 Haynie Research & Development #This program is free sof...
StarcoderdataPython
11367572
"""CommitLimit class used to determine whether a commit is out of the desired range.""" from datetime import datetime from typing import Optional from git import Commit class CommitLimit(object): """Represents the point in time at which to start analyzing commits of an evergreen project.""" def __init__( ...
StarcoderdataPython
11367915
# -*- coding:utf-8 -*- from os.path import abspath, join, dirname from setuptools import find_packages, setup with open('requirements.txt') as f: required = f.read().splitlines() this_dir = abspath(dirname(__file__)) with open(join(this_dir, 'README.md'), encoding='utf-8') as file: long_description = file.re...
StarcoderdataPython
4964267
from __future__ import print_function, absolute_import, division import six import jinja2 class FileConfiguration(object): def __init__(self, filepath, local_variables, global_variables=None): self.config = {} if global_variables: self.config.update(global_variables) new_loc...
StarcoderdataPython
3230585
<filename>erroranalysis/erroranalysis/analyzer/__init__.py<gh_stars>100-1000 # Copyright (c) Microsoft Corporation # Licensed under the MIT License. """Module for defining the analyzers.""" from .error_analyzer import ModelAnalyzer, PredictionsAnalyzer __all__ = ["PredictionsAnalyzer", "ModelAnalyzer"]
StarcoderdataPython
4880192
<gh_stars>0 """Define the units/scaling tests.""" import unittest from openmdao.utils.testing_utils import use_tempdirs from openmdao.core.tests.test_scaling_report import TestDriverScalingReport class TestDriverScalingReportMPI(TestDriverScalingReport): N_PROCS = 2 if __name__ == '__main__': unittest.main...
StarcoderdataPython
1889923
<reponame>yuxuan-lou/ColossalAI-Examples from typing import Callable import torch from colossalai import nn as col_nn from colossalai.registry import MODELS from torch import dtype, nn from model_zoo.vit.vit import ViTBlock, ViTEmbedding from utils import heads, objectives import torch.nn.functional as F from colossala...
StarcoderdataPython
3586583
<gh_stars>1-10 import getopt import socket import sys import threading import traceback import os from queue import Queue from github.GithubException import RateLimitExceededException from github.GithubException import GithubException from github.GithubException import BadCredentialsException from github.GithubExcepti...
StarcoderdataPython
1900178
#ABC052b import sys input = sys.stdin.readline sys.setrecursionlimit(10**6) n = int(input()) s = input() x = 0 maX = 0 for i in s: if (i == "I"): x += 1 maX = max(maX, x) else: x -= 1 print(maX)
StarcoderdataPython
6558733
<filename>meerkat/datapanel.py """DataPanel class.""" from __future__ import annotations import logging import os import pathlib from contextlib import contextmanager from copy import copy, deepcopy from typing import Any, Callable, Dict, Iterable, List, Optional, Sequence, Tuple, Union import cytoolz as tz import da...
StarcoderdataPython
237242
<reponame>tgbugs/mlab #!/usr/bin/env python3.3 """Main file for database stuff Usage: main.py [(-e | --echo) (-p | --pgsql) (-w | --wipe) (-s | --setup) (-t | --test) (-i | --ipython)] main.py (-h | --help ) Options: -h --help show this -e --echo enable echo -p --pgsql use postgres...
StarcoderdataPython
59037
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os from nose.tools import eq_, ok_ from werkzeug.test import Client from werkzeug.wrappers import BaseResponse from clastic import Application from clastic.render import JSONRender, JSONPRender, render_basic from common import (hello_world_str, ...
StarcoderdataPython
3377664
<filename>train.py ''' Train a fully convolutional network for earthquake magnitude. ''' from __future__ import print_function import os os.environ["CUDA_VISIBLE_DEVICES"] = "5,6" import keras from keras.datasets import mnist from keras import losses from keras import optimizers from keras.models import Sequential fro...
StarcoderdataPython
4844060
<reponame>richardstrnad/acitoolkit #!/usr/bin/env python """ Find out where a contract has been imported and consumed on an EPG. """ from acitoolkit import (Credentials, Session, Tenant, ContractInterface, AppProfile, EPG) from tabulate import tabulate data = [] def main(): """ Main ...
StarcoderdataPython
6502674
<gh_stars>1-10 # Exercise 087 - More on Array in Python """Enhance the previous challenge by showing at the end: A) The sum of all even values entered. B) The sum of the values in the third column. C) The largest value of the second row.""" list_a = list() list_b = list() for i in range(0, 3): # For each line. ...
StarcoderdataPython
298000
# Copyright 2020–2021 Cirq on IQM developers # # 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...
StarcoderdataPython
11242330
# -*- coding: utf-8 -*- def test_files_comments_delete(slack_time): assert slack_time.files.comments.delete def test_files_delete(slack_time): assert slack_time.files.delete def test_files_info(slack_time): assert slack_time.files.info def test_files_list(slack_time): assert slack_time.files.lis...
StarcoderdataPython
32928
<reponame>GuanLab/DeepSleep from __future__ import print_function import os import sys import numpy as np from keras.models import Model from keras.layers import Input, concatenate, Conv1D, MaxPooling1D, Conv2DTranspose,Lambda from keras.optimizers import Adam from keras.callbacks import ModelCheckpoint from keras imp...
StarcoderdataPython
11241580
# -*- test-case-name: twisted.web2.test.test_httpauth -*- # Copyright (c) 2006-2008 Twisted Matrix Laboratories. """ Implementation of RFC2617: HTTP Digest Authentication http://www.faqs.org/rfcs/rfc2617.html """ import sys import time import random from twisted.cred import credentials, error from zope.interface imp...
StarcoderdataPython
5090707
<filename>neurolang/tests/test_regions.py import numpy as np import pytest from numpy import random import nibabel as nib from ..aabb_tree import AABB from ..CD_relations import (cardinal_relation, cardinal_relation_prepare_regions, direction_matrix, is_in_direc...
StarcoderdataPython
4904461
<gh_stars>1-10 """ """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import sys import numpy as np import input_pipe_line import data_preprocessing import tensorflow as tf import unittest import cv2 as cv class test_input_pipe_line(unittest.Tes...
StarcoderdataPython
4983254
<reponame>ap98nb26u/pyvisa # -*- coding: utf-8 -*- """ pyvisa.ctwrapper ~~~~~~~~~~~~~~~~ ctypes wrapper for NI-VISA library. This file is part of PyVISA. :copyright: 2014 by PyVISA Authors, see AUTHORS for more details. :license: MIT, see LICENSE for more details. """ from __future__ import ...
StarcoderdataPython
291453
<gh_stars>1-10 import unittest from .test_util import map_path from simulator_diagnoser.matcher import MatcherResult, \ Terminal, \ Sequence, \ RuleException class SequenceMatcherTest(unittest.TestC...
StarcoderdataPython
1834014
import collections c = collections.Counter('hello world') print(c) print(c.most_common(3))
StarcoderdataPython
6665784
<filename>seminars/09/02.py #!/usr/bin/env python3 from os import get_terminal_size import numpy as np cols, rows = get_terminal_size() display = np.zeros([rows, cols], dtype=np.uint8) board = display[1:-1, 1:-1] board[...] = np.random.randint(0, 2, size=board.shape) Y, X = board.shape while True: for y in rang...
StarcoderdataPython
4823429
<reponame>JDYuuki/genshin_task-resin-expedition_alert def get_server(uid: int) -> str: if str(uid).startswith('1'): return 'cn_gf01' # 天空岛 elif str(uid).startswith('5'): return 'cn_qd01' # 世界树 else: return ''
StarcoderdataPython
3213960
<reponame>syngenta-digital/package-python-alc import time import inspect def troubleshoot(function): def wrapper(*args, **kwargs): print('called: {}.{}'.format(function.__module__,function.__name__)) arguments = inspect.signature(function).bind(*args, **kwargs).arguments arguments = ', '.jo...
StarcoderdataPython
5061952
# Entrada while True: fecha = int(input("Ingrese el año: ")) if fecha > 0: break # Proceso y salida if fecha % 4 == 0 or (fecha % 100 == 0 and fecha % 400 == 0): print("%d es bisiesto" % fecha) else: print("%d no es bisiesto" % fecha)
StarcoderdataPython
8127428
from bims.tasks.collection_record import * # noqa from bims.tasks.cluster import * # noqa from bims.tasks.search import * # noqa from bims.tasks.search_version_2 import * # noqa
StarcoderdataPython
3445236
from django.urls import path from djf_surveys.admins import views as admin_views urlpatterns = [ path('', admin_views.AdminSurveyListView.as_view(), name='admin_survey'), path('create/survey/', admin_views.AdminCrateSurveyView.as_view(), name='admin_create_survey'), path('edit/survey/<str:slug>/', admin_v...
StarcoderdataPython
9658311
from __future__ import print_function from __future__ import absolute_import from __future__ import division import compas_rhino from compas_rhino.artists import Artist from compas.utilities import color_to_colordict __all__ = ['NetworkArtist'] class NetworkArtist(Artist): """A network artist defines function...
StarcoderdataPython
9785704
<reponame>kirillzhosul/video-hosting #!usr/bin/python """ Video hosting API videos CRUD operations. Interface to database CRUD operations. """ from typing import Optional, List from sqlalchemy.orm import Session import models import schemas def get_popular_videos(db: Session, offset: int, limit: int) -> Li...
StarcoderdataPython
6475106
import itertools from typing import Dict, Union from ..set5.challenge39 import inverse_mod from .challenge43 import ( get_dsa_constants, get_private_dsa_key_message_val, get_sha1_fingerprint, ) def parse_text_file(): lines = [] with open("44.txt") as file_handle: lines = file_handle.read...
StarcoderdataPython
9760970
""" Django settings for a simple project. Generated by 'django-admin startproject' using Django 1.8.8. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build pat...
StarcoderdataPython
93808
<reponame>ljod-is/poetcave # Generated by Django 3.1.5 on 2021-03-07 18:59 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('poem', '0012_bookmark'), ] operations = [ migrations.AddField( model_name='poem', name='p...
StarcoderdataPython
3279783
import json import pandas as pd import urllib.parse #input data from tkinter import Tk from tkinter import filedialog from enum import Enum import io def get_file_path_csv(): root = Tk() root.update() def open_file(): file = filedialog.askopenfilename(filetypes=[("csv files", "*.csv")]) r...
StarcoderdataPython
6586408
<filename>Utils.py def read_json(filename): import json with open(filename) as i: for line in i: try: d = json.loads(line) yield d except: continue def write_json(filename, rows): import json with open(filename, 'w') as o: ...
StarcoderdataPython
6568273
from setuptools import setup, find_packages setup( name="rasa_addons", version="2.3.3-bf.4", author="Botfront", description="Rasa Addons - Components for Rasa and Botfront", install_requires=[ "requests", "requests_futures", "fuzzy_matcher", "fbmessenger", "s...
StarcoderdataPython
8039729
# -*- coding: utf-8 -*- #***************************************************************************** # Copyright (C) 2003-2006 <NAME>. # Copyright (C) 2006 <NAME>. <<EMAIL>> # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this softw...
StarcoderdataPython
8187318
# coding: utf-8 # /*########################################################################## # # Copyright (c) 2016-2018 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to d...
StarcoderdataPython
8027601
<reponame>juju-solutions/interface-spark # 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...
StarcoderdataPython
1754731
<filename>python/sdk/data/CANFrame.py import base64 import json import time import sdk.util as util from sdk.data.Mappable import Mappable class CANFrame(Mappable): """CAN Frame data class""" __slots__ = ('timestamp', 'frame_id', 'data', 'response') def __init__(self, frame_id, data): """ ...
StarcoderdataPython
8136481
import torch class VGGPerceptron(torch.nn.Module): """ A class representing the standard VGG perceptron for feature extraction Attributes ---------- model : torch.nn.Module the inner architecture Methods ------- __create_model(cfg,in_channles,data_size,batch_norm) cre...
StarcoderdataPython
6474097
<reponame>Kalpavrikshika/python_modules int_var = 1779 next(int_var) my_string = "Yasoob" my_iter = iter(my_string) print(next(my_iter))
StarcoderdataPython
120817
<gh_stars>0 import cv2 import pyzed.sl as sl import numpy as np import time def print_camera_information(cam): print("Resolution: {0}, {1}.".format(round(cam.get_resolution().width, 2), cam.get_resolution().height)) print("Camera FPS: {0}.".format(cam.get_camera_fps())) print("Firmware: {0}.".format(cam.g...
StarcoderdataPython
12708
from __future__ import absolute_import # flake8: noqa # import apis into api package import speechpro.cloud.speech.synthesis.rest.cloud_client.api.session_api import speechpro.cloud.speech.synthesis.rest.cloud_client.api.synthesize_api
StarcoderdataPython
6504782
from Xdmf import * if __name__ == "__main__": #//initialization begin baseArray = XdmfArray.New() for i in range(0, 10): baseArray.pushBack(i) initStart = UInt32Vector() initStart.push_back(0) initStride = UInt32Vector() initStride.push_back(1)...
StarcoderdataPython
1970064
import numpy as np import gym import time import gridworld env = gym.make("CliffWalking-v0") # 0 up, 1 right, 2 down, 3 left
StarcoderdataPython
4941634
# Optimal Account Balancing # given a list of transactions between a group of people, with each transaction # as a tuple (x, y, z), meaining person x send person y amount z of money # assume x != y and z > 0, id x and y might not be linear # return the minimum number of transactions required to settle the debt # Optima...
StarcoderdataPython
3484117
<filename>Separate.py #coding:utf-8 import cv2 import os import sys import numpy as np #将其他文件夹的图片搬移到另外一个文件夹并重命名 ListDir='/home/kjin/caffe-master/examples/DeepID/CASIA-FaceV5-Train/' List=os.listdir(ListDir) num=2126 for list in List: img=cv2.imread(ListDir+list) cv2.imwrite('/home/kjin/caffe-master/examples/VGG...
StarcoderdataPython
116754
import torch import os import datetime import pickle import dill import random import numpy as np import torch.nn as nn import torch.nn.functional as F import pandas as pd from torch.optim.lr_scheduler import ReduceLROnPlateau from torch import optim from random import choices from scipy.stats import e...
StarcoderdataPython
11245795
#!/usr/bin/env python # -*- coding: utf-8 -*- """ API functions that can be used by external software """ from collections import OrderedDict from pathlib import Path import os import traceback from rebulk.introspector import introspect from .__version__ import __version__ from .options import parse_options, load_c...
StarcoderdataPython
4966724
import torch.nn as nn def initialize_decoder(module): for m in module.modules(): if isinstance(m, nn.Conv2d): nn.init.kaiming_uniform_(m.weight, mode="fan_in", nonlinearity="relu") if m.bias is not None: nn.init.constant_(m.bias, 0) elif isinstance(m, nn.B...
StarcoderdataPython