id
stringlengths
1
265
text
stringlengths
6
5.19M
dataset_id
stringclasses
7 values
58579
<reponame>dirkroorda/fusus """Detect the page layout. Pages consist of a header region, a body region, and a footer region, all of which are optional. **header** The header consists of a caption and/or a page number. All headers will be discarded. **footer** The footer consists of footnote bodies. All footers will ...
StarcoderdataPython
154490
""" This module contains Filesystem class, which functions as an adapter to either connect to 3rd party storage servers like Amazon S3 or use local filesystem. """ from contextlib import contextmanager import boto3 import io import os, errno import ConfigParser from zipfile import ZipFile import mimetypes class Filesy...
StarcoderdataPython
3365440
def foo(a=3, *, c, d=2): pass foo()
StarcoderdataPython
4825393
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2018 Google 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 ...
StarcoderdataPython
1753174
<reponame>fx2hero/Telethon import datetime import typing from . import helpers from .tl import types, custom Phone = str Username = str PeerID = int Entity = typing.Union[types.User, types.Chat, types.Channel] FullEntity = typing.Union[types.UserFull, types.messages.ChatFull, types.ChatFull, types.ChannelFull] Entit...
StarcoderdataPython
3345135
num = int(input("Enter the number :")) f = 1 i = 1 for i in range(i, num+1): f *= i print (f)
StarcoderdataPython
140569
<gh_stars>0 import httplib as http from website.addons.dataverse.client import connect_from_settings_or_401, \ get_dataverse, get_dataset from website.project.decorators import must_be_contributor_or_public, \ must_have_addon @must_be_contributor_or_public @must_have_addon('dataverse', 'node') def dataverse_...
StarcoderdataPython
90487
# hyperparameter optimization from ray import tune from ray.tune.schedulers import ASHAScheduler from model import GRU # set processing device import torch import torch.nn as nn device = torch.device("cuda:0") if torch.cuda.is_available() else torch.device("cpu") # data from torchtext.legacy.data import Field, Tabu...
StarcoderdataPython
3254835
from .statusmailer import StatusMailer
StarcoderdataPython
3316784
<gh_stars>0 from mastermind import Mastermind import pygame import sys # Set up colors BLACK = (0, 0, 0) WHITE = (255, 255, 255) RED = (255, 0, 0) GREEN = (0, 255, 0) BLUE = (0, 0, 255) YELLOW = (255, 255, 0) PURPLE = (255, 0, 255) ORANGE = (255, 100, 0) GRAY = (128, 128, 128) DARK_GRAY = (96, 96, 96) DARKEST_GRAY = ...
StarcoderdataPython
3292213
from .rooted_poly_decider import rooted_polynomial_classifier from .unrooted_poly_decider import unrooted_polynomial_classifier __version__ = "0.0.1"
StarcoderdataPython
1784365
import numpy as np from collections import deque import rospy NORMAL_MAXIMUM = 16384 BUFFER_NP_TYPE = '<i2' # little endian, signed short def normalize(snd_data): """Average the volume out """ r = snd_data * (NORMAL_MAXIMUM * 1. / max(1, np.abs(snd_data).max())) return r.astype(snd_data.dtype) ...
StarcoderdataPython
3269249
from typing import cast, AsyncIterable, TypedDict, Tuple, Mapping from starlette.websockets import WebSocket from src.util.ip import get_client_ip from src.ws.ws_client import WebsocketClient class StarletteWebsocketClient(WebsocketClient): def __init__(self, websocket: WebSocket): self._websocket = web...
StarcoderdataPython
1789592
<filename>test.py import functools import itertools import operator import unittest import dual @functools.lru_cache(maxsize=None) def stirling(n, k): # [[https://en.wikipedia.org/wiki/Stirling_numbers_of_the_second_kind]] if n == 0 and k == 0: return 1 elif n == 0 or k == 0: return 0 else: return...
StarcoderdataPython
3339250
<filename>canvas_workflow_helpers/value_sets/v2021/device.py from ..value_set import ValueSet class CardiacPacer(ValueSet): """ **Clinical Focus:** This value set contains concepts that represent a cardiac pacer device. **Data Element Scope:** This value set may use Quality Data Model (QDM) category rela...
StarcoderdataPython
3351992
""" Copyright Digisim, Computer Architecture team of South China University of Technology, 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 ...
StarcoderdataPython
187900
<reponame>Gaetz/python-training import pygame class UiPanel: def __init__(self, x, y, w, h): self.x = x self.y = y self.w = w self.h = h self.visible = True self.color = (255, 255, 255) self.events = {} self.is_hover = False self.set_event("ho...
StarcoderdataPython
3225585
#!/usr/bin/env python import os import sys import glob from conf import settings from tools.birt_ensure_indexes import BirtEnsureIndexes """ wrapper for running BirtEnsureIndexes """ if __name__ == '__main__': cmd = BirtEnsureIndexes() cmd.run()
StarcoderdataPython
1757489
<filename>lib/tapercurve_mirror.py import bpy class ahs_tapercurve_mirror(bpy.types.Operator): bl_idname = 'object.ahs_tapercurve_mirror' bl_label = "ミラー" bl_description = "テーパー/ベベルの形状を左右/上下反転" bl_options = {'REGISTER', 'UNDO'} items = [ ('TAPER', "テーパー", "", 'CURVE_NCURVE', 1), (...
StarcoderdataPython
1674955
""" This module handles the command store interactive mode. """ import os import subprocess from typing import List, Optional import remember.command_store_lib as command_store from remember.command_store_lib import BColors, SqlCommandStore from remember.sql_store import Command class InteractiveCommandExecutor(obje...
StarcoderdataPython
1789399
<reponame>picktsh/python<filename>code/day18/demo01.py # 比如我们想写一个根据圆的半径(R)来求面积(S)和周长(L)的代码,可以画出以下的流程图: # 如流程图所示,求圆的面积和周长的代码 # 圆周率(pi)取3.14即可 import math def circle(R): S = math.pi * (R ** 2) # 面积,计算公式 Π * (r**2) L = 2 * math.pi * R # 周长,计算公式 2 * Π * r print('圆半径为:{}的时候,面积是:{};周长是:{};'.format(R, S, L)) ...
StarcoderdataPython
40793
"""Run all of the unit tests for this package over and over, in order to provide for better profiling.""" from __future__ import print_function def main(): import sys, os, gc, time dirname = os.path.split(__file__) sys.path.append(dirname) import runtests gc.set_debug(gc.DEBUG_LEAK) star...
StarcoderdataPython
3230833
# <NAME>, <NAME>, <NAME>, <NAME> # # MultiRocket: Effective summary statistics for convolutional outputs in time series classification # https://arxiv.org/abs/2102.00457 catch22_features = ["DN_HistogramMode_5", "DN_HistogramMode_10", "CO_f1ecac", "CO_FirstMi...
StarcoderdataPython
47603
# system library import numpy as np # user-library import RegressionBase # third-party library from sklearn.tree import DecisionTreeRegressor from sklearn.ensemble import AdaBoostRegressor from sklearn.grid_search import GridSearchCV from sklearn.metrics import mean_squared_error from sklearn.learning_curve import v...
StarcoderdataPython
5027
<filename>tools/Bitcoin Parser/blockchain_parser/tests/test_block.py # Copyright (C) 2015-2016 The bitcoin-blockchain-parser developers # # This file is part of bitcoin-blockchain-parser. # # It is subject to the license terms in the LICENSE file found in the top-level # directory of this distribution. # # No part of b...
StarcoderdataPython
3360469
from sys import argv import requests def load_all_state_changes(node, address, max_height): all_script_invocations = [] loaded_transactions = requests.get( f'http://{node}/transactions/address/{address}/limit/1000' ).json()[0] while loaded_transactions: print(f'Loaded {len(loaded_tra...
StarcoderdataPython
3200843
# Copyright (c) 2020, Xilinx, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of ...
StarcoderdataPython
1679991
APP_NAME = 'dexbot' VERSION = '0.9.19' AUTHOR = 'Codaone Oy' __version__ = VERSION
StarcoderdataPython
3361974
#entrada n = int(input()) #entrada & processamento for i in range(0, n): x, y = str(input()).split() x = int(x) y = int(y) j = s = 0 k = x while j < y: if k % 2 == 1: s += k j += 1 k += 1 print(s) #saida
StarcoderdataPython
48541
#!/usr/bin/env python3 """Create CESAR joblist. According to predicted orthologous chains create CESAR jobs. Merge them into joblists. """ import argparse import os import sys import math from collections import defaultdict from datetime import datetime as dt from re import finditer, IGNORECASE import ctypes from twob...
StarcoderdataPython
3367839
import configparser import requests from pyrogram import Client, Filters, Emoji config = configparser.ConfigParser() config.read("config.ini") prefixes = list(config["prefixes"].keys()) class DelDog: def __init__(self): self.__author__ = "GodSaveTheDoge" self.url = "https://del.dog/documents?fro...
StarcoderdataPython
3377301
<filename>student.py from tkinter import* from tkinter import ttk from PIL import Image, ImageTk from tkinter import messagebox import mysql.connector import cv2 import os import data class Student: def __init__(self, root): self.root = root self.root.geometry("1530x790+0+0") s...
StarcoderdataPython
57632
<filename>dummy_data_generator.py import random class DummyDataGenerator: lastname = [] firstname = [] @staticmethod def load(): file = open('./data/prénom.txt', 'r', encoding='utf-8') DummyDataGenerator.firstname = file.readlines() file.close() file = open('./data/pa...
StarcoderdataPython
1728882
from functools import wraps from . import exceptions def context(f): def decorator(func): def wrapper(*args, **kwargs): info = args[f.__code__.co_varnames.index("info")] return func(info.context, *args, **kwargs) return wrapper return decorator def user_passes_test...
StarcoderdataPython
96530
<reponame>fizista/django<filename>tests/test_runner_deprecation_app/tests.py import warnings from django.test import TestCase warnings.warn("module-level warning from deprecation_app", DeprecationWarning) class DummyTest(TestCase): def test_warn(self): warnings.warn("warning from test", DeprecationWarni...
StarcoderdataPython
1626240
from keras.layers import Conv2D, Conv3D, LeakyReLU, Conv2DTranspose, Conv3DTranspose, concatenate, MaxPooling2D, MaxPooling3D, Lambda, BatchNormalization, add from keras.regularizers import l1_l2 from keras import backend as K def samplingDense(args): z_mean, z_log_var = args epsilon = K.random_normal(shape=(...
StarcoderdataPython
1664340
# Generated by Django 3.1.4 on 2020-12-15 23:35 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('administracion', '0003_productomodel_productoestado'), ] operations = [ migrations.RenameField( model_name='productoalmacenmodel...
StarcoderdataPython
1634094
<filename>hail/python/hailtop/utils/tqdm.py from typing import Union, Optional from enum import Enum class TqdmDisableOption(Enum): default = 0 def tqdm(*args, disable: Optional[Union[TqdmDisableOption, bool]] = TqdmDisableOption.default, **kwargs): from tqdm.notebook import tqdm as tqdm_notebook # pylint:...
StarcoderdataPython
30421
<filename>Very Easy/hello.py def hello(): return "hello edabit.com"
StarcoderdataPython
3358239
<gh_stars>0 #!/usr/bin/python # -*- coding: utf-8 -*- """ This file belong to https://github.com/snolfi/evorobotpy and has been written by <NAME> and <NAME>, <EMAIL>, <EMAIL> testnet.py includes and example of usage of the net component """ import numpy as np import net # parameters to be set on the basis ...
StarcoderdataPython
1761782
#vocabulary_locations.py #Copyright (c) 2020 <NAME> <NAME> #MIT License #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without restriction, including without limitation the rights #to use, co...
StarcoderdataPython
1722817
<reponame>riotkit-org/backup-repository<filename>bahub/bahub/env.py import os from rkd.env import STR_BOOLEAN_TRUE def is_curl_debug_mode() -> bool: return os.getenv('RKD_CURL_DEBUG', '').lower() in STR_BOOLEAN_TRUE
StarcoderdataPython
85650
<reponame>tchlux/tlux<gh_stars>1-10 import numpy as np from tlux.approximate.base import Approximator # Class for computing an interpolation between the nearest n neighbors class NearestNeighbor(Approximator): def __init__(self, k=1): self.k = k self.points = None self.values = None # ...
StarcoderdataPython
179822
<gh_stars>0 # Copyright 2019 The Bazel 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
StarcoderdataPython
3322902
""" Created on Sun Sep 29 21:44:54 2019 @author: BeBlob """ import S1_algotools as algotools import pytest """Exo 1 print('Exercice 1, La moyenne est : {moy}'.format(moy = average_above_zero([1,2,3,4,5]))) """ def test_average_above_zero_expected_a_list(): with pytest.raises(TypeError): algoto...
StarcoderdataPython
3301010
<filename>celligner2/othermodels/scgen/vaearith.py import torch import torch.nn as nn from torch.nn import functional as F import numpy as np from scipy import sparse import scanpy as sc import anndata from .modules import Encoder, Decoder from ._utils import balancer, extractor class vaeArith(nn.Module): """Sc...
StarcoderdataPython
3290895
<gh_stars>1-10 # -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-01-14 10:19 from __future__ import unicode_literals from django.db import migrations import django_countries.fields class Migration(migrations.Migration): dependencies = [ ('account', '0003_auto_20151104_1102'), ] replac...
StarcoderdataPython
197029
<filename>integer_programming.py #!/usr/bin/python #-*- coding: utf-8 -*- # encoding: utf-8 from __future__ import print_function from copy import deepcopy import sys import math PRECISION = 4 #float precision max_int_obj_v = float('-inf') max_int_opt_x = None def identity(n): return [[1 if i==j else 0 for j in...
StarcoderdataPython
191341
from glob import glob import itertools import pandas import numpy import json import os import re home = os.environ["HOME"] base = "%s/DATA/PUBMED" %os.environ["SCRATCH"] infolder = "%s/methods/microsoft" %(base) outfolder = "%s/results" %(infolder) if not os.path.exists(outfolder): os.mkdir(outfolder) data_file...
StarcoderdataPython
4809284
<filename>app/classes.py<gh_stars>1-10 import math class Board(object): ''' CLASS DESCRIPTION: An object class to maintain the attributes of the Battlesnake game board. ---------- ATTRIBUTES: width - width of the game board. height - height of the game board. food - lis...
StarcoderdataPython
4839168
import datetime as dt from airflow.models import DAG from airflow.operators.dummy import DummyOperator from airflow.operators.python import PythonOperator default_args = { 'start_date': dt.datetime.now() - dt.timedelta(days=7), 'owner': 'airflow' } def throw_error(): raise Exception('It failed!') with...
StarcoderdataPython
1606321
# BSD 3-Clause License # # Copyright (c) 2018, <NAME> <<EMAIL>> # All rights reserved # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # ...
StarcoderdataPython
1679806
from typing import Union from ._infercnv import infercnv from ._scores import cnv_score, ithcna, ithgex from ._copykat import copykat import numpy as np from anndata import AnnData import scanpy as sc from scanpy import logging def leiden( adata: AnnData, neighbors_key: str = "cnv_neighbors", key_added: s...
StarcoderdataPython
4822152
import struct import pytest import parsley import message_types as mt class TestParsley: @pytest.fixture def timestamp(self): def _timestamp(val=0): return struct.pack(">I", val << 8)[:-1] return _timestamp def test_parse_timestamp(self, timestamp): msg_data = timest...
StarcoderdataPython
4826395
import platform from functions import * import os import shutil import traceback from sys import exit from wsa_online_link_generator import * import fnmatch from speed_downloader import speed_download from xml.dom import minidom from packaging import version import subprocess # URL to download WSA Script from GitHub w...
StarcoderdataPython
3322087
<filename>src/graphdj/core/pluralize.py """English Word(s) Pluralization""" import re from setup import plurals PLURAL_NOUNS = { "aircraft": "aircraft", "alumna": "alumnae", "analysis": "analyses", "apex": "apices", "bison": "bison", "cactus": "cacti", "child": "children", "codex": "c...
StarcoderdataPython
1669259
load("@io_bazel_rules_docker//container:pull.bzl", "container_pull") def containers(): container_pull( name = "git-base", digest = "sha256:01b0f83fe91b782ec7ddf1e742ab7cc9a2261894fd9ab0760ebfd39af2d6ab28", # 2018/07/02 registry = "gcr.io", repository = "k8s-prow/git", tag =...
StarcoderdataPython
176290
<filename>droput_message/droput_msg/controller/__init__.py from droput_msg.controller import apiv1
StarcoderdataPython
3298220
"""Second module""" from typing import Tuple, List, Any, Callable import enum class Enum(enum.Enum): """An enum""" FIRST = 1 SECOND = 2 def type_enum(a: Enum): """Function referencing an enum""" class Foo: """A class in the second module""" @property def type_property(self) -> Enum: ...
StarcoderdataPython
1788882
<gh_stars>0 import numpy as np import matplotlib.pyplot as plt from astropy.io import ascii from astropy.table import Table, vstack, unique from pathlib import Path # read in aavso table as a template d = ascii.read('00demo_aavso.txt') outf = 'obs_MECK.ecsv' # get a list of all the AAVSO files in the directory t = ...
StarcoderdataPython
154507
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
StarcoderdataPython
3276029
<filename>01_Language/05_Python/tests/async/test_asyncio.py # coding: utf-8 import asyncio import threading @asyncio.coroutine # 该装饰器用于标记为coroutine def hello(): print('Hello world! (%s)' % threading.current_thread()) r = yield from asyncio.sleep(1) # yield from: 该函数是 delegate generator(委托生成器) print(r, ...
StarcoderdataPython
3244288
<reponame>opeodedeyi/creative-app-api from django.contrib import admin from django.urls import path from django.conf.urls import url, include urlpatterns = [ path('admin/', admin.site.urls), url('api/', include('accounts.api.urls')), url('api/showcase/', include('showcase.api.urls')), ]
StarcoderdataPython
50156
# -*- coding:utf-8 -*- from src.Client.Conf.config import * from src.Client.recitationSystem.editRecitation.tools import editRecitationList, removeRecitation from src.Client.SystemTools.SaveFiles import saveFiles class EditRecitation(): """ 编辑任务子系统。调用类,任务由被调用者完成。 """ def __init__(self, filename='../...
StarcoderdataPython
1737242
<filename>tests/cli/string_utils/test_evaluation_summary_string.py import random from pathlib import Path import click from pytest_cases import THIS_MODULE, parametrize_with_cases from statue.cli.string_util import evaluation_summary_string from statue.command import CommandEvaluation from statue.evaluation import Ev...
StarcoderdataPython
3256248
<filename>zappy/executor/dag.py import concurrent.futures def unpack_args(f): return lambda x: f(*x) class Input: def __init__(self, index): self.index = index def compute(self, input_values): return input_values[self.index] def node(self): return '"Input({}, {})"'.format(i...
StarcoderdataPython
2654
<gh_stars>1-10 from typing import Callable, Optional, Type, cast from fastapi import APIRouter, HTTPException, Request, status from app.models import users from app.common.user import ErrorCode, run_handler from app.users.user import ( CreateUserProtocol, InvalidPasswordException, UserAlreadyExists, V...
StarcoderdataPython
81963
<filename>src/kinesis_producer.py # stdlib import os import sys import logging # addlib import boto3 log = logging.getLogger(__name__) class RecordAccumulator(object): def __init__(self): self.limit = 20 self.container = [] def empty(self): result, self.container = self.container, [...
StarcoderdataPython
1714561
# -*- coding: utf-8 -*- from django.conf.urls import url from . import views urlpatterns = [ # Index Page url(r'^$', views.index, name='index'), # 발신번호 사전등록 url(r'^GetSenderNumberMgtURL', views.getSenderNumberMgtURL, name='GetSenderNumberMgtURL'), url(r'^GetSenderNumberList$', views.getSenderNumb...
StarcoderdataPython
1729831
<gh_stars>0 from configparser import ConfigParser from pathlib import Path import os class YoutubeFeedConfigFile: host = None user = None remote_path = None local_path = None def __init__(self): self.reader = ConfigParser() self.reader.read(self.paths()) try: ...
StarcoderdataPython
85005
for i in range(4): outfile = 'paramslist.txt' params = [0, 1, 2] with open(outfile, 'a+') as f: for param in params: f.write(str(param)) f.write(' ') f.write('\n')
StarcoderdataPython
1728409
from __future__ import division import numpy as np import fidimag.extensions.common_clib as clib # Change int he future to common clib: import fidimag.extensions.clib as atom_clib import sys from .minimiser_base import MinimiserBase class SteepestDescent(MinimiserBase): """ This class is the driver to minimi...
StarcoderdataPython
1642157
import sys #allows us to enter command line arguments, among other things import socket from datetime import datetime as dt #Definin the target if len(sys.argv) == 2: target = socket.gethostbyname(sys.argv[1]) #Translate host name to IPV4 else: print("Invalid amount of arguments") print("Syntax: python3 scanner.py ...
StarcoderdataPython
1720394
<reponame>Andrew-Wyn/scraping_borsa_italiana import data from flask import Flask import requests from urllib import parse import logging from datetime import datetime from flask import render_template from flask import request from flask import send_file from data import * from utilities import * # global variables ...
StarcoderdataPython
3215296
__author__ = 'giacomov' import collections import exceptions PARTICLE_SOURCE = 'particle source' POINT_SOURCE = 'point source' EXTENDED_SOURCE = 'extended source' class UnknownSourceType(exceptions.Exception): pass class Source(object): def __init__(self, list_of_components, src_type, spatial_shape=None)...
StarcoderdataPython
3360521
from datetime import datetime from typing import NamedTuple, List, Optional from autotui.shortcuts import load_prompt_and_writeback import click def edit_in_vim() -> str: return click.edit(text=None, editor="vim").strip() class JournalEntry(NamedTuple): creation_date: datetime tags: Optional[List[str]...
StarcoderdataPython
3235647
<reponame>KIT-IAI/SmartDataRepresentations import argparse import pprint import pandas as pd import wandb from pywatts.core.summary_formatter import SummaryJSON from src.data_handler import get_data, train_test_split from src.pipeline import create_pipeline from src.pywatts.model_handler_module import Models def b...
StarcoderdataPython
3271734
#!/usr/bin/env python # encoding: utf-8 # The MIT License (MIT) # Copyright (c) 2017-2018 CNRS # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limita...
StarcoderdataPython
3275863
<filename>Week#1__Assignment#1/assignment6_top_ten.py import sys import json import operator def topTenHashtags(json_data): reload(sys) sys.setdefaultencoding("utf8") hashtagCount = {} for line in json_data: tweets = [] tweets.append(json.loads(line)) for tweet in tweets: if 'entities' in tweet.keys(): ...
StarcoderdataPython
1757799
# Copyright 2015-2016 Stanford University # # 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 ...
StarcoderdataPython
183696
"""empty message Revision ID: 5db306adc6cc Revises: <PASSWORD> Create Date: 2018-03-18 21:34:57.446692 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '5db306adc6cc' down_revision = '<PASSWORD>' branch_labels = None depends_on = None def upgrade(): # ### ...
StarcoderdataPython
3273846
# coding: utf-8 from transformers import CLIPProcessor
StarcoderdataPython
97207
<reponame>stanfordmlgroup/CheXseg<filename>chexpert-model/IRNet/cam_to_ir_label_hdf5.py<gh_stars>1-10 import sys import os sys.path.append(os.path.abspath("../")) import numpy as np import imageio from misc import imutils from constants import * import pandas as pd import torch import h5py from tqdm import tqdm def ...
StarcoderdataPython
3315629
<gh_stars>0 #!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Thu Jul 5 11:58:51 2018 @author: stu """ import sys sys.path.insert(1,'.') #import math #import os import numpy as np import scipy.io import matplotlib.pyplot as plt # load the data ss_filename = 'ss_data.mat' ss_data = scipy.io.loadmat(ss_...
StarcoderdataPython
3231543
from django.core.management import call_command from django.test import TestCase from six import StringIO class IntegrityTestCase(TestCase): """ Very basic tests around the app itself, not the code. """ def test_no_pending_migrations(self): """ Make sure all model changes are reflecte...
StarcoderdataPython
1726505
<gh_stars>100-1000 from lasagne import layers from lasagne.updates import nesterov_momentum from nolearn.lasagne import NeuralNet,BatchIterator import os import numpy as np from sklearn.utils import shuffle import cPickle as pickle import matplotlib.pyplot as plt import Image import ImageOps from scipy import misc impo...
StarcoderdataPython
69725
<filename>tests/unit_tests/test_gas_model/test_cpg.py import unittest import numpy as np from perform.constants import REAL_TYPE from perform.gas_model.calorically_perfect_gas import CaloricallyPerfectGas from constants import CHEM_DICT_AIR class CPGInitTestCase(unittest.TestCase): def setUp(self): sel...
StarcoderdataPython
3235909
<reponame>hrayrhar/aws-cv-unique-information from sample_info.methods.base import BaseClassifier, BaseAutoEncoder from sample_info.methods.classifiers import StandardClassifier, ClassifierL2, ClassifierL2WithGradCollector from sample_info.methods.classifiers import LinearizedModel, LinearizedModelV2
StarcoderdataPython
191559
# # Tests for the `osbuild.util.rhsm` module. # from io import StringIO from osbuild.util.rhsm import Subscriptions REPO_FILE="""[jpp] name = Red Hat JBoss Portal baseurl = https://cdn.redhat.com/1.0/$basearch/os enabled = 0 gpgcheck = 1 gpgkey = file:// sslverify = 1 sslcacert = /etc/rhsm/ca/redhat-uep.pem sslclien...
StarcoderdataPython
30534
from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool from django.utils.translation import ugettext_lazy as _ class StatsApphook(CMSApp): name = _("Stats Apphook") def get_urls(self, page=None, language=None, **kwargs): return ["danceschool.stats.urls"] # replace th...
StarcoderdataPython
1678446
# -*- coding: utf-8 -*- """Forms related to import operations.""" from __future__ import unicode_literals from django import forms from django.utils.translation import ugettext_lazy class ImportDataForm(forms.Form): """Base form to import objects.""" sourcefile = forms.FileField(label=ugettext_lazy("Sele...
StarcoderdataPython
1655398
# -*- coding: utf-8 -*- from schematics.types import StringType from schematics.types.compound import ModelType from openprocurement.api.roles import RolesFromCsv from openprocurement.api.models import ListType from openprocurement.agreement.core.models.change import Change as BaseChange from openprocurement.agreement...
StarcoderdataPython
1702593
def test_web3_fixture(request, project_dir): chain = request.getfuncargvalue('chain') web3 = request.getfuncargvalue('web3') assert web3 is chain.web3
StarcoderdataPython
3326143
import numpy as np from sklearn.model_selection import train_test_split from sklearn.tree import DecisionTreeClassifier # NOTE: Make sure that the class is labeled 'class' in the data file tpot_data = np.recfromcsv('PATH/TO/DATA/FILE', delimiter='COLUMN_SEPARATOR', dtype=np.float64) features = np.delete(tpot_data.vie...
StarcoderdataPython
3350232
from django.urls import path, include from rest_framework_jwt.views import obtain_jwt_token from . import views user_patterns = [ path("signup/", views.SignUpView.as_view(), name="signup"), path("token/", obtain_jwt_token, name="jwt_token"), path("me/", views.UserProfileView.as_view(), name="profile"), ...
StarcoderdataPython
2618
<gh_stars>0 # shows artist info for a URN or URL import spotipy_twisted import sys import pprint if len(sys.argv) > 1: urn = sys.argv[1] else: urn = 'spotify:artist:3jOstUTkEu2JkjvRdBA5Gu' sp = spotipy_twisted.Spotify() artist = sp.artist(urn) pprint.pprint(artist)
StarcoderdataPython
4818717
import torch from model import QuickThoughtsModel WORD_EMBED = 128 THOUGHT_SIZE = 256 def main(): device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') # torch.manual_seed(1234) vocab_size = 5116 model_path = 'quick_thought_main_all.bin' print(' load model', model_path) c...
StarcoderdataPython
3339159
<filename>connection_handler.py ''' Created on 04.08.2011 @author: Limfocit ''' from google.appengine.ext import db from google.appengine.ext import webapp from main import OnlineUser from google.appengine.ext.webapp.util import run_wsgi_app def handle_disconnection(channel_id): # Find all their subscriptions and...
StarcoderdataPython
1713233
from django.core.management.base import BaseCommand, CommandError import random, string from coursereg.models import User, Department, Degree import csv class Command(BaseCommand): help = 'Bulk load Users to the database from a faculty and student csv files.' def add_arguments(self, parser): parser.ad...
StarcoderdataPython
66716
<gh_stars>0 from .Grid import Grid class ChessBoard: row = {'A': 0, 'B': 1, 'C': 2,'D': 3, 'E': 4, 'F': 5,'G': 6, 'H': 7} col = {1:7, 2:6, 3:5, 4:4, 5:3, 6:2, 7:1, 8:0} def __init__(self): self.board = Grid(8, 8, "*") def __setitem__(self, position, value): row, col = self.check_ches...
StarcoderdataPython