id
stringlengths
1
7
text
stringlengths
6
1.03M
dataset_id
stringclasses
1 value
3266750
<filename>backend/massiliarp/migrations/0001_initial.py # Generated by Django 3.2.7 on 2021-09-24 14:10 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( ...
StarcoderdataPython
1773528
# coding: utf-8 # # This file is part of Sequana software # # Copyright (c) 2016 - Sequana Development Team # # File author(s): # <NAME> <<EMAIL>>, # <<EMAIL>> # # Distributed under the terms of the 3-clause BSD license. # The full license is in the LICENSE file, distributed with this software. # # ...
StarcoderdataPython
190608
<filename>NC_optical_properties_v_alt_variable_coating.py<gh_stars>1-10 from pymiecoated import Mie import sys import os import numpy as np from pprint import pprint from datetime import datetime import mysql.connector import math import matplotlib.pyplot as plt import matplotlib.colors import calendar from scipy.optim...
StarcoderdataPython
3365710
<filename>printing/PSWriter.py<gh_stars>0 """Wrapper for the PSStream to support the standard AbstractWriter interface. """ __version__ = '$Revision: 1.10 $' import formatter import string import utils class PSWriter(formatter.AbstractWriter): """Class PSWriter supports the backend interface expected by Grai...
StarcoderdataPython
3255300
<filename>train_byol.py import torch from byol_pytorch import BYOL import torchvision from torchvision import models import torchvision.transforms as transforms import torch.nn as nn from torch.autograd import Variable use_gpu = torch.cuda.is_available() resnet = models.resnet50(pretrained=True) learner = BYOL( ...
StarcoderdataPython
3254820
materiais = ['caneta', 'caderno', 'livro', 'lapis'] print(materiais) #printing each element from the list materiais = ['caneta', 'caderno', 'livro', 'e-book'] for material in materiais : print(material) #this is the for body print(material.title()) print(len(materiais)) # "for" makes variable "material" ...
StarcoderdataPython
1618221
# _*_ coding: utf-8 _*_ from django.db import models from django.contrib.auth.models import AbstractUser from fastrunner.models import Project class User(AbstractUser): belong_project = models.ManyToManyField(Project, blank=True, help_text="所属项目", verbose_name="所属项目", r...
StarcoderdataPython
4817398
from tkinter import * import sqlite3 import random import pickle conn = sqlite3.connect('clickbait.db') c = conn.cursor() def close(): conn.close() window.destroy() exit() def history(): output.delete(0.0, END) c.execute("SELECT * FROM history") history = c.fetchall() numout = 1.0 numarr = 0 ...
StarcoderdataPython
3227736
from PIL import Image, ImageTk from tkinter import messagebox import tkinter as tk import numpy as np import matplotlib.pyplot as plt import cv2 as cv #from tkinter import ttk window = tk.Tk() # create window window.title( 'B063040061 hw2' ) # name title flagOpen = False # file open flag flagOB = False #...
StarcoderdataPython
882
# Copyright 2016 Quora, 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 agreed to in writing, so...
StarcoderdataPython
3344961
<gh_stars>1-10 #!/usr/bin/env python # # pKaTool - analysis of systems of titratable groups # Copyright (C) 2010 <NAME> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the ...
StarcoderdataPython
3387622
<gh_stars>1-10 #!/usr/bin/python import os import sys import appdirs import json from pathlib import Path as plPath from operator import itemgetter from settings import * from tkinter import filedialog from pygubu import Builder as pgBuilder # if dist fails to start because it's missing these, uncomment these two im...
StarcoderdataPython
3285339
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2021/12/6 12:17 # @Author : weihuchao class Solution(object): def largestTimeFromDigits(self, arr): """ :type arr: List[int] :rtype: str """ arr.sort() ret_val, ret_str = -1, "" def get_time(a, b, c,...
StarcoderdataPython
1717427
<filename>velocidade.py '''Escreva um programa que pergunte a que velocidade do carro de um usuário. Caso o valor informado seja maior que 80km/h, exiba uma mensagem dizendo que o usuário foi multado. Neste caso, exiba o valor da multa, cobrando R$ 5,00 por Km acima dos 80 km/h''' velocidade = int(input("Digite a velo...
StarcoderdataPython
9829
"""Tests joulia.unit_conversions. """ from django.test import TestCase from joulia import unit_conversions class GramsToPoundsTest(TestCase): def test_grams_to_pounds(self): self.assertEquals(unit_conversions.grams_to_pounds(1000.0), 2.20462) class GramsToOuncesTest(TestCase): def test_grams_to_ou...
StarcoderdataPython
1787489
import datetime as dt import dateutil.tz import pandas as pd import matplotlib.pyplot as plt ams = dateutil.tz.gettz('Europe/Amsterdam') utc = dateutil.tz.tzutc() start_graph = dt.datetime(2021, 3, 20, 18, tzinfo=utc) end_graph = start_graph + dt.timedelta(minutes=240) def trivial_interpolation_windnet(): base_...
StarcoderdataPython
181563
from typing import Tuple from NewDeclarationInQueue.processfiles.customprocess.formulars.davere import DAvere from NewDeclarationInQueue.processfiles.customprocess.search_text_line_parameter import SearchTextLineParameter from NewDeclarationInQueue.processfiles.customprocess.table_config_detail import TableConfigDeta...
StarcoderdataPython
1636928
<filename>turtlebot4_bringup/launch/rplidar.launch.py # Copyright 2021 Clearpath Robotics, 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-...
StarcoderdataPython
3348269
<reponame>luiz-fischer/python<gh_stars>1-10 #WHILE i = 1 while i < 6: print(i) i += 1 #The Break Statement i = 1 while i < 6: print(i) if i == 3: break i += 1 #The Continue Statement i = 0 while i < 6: i += 1 if i == 3: continue print(i) #The Else Statement i = 1 while i < 6: print(i) i ...
StarcoderdataPython
1772301
# coding: utf-8 from __future__ import absolute_import from django.conf import settings from sentry.models import Project, Team, User from sentry.receivers.core import create_default_project from sentry.testutils import TestCase class CreateDefaultProjectTest(TestCase): def test_simple(self): user, _ =...
StarcoderdataPython
188674
<gh_stars>10-100 from __future__ import absolute_import from .classification import accuracy from .eval_reid import eval_func __all__ = [ 'accuracy', 'eval_func' ]
StarcoderdataPython
3226916
import functools as ft import itertools as it import typing as t from .. import openapi as api from .references import references @ft.singledispatch def generate_imports( input: t.Union[api.Operation, api.Schema, api.Reference], module: t.Sequence[str] ) -> t.Iterator[str]: raise NotImplementedError(f"genera...
StarcoderdataPython
161290
<gh_stars>0 from .firebase import *
StarcoderdataPython
3204244
""" test_run_chronostar.py Integration test, testing some simple scenarios for NaiveFit """ import logging import numpy as np import sys from distutils.dir_util import mkpath sys.path.insert(0, '..') from chronostar.naivefit import NaiveFit from chronostar.synthdata import SynthData from chronostar.component import...
StarcoderdataPython
57175
import json from app import create_app, db from app.models import User, UserType from .base import BaseTest class TestOrders(BaseTest): def setUp(self): self.app = create_app(config_name='testing') self.client = self.app.test_client() with self.app.app_context(): db.create_all(...
StarcoderdataPython
4811009
<gh_stars>0 from pyspark import RDD from pyspark.sql import SparkSession from pyspark.sql.types import * if __name__ == "__main__": spark = SparkSession.builder.appName("Triangles").getOrCreate() sc = spark.sparkContext edges: RDD = sc.textFile("./data/graph.txt") edges = edges.map(lambda l: l.split())...
StarcoderdataPython
3367643
<filename>v0.10.0/lnclipb/__init__.py from .lncli_pb2 import * from .lncli_pb2_grpc import *
StarcoderdataPython
132190
from view import screen, images import common from model import maps commands = "Enter a (#) to purchase an item, (L)eave Shop" # This function controls our interactions at the weapons store def enter_the_map_shop(our_hero): is_leaving_the_shop = False message = "Welcome to Tina's Cartography, mighty warrior...
StarcoderdataPython
1718008
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ # Meta-info Author: <NAME> Created: 10/03/2017 Updated: 10/03/2017 # Description Unit tests for the functions in the ands.algorithms.dac.select module. """ import unittest from random import randint, sample, randrange from ands.algorithms.dac.select import sel...
StarcoderdataPython
139143
<filename>alipay/aop/api/domain/AlipayDataAiserviceSmartpriceGetModel.py #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AlipayDataAiserviceSmartpriceGetModel(object): def __init__(self): self._base_price_cent = None self._chan...
StarcoderdataPython
39450
import json from aio_pika import Message, DeliveryMode, ExchangeType from lib.ipc.util import poll_for_async_connection class Emitter: def __init__(self): self.connection = None self.event_exchange = None async def connect(self, loop): # Perform connection self.connection = a...
StarcoderdataPython
1761040
from .value_list_content_block import ValueListContentBlockRenderer from .table_content_block import TableContentBlockRenderer from .bullet_list_content_block import PrescriptiveBulletListContentBlockRenderer
StarcoderdataPython
139429
# -*- coding: utf-8 -*- """ Created on Mon Dec 9 01:58:58 2019 @author: iqbalsublime """ #================================================================================================================ #---------------------------------------------------------------------------------------------------------...
StarcoderdataPython
3298952
<reponame>thekiosk/i3ot3commas<gh_stars>1-10 from flask import ( Flask, request, json ) import re import socket from datetime import datetime import time import requests from collections import defaultdict from telegramManager import telegramManager class i3ot3commas: def __init__(self): self.c...
StarcoderdataPython
3277562
<reponame>EmilPi/PuzzleLib<gh_stars>10-100 import numpy as np from PuzzleLib import Config from PuzzleLib.Backend import gpuarray, Blas from PuzzleLib.Backend.Dnn import PoolMode, poolNd, poolNdBackward, mapLRN, mapLRNBackward from PuzzleLib.Modules.Module import ModuleError from PuzzleLib.Modules.LRN import LRN c...
StarcoderdataPython
1674540
import pandas as pd import math import parser # Worksheets with indemnification funds and temporary remuneration # For active members there are spreadsheets as of July 2019 # Adjust existing spreadsheet variations def format_value(element): if element == None: return 0.0 if type(element) == str and "...
StarcoderdataPython
3225599
<gh_stars>100-1000 import os import sys import json from PyQt5 import QtCore, QtWidgets from PyQt5.QtWidgets import * from PyQt5.QtGui import * class WindowClassificationTrainUpdateLossParam(QtWidgets.QWidget): forward_train = QtCore.pyqtSignal(); backward_scheduler_param = QtCore.pyqtSignal(); def __...
StarcoderdataPython
1708592
<filename>resnet.py #================================================================ # Copyright (C) 2019 * Ltd. All rights reserved. # # Editor : VIM # File name : resnet.py # Author : YunYang1994 # Created date: 2019-10-11 19:16:55 # Description : # #==========================================...
StarcoderdataPython
55137
<reponame>Rayhane-mamah/Efficient-VDVAE import torch import os import numpy as np from hparams import HParams from collections import defaultdict from torch.utils.tensorboard import SummaryWriter from prettytable import PrettyTable hparams = HParams.get_hparams_by_name("efficient_vdvae") def get_logdir(): return...
StarcoderdataPython
3386978
<gh_stars>0 from importlib import reload import aiohttp import settings from tgapi.apimethods import get_me from tgapi.tgtypes import base, bot_entity async def setup_bot_settings(session: aiohttp.ClientSession, bot_url: str) -> dict: """ Args: session: bot_url:...
StarcoderdataPython
3218378
<reponame>crispzips/IsisCB<filename>isiscb/curation/forms.py from __future__ import absolute_import from __future__ import unicode_literals from builtins import str from builtins import object from django import forms from django.http import QueryDict from isisdata.models import * from isisdata import export # Thi...
StarcoderdataPython
3381838
<gh_stars>10-100 from helper import * def doTest(): _color() _complicated_color() _special() def _complicated_color(): fixer, msg = doFix('.test {background0:#dddddd url(dddddd) no-repeat left top;}', '') styleSheet = fixer.getStyleSheet() ruleSet = styleSheet.getRuleSets()[0] equal(ruleSe...
StarcoderdataPython
1750901
<reponame>sgarg18/arshadowgan<filename>shadow_class/networks.py<gh_stars>0 # -*- coding: utf-8 -*- import torch import torch.nn as nn import segmentation_models_pytorch as smp class Generator_with_Refin(nn.Module): def __init__(self, encoder): """Generator initialization Args: encode...
StarcoderdataPython
1710768
# from labels import default_labeler import numpy as np from six import string_types class unitsDict(dict): """ A dictionary sub-class for tracking units. unitsDict instances support simple math operations (multiply, divide, power) The *key* of unitsDicts objects are the units, the values r...
StarcoderdataPython
198754
#!/usr/bin/env python3 """ Simple tool for collating multiple mbox files into a single one, sorted by message ID. If the message-ID is missing, use the Date or Subject and prefix the sort key to appear last. Can optionally sort by ezmlm number. This should be less likely to have missing numbers or duplicate entries. H...
StarcoderdataPython
3350360
from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..utils import ( int_or_none, js_to_json, qualities, ) class PornHdIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?pornhd\.com/(?:[a-z]{2,4}/)?videos/(?P<id>\d+)(?:/(?P<display_id>.+))?' _TEST...
StarcoderdataPython
3217983
#!/usr/bin/env python3 """ Run SPBuild on all sequences in a fasta files """ import sys import os import multiprocessing import subprocess import itertools import tempfile import argparse import pandas as pd from Bio import SeqIO def run_spbuild(seq, tempdir): """ Run SPBuild """ node_name = multiproce...
StarcoderdataPython
3329702
salary = int(input('Enter the salary of the employee:: ')) work_year = int(input('\nEnter the number of years the employee has work in company:: ')) if work_year > 5: bonus = salary * 0.05 # 5 percent bonus on salary print('\nThe bonus you get on your salary is :: ', int(bonus)) print('\nYour net salary will...
StarcoderdataPython
109554
<filename>Month 02/Week 03/Day 01/c.py # Pow(x, n): https://leetcode.com/problems/powx-n/ # Implement pow(x, n), which calculates x raised to the power n (i.e., xn). # This problem is pretty straight forward we simply iterate over the n times # multiplying the input every time. The only tricky thing is that if we hav...
StarcoderdataPython
4805092
# Time: O(n) # Space: O(1) class Solution(object): def convert(self, s, numRows): """ :type s: str :type numRows: int :rtype: str """ if numRows == 1: return s step, zigzag = 2 * numRows - 2, "" for i in xrange(numRows): ...
StarcoderdataPython
118270
<reponame>gnott/elife-bot import json import os import importlib from optparse import OptionParser import boto.swf import settings as settingsLib import workflow import activity # Add parent directory for imports, so activity classes can use elife-poa-xml-generation parentdir = os.path.dirname(os.path.dirname(os.path...
StarcoderdataPython
77952
<filename>Utils/Classes/discordwebuser.py from Utils.Classes.undefined import UNDEFINED from Utils.Classes.contentclass import ContentClass class DiscordWebUser(ContentClass): """ Contains information's about a discord web user, this object is suppose to be appended to a `AuthDiscordWebUser` object. It contains d...
StarcoderdataPython
3213506
<gh_stars>1-10 # TOOL list_zip.py: "List contents of a zip file" (List the contents of a zip file.) # INPUT input_file: ".zip file" TYPE GENERIC (Zip file.) # OUTPUT output_file: "List of files in the zip package" # PARAMETER OPTIONAL full_paths: "Keep directories" TYPE [yes: Yes, no: No] DEFAULT no (Use the whole file...
StarcoderdataPython
1676293
from django.contrib import admin from django.urls import path, include from core.views import Cadastrar, home, carinho, cadastrar_cliente, cadastrar_produto, \ listar_produto, editar_produto, excluir_produto, exibir_produto, cadastrar_funcionario, \ listar_funcionario, editar_funcionario, excluir_funcionario, c...
StarcoderdataPython
3252132
from mock import patch from nose.tools import assert_equal from gittip.elsewhere import github from gittip.models import Elsewhere from gittip.testing import Harness, DUMMY_GITHUB_JSON from gittip.testing.client import TestClient class TestElsewhereGithub(Harness): def test_github_resolve_resolves_correctly(self...
StarcoderdataPython
4829741
<gh_stars>1-10 import sys import os from glob import glob from scipy.signal import detrend from time import time from geoNet.geoNet_file import GeoNet_File from geoNet.process import Process, adjust_gf_for_time_delay init_time = time() #enter location of ObservedGroundMotions directory #files are placed after downloa...
StarcoderdataPython
1619564
<filename>demo.py from kuro import Worker import random def run(guesser_name, hyper_parameters): worker = Worker('nibel') experiment = worker.experiment( 'guesser', guesser_name, metrics=[('test_acc', 'max'), 'test_loss'], hyper_parameters=hyper_parameters, n_trials=3# Used to ...
StarcoderdataPython
171351
# A collection of common functions used in the creation and manipulation of the data for this project. from approaches.approach import Multiclass_Logistic_Regression, Perceptron, Sklearn_SVM import comp_vis.img_tools as it import numpy as np import sys def images_to_data(images, label, already_cropped=True): '''...
StarcoderdataPython
172138
import matplotlib.pyplot as plt def load_tsne_coordinates_from(filename): file = open(filename) lines = file.readlines() line_xy_dict = {} line_to_xy_dict = {} for line in lines: row = line.split() x = float(row[0]) y = float(row[1]) try: line_id = row[2...
StarcoderdataPython
3361136
<gh_stars>0 from flask import render_template from app import app # Error handlers @app.errorhandler(500) def internal_error(error): return render_template('errors/500.html'), 500 @app.errorhandler(404) def not_found_error(error): return render_template('errors/404.html'), 404 @app.errorhandler(403) def per...
StarcoderdataPython
1649776
<reponame>prashant-rathod/deep-time-series<filename>models/darnn/dataset.py import numpy as np import math class Dataset: def __init__(self, X_train, y_train, T, split_ratio=0.7, normalized=False): self.train_size = int(split_ratio * (y_train.shape[0] - T - 1)) self.test_size = y_train.shape[0] - ...
StarcoderdataPython
3337599
from django.conf.urls import include, url from django.contrib import admin from django.conf import settings from django.conf.urls.static import static from haystack.forms import SearchForm from haystack.views import SearchView from . import views urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(...
StarcoderdataPython
3382629
import json logic = """ { "and": [ { "or": [ {"==": [{"var": "dataset.name"}, "/PromptReco/Collisions2018A/DQM"]}, {"==": [{"var": "dataset.name"}, "/PromptReco/Collisions2018B/DQM"]}, {"==": [{"var": "dataset.name"}, "/PromptReco/Collisions2018C...
StarcoderdataPython
3284475
<filename>src/testcase/GN_APP/input_case/GN_APP_Register.py # coding=utf-8 try: from src.testcase.GN_APP.case.GN_APP_REGISTER.GN_APP_REGISTER_001 import * from src.testcase.GN_APP.case.GN_APP_REGISTER.GN_APP_REGISTER_002 import * from src.testcase.GN_APP.case.GN_APP_REGISTER.GN_APP_REGISTER_003 import * ...
StarcoderdataPython
1669336
<filename>physlearn/supervised/__init__.py<gh_stars>1-10 from __future__ import absolute_import from .interface import RegressorDictionaryInterface from .regression import BaseRegressor, Regressor from .interpretation.interpret_regressor import ShapInterpret from .model_selection.cv_comparison import plot_cv_comparis...
StarcoderdataPython
1644321
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index, name='user_information_main_page'), #暂未加载 url(r'^user_comment/', views.user_comment, name='user_information_comment'), # 用户信息修改 url('edit/(?P<id>[0-9]+)/', views.profile_edit, name='profile_edit'), # 用户信息查看...
StarcoderdataPython
1673827
#-*-coding:utf8-*- import copy, os from gen_conf_file import * from dataset_cfg import * def gen_conv_lstm(d_mem, init): net = {} # dataset = 'tb_fine' dataset = 'mr' if dataset == 'mr': net['cross_validation'] = 10 ds = DatasetCfg(dataset) g_filler = gen_uniform_filter_setting(init)...
StarcoderdataPython
3383702
# -*- coding: utf-8 -*- from epicstore_api.api import EpicGamesStoreAPI from epicstore_api.models.categories import EGSCategory Categories = { 'CATEGORY_ACTION': EGSCategory.CATEGORY_ACTION, # Экшн 'CATEGORY_ADVENTURE': EGSCategory.CATEGORY_ADVENTURE, # Приключения 'CATEGORY_EDITOR': EGSCategory.CATEGORY...
StarcoderdataPython
4816423
from .mean_base import MeanBase from .meanKronSum import MeanKronSum
StarcoderdataPython
115794
<filename>read_visualdl_data.py from visualdl import LogReader log_reader = LogReader("./log") print("Data associated with the train loss:\n") with log_reader.mode("train") as logger: text_reader = logger.scalar("scalars/train_loss") print("Train loss =", text_reader.records()) print("Ids = ", text_reader...
StarcoderdataPython
1760055
<gh_stars>0 from django.shortcuts import render from rest_framework import viewsets from .models import Author, Book, BookInstance from .serializers import AuthorSerializer, BookSerializer, BookInstanceSerializer class BookViewSet(viewsets.ModelViewSet): serializer_class = BookSerializer queryset = Book.obj...
StarcoderdataPython
3384329
from pumapy.utilities.workspace import Workspace from pumapy.physicsmodels.boundary_conditions import ConductivityBC from pumapy.physicsmodels.linear_solvers import PropertySolver import numpy as np class Conductivity(PropertySolver): def __init__(self, workspace, cond_map, direction, side_bc, prescribed_bc, tol...
StarcoderdataPython
1696801
<filename>tests/fields/test_charfield.py<gh_stars>1-10 # -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import json import logging import pytest from django_dynamicfields.exceptions import ValidationError from django_dynamicfields.models import CustomFieldDefs from django_dynamicfield...
StarcoderdataPython
1607466
####################################################### # # ClientInformationController.py # Python implementation of the Class ClientInformationController # Generated by Enterprise Architect # Created on: 19-May-2020 6:56:00 PM # Original author: <NAME> # ####################################################### ...
StarcoderdataPython
3218483
from django.contrib import admin # Register your models here. # we don't have to add user model here since it is already present in django
StarcoderdataPython
1661964
import datetime import logging import random import re from zoneinfo import ZoneInfo import pytz import requests from telegram import Update import database import rules_of_acquisition import main import git_promotions from ranks import ranks from weather_command import weather_command logger = logging.getLogger(__n...
StarcoderdataPython
1741082
<gh_stars>0 import matplotlib.pyplot as plt import numpy as np from scipy.optimize import curve_fit #current related damage rate a_I = 1.23 * 10**(-17) #A/cm k_0I = 1.2 * 10**(13)*60 #1/min E_I = 1.11 * 1.6 * 10**(-19) #j b = 3.07*10**(-18) #A/cm t_0 = 1 #min k_B = 1.38064852 * 10**(-23) #<NAME> t, phi, T, T_2, T...
StarcoderdataPython
1642025
<reponame>tkf/compapp from compapp import Computer class SimpleApp(Computer): x = 1.0 y = 2.0 def run(self): self.results.sum = self.x + self.y if __name__ == '__main__': app = SimpleApp.cli()
StarcoderdataPython
34894
# Copyright (C) 2017 <NAME> and <NAME> # # This file is part of WESTPA. # # WESTPA is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ...
StarcoderdataPython
1677767
from abc import ABC, abstractmethod import os from nltk import pos_tag import gzip from a3t.dataset.download import download_ppdb, download_artifacts class Transformation(ABC): def __init__(self, length_preserving=False): """ A default init function. """ super().__init__() ...
StarcoderdataPython
4804754
<gh_stars>10-100 __all__ = ['Addition', 'Concat', 'Division', 'FloorDivision', 'Modulo', 'Multiplication', 'Power', 'StrMultiplication', 'Subtraction' ] from boa3.model.operation.binary.arithmetic.addition import Additio...
StarcoderdataPython
37371
<gh_stars>10-100 from anyrun.client import AnyRunClient, AnyRunException __version__ = '0.1' __all__ = ['AnyRunClient', 'AnyRunException']
StarcoderdataPython
127251
# -*- coding: utf-8 -*- """ Created on Sat Oct 10 13:01:49 2020 @author: saksh """ import numpy as np np.random.seed(1337) import tensorflow as tf import pandas as pd from statsmodels.tsa.api import VAR from sklearn.model_selection import train_test_split, GridSearchCV from sklearn.svm import SVR from s...
StarcoderdataPython
3296145
import calendar import time import unittest from unittest.mock import call from unittest.mock import patch from unittest.mock import sentinel import httpie_ovh_auth import httpie.models class TestSuite(unittest.TestCase): def test_signature(self): """Check signature generation.""" # time_o withou...
StarcoderdataPython
1685149
# Generated by Django 3.0.7 on 2020-08-10 08:22 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('leave', '0004_auto_20200810_1107'), ] operations = [ migrations.AlterField( model_name='leaveplan', name='approval_s...
StarcoderdataPython
1763857
<filename>shapenet_train.py import argparse import json import copy import torch import torch.nn.functional as F from torch.utils.data import DataLoader from datasets.shapenet import build_shapenet from models.nerf import build_nerf from models.rendering import get_rays_shapenet, sample_points, volume_render import wan...
StarcoderdataPython
3247493
import __about__ import argparse from rogify.base.util import (file_exists, load_items, store_items) from rogify.__config__ import slot_synonyms def resolve_unknown_slots(items): fixed_items = [] choice_dict = {i: k for i, k in enumerate(slot_synonyms.keys())} for item in items: if item.slot no...
StarcoderdataPython
3239820
<filename>tests/test_algorithms.py # # Copyright 2020 <NAME> # # This file is part of Library of Graph Algorithms for Python. # # Library of Graph Algorithms for Python is free software developed for # educational # and experimental purposes. It is licensed under the Apache # License, Version 2.0 # (the "License...
StarcoderdataPython
1798509
# Generated by Django 3.1.3 on 2020-11-19 06:44 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tracker', '0002_auto_20201118_0923'), ] operations = [ migrations.RemoveField( model_name='timer', name='is_paused',...
StarcoderdataPython
3319504
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Density compensation for non-uniform acquried data.""" import numpy as np def cmp(k): """Golden angle density compensation. Simple linear ramp based density compensation function Parameters ---------- k : numpy.array Trajectory which sh...
StarcoderdataPython
1781243
<reponame>finswimmer/clikit from contextlib import contextmanager from clikit.api.io import IO from clikit.ui import Component from clikit.ui.alignment import LabelAlignment from clikit.ui.components import LabeledParagraph class BlockLayout: """ Renders renderable objects in indented blocks. """ de...
StarcoderdataPython
33954
import fastai from neptune.new.integrations.fastai import NeptuneCallback from fastai.vision.all import * import neptune.new as neptune run = neptune.init( project="common/fastai-integration", api_token="<PASSWORD>", tags="basic" ) path = untar_data(URLs.MNIST_TINY) dls = ImageDataLoaders.from_csv(path) # Log al...
StarcoderdataPython
3265537
# https://leetcode.com/problems/two-sum/ # class Solution: # def twoSum(self, nums: List[int], target: int) -> List[int]: # #for loop for the range of the nums [] # for i in range(len(nums)): # for j in range(len(nums)): # #check to see if each num is equal to target # ...
StarcoderdataPython
184481
#%% import asyncio from datetime import datetime import aiofiles import aiohttp import pandas as pd OPEN_DATA_BUCKET_URL = "https://open-neurodata.s3.amazonaws.com" #%% def return_url_dataset(coll, exp, ch): return f"{OPEN_DATA_BUCKET_URL}/{coll}/{exp}/{ch}/info" #%% # read the data df = pd.read_csv("scripts/...
StarcoderdataPython
1713967
import json import logging import time import sys import ipaddress if sys.version_info[0] != 3: raise Exception('Can only run under python3') LOGFILE = __file__ + '.log' formatter = logging.Formatter('%(asctime)s: %(levelname)s - %(message)s') logger = logging.getLogger() logger.setLevel(logging.DEBUG) ch = log...
StarcoderdataPython
3231485
<reponame>Signal-Kinetics/alexa-apis-for-python # -*- coding: utf-8 -*- # # Copyright 2019 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located ...
StarcoderdataPython
36454
import tensorflow as tf from tensorflow.keras.layers import Layer, Dense, Reshape, Embedding, Concatenate, Conv2D from tensorflow.keras.models import Model import numpy as np class SelfAttention(Model): def __init__(self, d_model, spatial_dims, positional_encoding=True, name="self_attention"): ''' ...
StarcoderdataPython
1723940
<reponame>cyandterry/Python-Study """ There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to its next station (i+1). You begin the journey with an empty tank at one of the gas sta...
StarcoderdataPython
3399762
# -*- coding: utf-8 -*- import sys import pytest import requests_mock from chaoslib.exceptions import InvalidActivity from chaoslib.activity import ensure_activity_is_valid from chaoslib.types import Action from fixtures import actions def test_empty_action_is_invalid(): with pytest.raises(InvalidActivity) as ...
StarcoderdataPython
1790017
<filename>poetry_model.py # *-* coding:utf-8 *-* ''' @author: ioiogoo @date: 2018/1/31 19:33 ''' import random import os import keras import numpy as np from keras.callbacks import LambdaCallback from keras.models import Input, Model, load_model from keras.layers import LSTM, Dropout, Dense, Flatten, Bidirectional, Em...
StarcoderdataPython