id
stringlengths
1
265
text
stringlengths
6
5.19M
dataset_id
stringclasses
7 values
4815275
import json import csv data = [] with open('RAW_interactions.csv', 'r', encoding='utf-8') as f: reader = csv.reader(f, delimiter=',') skipfirst = True for line in reader: if skipfirst: skipfirst = False continue data.append(line[4]) print('number of reviews: ', len(...
StarcoderdataPython
197320
<reponame>victorromeo/uTensor import tensorflow as tf import numpy as np import jinja2 output_file = "test_relu.cpp" const_file = "constants_relu.hpp" const_str = """ static const {{ dtype }} s_in_{{ test_name }}[{{ input_size }}] = { {% for x in ref_in %} {{ x }}{{ "," if not loop.last }} {% endfor %} }; static con...
StarcoderdataPython
3378702
from .compose import compose from .curry import curry __all__ = ['compose', 'curry', ]
StarcoderdataPython
1706858
import json from random import randint from typing import Callable, Dict, Optional from unittest.mock import patch import pytest from botocore.config import Config from botocore.stub import Stubber from aws_lambda_powertools.utilities.batch import ( BatchProcessor, EventType, PartialSQSProcessor, batc...
StarcoderdataPython
1729725
<filename>public/plugins/Blockchain/sandboxer/scope.py allowed_classes = [ # Exceptions ArithmeticError, AssertionError, AttributeError, BaseException, BlockingIOError, BrokenPipeError, BufferError, BytesWarning, ChildProcessError, ConnectionAbortedError, ConnectionError, ConnectionRefusedError, Con...
StarcoderdataPython
3330695
import inventory.aws_inventory.version __version__ = version.__version__
StarcoderdataPython
4979
import matplotlib.pyplot as plt import numpy as np import sys sys.path.append('../../../software/models/') import dftModel as DFT import math k0 = 8.5 N = 64 w = np.ones(N) x = np.cos(2*np.pi*k0/N*np.arange(-N/2,N/2)) mX, pX = DFT.dftAnal(x, w, N) y = DFT.dftSynth(mX, pX, N) plt.figure(1, figsize=(9.5, 5)) plt.subpl...
StarcoderdataPython
3252075
import random import time import pyautogui from .platform import windowMP from .mouse_utils import mouse_random_movement, move_mouse_and_click, move_mouse from .debug import debug from .constants import UIElement, Button, Action from .image_utils import find_ellement from .settings import settings_dict from .game im...
StarcoderdataPython
3374921
<gh_stars>10-100 # Slixmpp: The Slick XMPP Library # Copyright (C) 2012 <NAME>, <NAME> # This file is part of Slixmpp. # See the file LICENSE for copying permission. from slixmpp.plugins.base import register_plugin from slixmpp.plugins.xep_0221 import stanza from slixmpp.plugins.xep_0221.stanza import Media, URI from...
StarcoderdataPython
1744979
<reponame>jbeilstenedmands/cctbx_project from __future__ import division from xfel.ui.db import db_proxy known_job_statuses = ["DONE", "ERR", "PEND", "RUN", "SUSP", "PSUSP", "SSUSP", "UNKWN", "EXIT", "DONE", "ZOMBI", "DELETED", "SUBMIT_FAIL", "SUBMITTED"] finished_job_statuses = ["DONE", "EXIT", "DELETED", "UNKWN", "E...
StarcoderdataPython
34553
<reponame>jaekyeom/garage """Module for RL2. This module contains RL2, RL2Worker and the environment wrapper for RL2. """ # yapf: disable import abc import collections import akro from dowel import logger import numpy as np from garage import (EnvSpec, EnvStep, EpisodeBatch, ...
StarcoderdataPython
196598
<filename>powershell_kernel/powershell_proxy.py import threading try: import queue except ImportError: import Queue as queue from threading import Timer, Lock from time import sleep class ReplReader(threading.Thread): def __init__(self, repl): super(ReplReader, self).__init__() self.repl = ...
StarcoderdataPython
1765085
from selenium import webdriver import re import time import csv import pandas as pd import numpy as np from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC import datetime def get_earliest_review(url): ...
StarcoderdataPython
4814042
import util def solve(input_path): with open(input_path) as f: return util.lowest_risk_path( util.expand_grid( util.parse_grid(f.read()))) if __name__ == '__main__': print(solve('input.txt'))
StarcoderdataPython
3256517
<reponame>syahnur197/restaurant-backend<filename>restaurant/migrations/0001_initial.py<gh_stars>0 # Generated by Django 3.2.12 on 2022-02-12 08:09 from django.conf import settings import django.contrib.auth.models import django.contrib.auth.validators from django.db import migrations, models import django.db.models.de...
StarcoderdataPython
3342297
<filename>project/starter_code/student_utils.py import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import os import random as rn import tensorflow as tf from sklearn.model_selection import GroupKFold from sklearn.metrics import confusion_matrix, precision_score, recall_score, ...
StarcoderdataPython
1750034
<gh_stars>10-100 """ Creates a listener + sender chain for the event bus for easier to manage action processing. """ # mypy: allow-any-expr from typing import List, Optional from .data import ( MappedEvents, LinkHandlerData, ) from .link import ( EventLinkStart, ) from ..lifecycle.listener_set import Lis...
StarcoderdataPython
1678003
# Copyright 2018 Contributors to Hyperledger Sawtooth # # 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 ...
StarcoderdataPython
3333616
<filename>flow/diagram_storage.py import os import json # request a list of flow diagrams on the controller def list_diagrams(): diagram_infos = [] if not os.path.exists('diagrams'): os.makedirs('diagrams') file_names = os.listdir('diagrams') for file_name in file_names: if file_name.e...
StarcoderdataPython
3300698
import numpy as np import matplotlib.pyplot as plt fg = plt.figure(figsize=(5,5)) ax = plt.gca() plt.plot([1,1],[0,1],color='red',linewidth=2) plt.plot([1,2],[2,2],color='red',linewidth=2) plt.plot([2,2],[2,1],color='red',linewidth=2) plt.plot([2,3],[1,1],color='red',linewidth=2) plt.text(0.5,2.5,'S0',size=14, ha='c...
StarcoderdataPython
185396
import logging from typing import Optional from fastapi import FastAPI, HTTPException, Depends from pydantic import BaseModel from config import EMBED_DATA_PATH from core.matcher import TwitterUserMatcher from core.utils import username_dict class TwitterUsername(BaseModel): """ TwitterUsername model: input...
StarcoderdataPython
1780715
from flask import g def test_with_string_page_num(client, endpoint): rv = client.get(f'{endpoint}/manga', json={ 'page': 'abc', }) res = rv.get_json() assert res['code'] == 400 assert res['message'] == 'Invalid page number value' def test_with_float_page_num(client, endpoint): rv = ...
StarcoderdataPython
157837
<reponame>vaishnavtv/neurodiffeq import torch import numpy as np import random import pytest from pytest import raises, warns, deprecated_call from neurodiffeq.conditions import NoCondition from neurodiffeq.conditions import IVP from neurodiffeq.conditions import BundleIVP from neurodiffeq.conditions import EnsembleCon...
StarcoderdataPython
1618837
import sys import lnkr def fake_color(str): return str class WinTerminal: def __init__(self): self.normal = fake_color self.red = fake_color self.green = fake_color self.blue = fake_color self.yellow = fake_color windows_mode = sys.platform.startswith('win') def get_...
StarcoderdataPython
3309803
<reponame>SkyLLine/Inception-v4-in-mindspore<filename>reduction_B.py import mindspore as ms import mindspore.nn as nn import mindspore.ops.operations as operator import mindspore.dataset.transforms.vision.c_transforms as CV import mindspore.dataset.transforms.c_transforms as C from mindspore.dataset.transforms.vision i...
StarcoderdataPython
1685553
import github3 import uritemplate from .helper import IntegrationHelper SSH_KEY = ( # Generated for this alone then deleted 'ssh-rsa ' 'AAAAB3NzaC1yc2EAAAADAQABAAABAQCl4l154T4deeLsMHge0TpwDVd5rlDYVyFFr3PP3ZfW+' 'RZJAHs2QdwbpfoEWUaJmuYvepo/L8JrglKg1LGm99iR/qRg3Nbr8kVCNK+Tb5bUBO5JarnYIT' 'hwzhRxamZ...
StarcoderdataPython
3302964
from .tabloo import ( show, embedHTML, )
StarcoderdataPython
3302221
<filename>pyclasp/__init__.py __author__ = '<NAME>' __copyright__ = 'Copyright 2019-2020 Synesis Information Systems, Copyright 2019 Synesis Software' __credits__ = [ '<NAME>', '<NAME>', ] __email__ = '<EMAIL>' __license__ = 'BSD-3-Clause' __maintainer__ = '<NAME>' _...
StarcoderdataPython
3368544
<reponame>SebNik/EV3DEV-Python #!/usr/bin/env python3 from ev3dev2.motor import LargeMotor, OUTPUT_B large_motor = LargeMotor(OUTPUT_B) #large_motor.on(speed=50) large_motor.on_for_seconds(speed=40, seconds=3) large_motor.wait_until_not_moving()
StarcoderdataPython
1603901
from .ants_image import * from .ants_transform import * from .image_io import * from .transform_io import *
StarcoderdataPython
3390560
""" Production Configurations - Use WhiteNoise for serving static files - Use Amazon's S3 for storing uploaded media - Use mailgun to send emails - Use Redis for cache - Use sentry for error logging """ import logging import os import raven import requests from django.core.exceptions import ImproperlyConfigured fro...
StarcoderdataPython
3243694
from django import template from django.utils.functional import cached_property from wagtail.wagtailimages.models import Filter, SourceImageIOError register = template.Library() @register.tag(name="image") def image(parser, token): bits = token.split_contents()[1:] image_var = bits[0] filter_spec = bits...
StarcoderdataPython
3360372
<filename>terminusdb_client/tests/mockResponse.py # from terminusdb_client.woqlclient.api_endpoint_const import APIEndpointConst # # from .connectCapabilitiesResponse import ConnectResponse # from .getSchemaTurtleResponse import RESPONSE # # def mocked_requests(*args, **kwargs): # class MockResponse: # def...
StarcoderdataPython
3274772
# -*- encoding: utf-8 -*- def version_tuple(s): return tuple([int(x) for x in s.split("-")[0].split(".")]) # Deal with remainder for versions like "1.5.0-jsonrpc"
StarcoderdataPython
1788891
<reponame>rafaelbantu/timtec<filename>accounts/forms.py<gh_stars>10-100 # -*- coding: utf-8 -*- from django.contrib.auth import get_user_model from django import forms from django.utils.translation import ugettext_lazy as _ from django.conf import settings from timtec.settings import ACCOUNT_REQUIRED_FIELDS as fields f...
StarcoderdataPython
1757188
# 9.2.2 多次元ガウス分布のEMアルゴリズム #%% # 9.2.2項で利用するライブラリ import numpy as np from scipy.stats import multivariate_normal # 多次元ガウス分布 import matplotlib.pyplot as plt #%% ## 真の分布の設定 # 次元数を設定:(固定) D = 2 # クラスタ数を指定 K = 3 # K個の真の平均を指定 mu_truth_kd = np.array( [[5.0, 35.0], [-20.0, -10.0], [30.0, -20.0]] ) # K個の...
StarcoderdataPython
1612068
<reponame>afprati/Bayesian-Causal-Inference import torch import json import gpytorch import pyro from pyro.infer.mcmc import NUTS, MCMC, HMC from model.multitaskmodel import MultitaskGPModel from utilities.savejson import savejson from utilities.visualize import visualize_synthetic, plot_posterior, plot_pyro_posterior,...
StarcoderdataPython
195883
<filename>assignment7/reducer.py #!/usr/bin/python import sys req=dict() for line in sys.stdin: line=line.split("\n")[0] req[line]=int(req.get(line,0))+1 for key in req.viewkeys(): print "{0} {1}".format(key,req.get(key))
StarcoderdataPython
3319834
<filename>utils.py import random import re import string from pathlib import Path PUNCTUATION_ZH = r"[\u3002|\uff1f|\uff01|\uff0c|\u3001|\uff1b|\uff1a|\u201c|\u201d|\u2018|\u2019|\uff08|\uff09|\u300a|\u300b|\u3008|\u3009|\u3010|\u3011|\u300e|\u300f|\u300c|\u300d|\ufe43|\ufe44|\u3014|\u3015|\u2026|\u2014|\uff5e|\ufe4f|...
StarcoderdataPython
3240323
<reponame>dangeng/infiniteGANorama import os.path from data.base_dataset import BaseDataset, get_transform from data.image_folder import make_dataset import numpy as np from PIL import Image from scipy.misc import imresize class FrankensteinDataset(BaseDataset): @staticmethod def modify_commandline_options(pa...
StarcoderdataPython
3306094
<filename>hackerrank_problems/Angry_Professor.py<gh_stars>1-10 test_cases = int(input()) outcomes = [] for test in range(test_cases): arr = list(map(int,input().split())) student_timings = list(map(int,input().split())) onTime = 0 for student_timing in student_timings: if student_timing <= 0: ...
StarcoderdataPython
148777
from ext.ftp.manager import FTPManager from tests.main import MainTestClass from zeex.core.ctrls.ftp import FtpReply, FtpManager, Downloader import pytest import os class TestFTPManager(MainTestClass): @pytest.fixture def manager(self): sample_connection = ['speedtest.tele2.net', 'anonymous', 'guest'...
StarcoderdataPython
3300205
import numpy as np from scipy.io import savemat, loadmat import pandas as pd from .utils import BaseDictlike from .bins import BaseBin from .identifiers import Pid PID_VAR = 'pid' ADC_VAR = 'adc' ROI_NUMBERS_VAR = 'roi_numbers' IMAGES_VAR = 'images' HEADERS_VAR = 'headers' MAX_FIELD_LENGTH = 31 # notes about MATLA...
StarcoderdataPython
1711231
# Generated by Django 3.0.3 on 2020-04-21 07:48 import changelogs.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("changelogs", "0004_project_team"), ] operations = [ migrations.AlterField( model_name="project", ...
StarcoderdataPython
4837137
""" This file contains definitions of useful data stuctures and the paths for the datasets and data files necessary to run the code. Things you need to change: *_ROOT that indicate the path to each dataset """ from os.path import join H36M_ROOT = '/scratch/liu.shu/datasets/Human36M_raw/' LSP_ROOT = '' LSP_ORIGINAL_ROO...
StarcoderdataPython
3369082
<gh_stars>1-10 from rasa_sdk.events import ConversationPaused from covidflow.actions.action_goodbye import ActionGoodbye from .action_test_helper import ActionTestCase class ActionGoodbyeTest(ActionTestCase): def setUp(self): super().setUp() self.action = ActionGoodbye() def test_goodbye(se...
StarcoderdataPython
1702363
<reponame>www439198341/V2RayCloudSpider<gh_stars>0 # -*- coding: utf-8 -*- # Time : 2021/12/22 22:04 # Author : QIN2DIM # Github : https://github.com/QIN2DIM # Description: from typing import Optional, List, Dict, Any from services.collector import __entropy__ from services.middleware.workers_io import E...
StarcoderdataPython
3318590
from CharAE_Cho import * from encoder import cnn_encoder, rnn_encoder from decoder import rnn_decoder, cnn_decoder import random class CharLevel_autoencoder(nn.Module): def __init__(self, criterion, seq_len, layers ): super(CharLevel_autoencoder, self).__init__() self.batch_size = 64 ...
StarcoderdataPython
1777741
#!/usr/bin/python3 import sys import json import subprocess def run_cmd( cmds ) : print( cmds, file=sys.stderr ) res = subprocess.run( cmds, capture_output=True, text=True ) if res.returncode != 0: print( res.stderr, file=sys.stderr ); sys.exit(1) return res if __name__ == '__main__': if len(sys.ar...
StarcoderdataPython
3282237
<filename>losses_gan.py import torch import torch.nn as nn from torchvision.models import vgg19 class TVLoss(nn.Module): """Total Variation Loss for SRGAN""" def __init__(self, tv_loss_weight=1): super(TVLoss, self).__init__() self.tv_loss_weight = tv_loss_weight def forward(self, x): ...
StarcoderdataPython
3378661
<filename>day17/main.py inputFile = "day17/day17_1_input.txt" ## no need to actually read input.. its is to small.. hardoced in code # https://adventofcode.com/2021/day/17 class Probe: # probe always start at position 0, 0 x = 0 y = 0 velocityX = 0 velocityY = 0 targetLeft = 0 targetTop...
StarcoderdataPython
1694787
""" Copyright 2017-present Airbnb, 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, sof...
StarcoderdataPython
3299808
<filename>scvi_tools_gui/styles.py<gh_stars>0 SIDEBAR_STYLE = { "position": "fixed", "top": 0, "left": 0, "bottom": 0, "width": "16rem", "padding": "2rem 1rem", "background-color": "#f8f9fa", } CONTENT_STYLE = { "margin-left": "18rem", "margin-right": "2rem", "padding": "2rem 1r...
StarcoderdataPython
178937
from typing import Iterator from bs4 import Tag from transmogrifier.sources.datacite import Datacite class Zenodo(Datacite): def __init__( self, source: str, source_base_url: str, source_name: str, input_records: Iterator[Tag], ): super().__init__(source, sour...
StarcoderdataPython
32791
<reponame>tt6746690/lddmm-ot # We use a slightly hacked version of the plot.ly js/python library lddmm_python = __import__(__name__.split('.')[0]) print(lddmm_python) import lddmm_python.lib.plotly as plotly import re from pylab import * from IPython.html.widgets import interact from IPython.display import HTML, displ...
StarcoderdataPython
3382749
class Solution: def reverseVowels(self, s: str) -> str: vowels = set('aeiouAEIOU') res = [None] * len(s) i, j = 0, len(s) - 1 while i < j: while i < j and s[i] not in vowels: res[i] = s[i] i += 1 while i < j and s[j] no...
StarcoderdataPython
3253121
# This file is an example of test script for an easier development from classes import Player import asyncio from discord.ext import commands from logging import getLogger import modules.config as cfg import modules.lobby as lobby import modules.database as db from match import MatchStatus from display import Contex...
StarcoderdataPython
3318333
import cv2 from line import Line import os import glob import numpy as np class LaneDetectionPipeline(object): """ Lane detection pipeline. """ def __init__(self, debug=False, bad_frame_count_threshold=10): self._mtx = None # undistort matrice self._dist = None self._rvect =...
StarcoderdataPython
4832457
<gh_stars>1-10 # -*- coding: utf-8 -*- # Generated by Django 1.11.12 on 2018-04-30 12:18 from __future__ import unicode_literals import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('stock', '0001_initial'), ] operations...
StarcoderdataPython
164653
import pytest import bz2 import importlib.resources import gzip import lzma import uuid import zlib from dataclasses import make_dataclass from fondat.error import InternalServerError, NotFoundError from fondat.file import directory_resource, file_resource from fondat.pagination import paginate from fondat.stream imp...
StarcoderdataPython
80997
CheckNumber = float(input("enter your number")) print(str(CheckNumber) +' setnumber') while CheckNumber != 1: numcheck = CheckNumber if CheckNumber % 2 == 0: CheckNumber = CheckNumber / 2 print(str(CheckNumber) +' output reduced') else: CheckNumber = CheckNumber * 3 + 1 print(str(CheckNumber) +' output ...
StarcoderdataPython
1645319
<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys import argparse from typing import Any, Dict def get_argparser_args() -> Dict[str, Any]: return {} def configure_argparse(parser: argparse.ArgumentParser) -> None: from . import grabber, decode_image, ws, img2video_prepare, img2video,...
StarcoderdataPython
177431
import pytest from mixer.backend.django import mixer from pagos.forms import * from pagos.models import * pytestmark = pytest.mark.django_db class TestDonationForm: def test_form(self): form = DonationForm(data={}) card_type = mixer.blend('pagos.CardType', alias='visa', card_type='visa') a...
StarcoderdataPython
4842954
<reponame>TFUsers/flax<filename>flax/linen/module.py # Copyright 2020 The Flax Authors. # # 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
48692
''' Created on 24.05.2014 @author: ionitadaniel19 ''' import logging.config import os import json from xlsmanager import easyExcel from constants import * import traceback import copy def setup_logging(default_path='logging.json', default_level=logging.INFO,env_key='LOG_CFG'): """Setup logging conf...
StarcoderdataPython
1618008
<reponame>christopherlovell/hyperion<filename>hyperion/conf/__init__.py from .conf_files import RunConf, ImageConf, BinnedImageConf, PeeledImageConf, OutputConf
StarcoderdataPython
1608131
from .kubernetes import KubernetesManager # noqa from .notebook import PapermillNotebookKubernetesProcessor # noqa from .job_resources import get_job_resources # noqa
StarcoderdataPython
90988
''' This module provides functions to work with clingo's theories. Example ------- ```python-repl >>> from clingo.control import Control >>> from clingox.theory import evaluate >>> >>> prg = """\ ... #theory test { ... term { ... - : 3, unary; ... ** : 2, binary, right; ... * : 1, binary...
StarcoderdataPython
3240209
<gh_stars>0 # -*- coding: utf-8 -*- from torch import nn from torch.nn import functional as F class ActorCritic(nn.Module): def __init__(self, observation_space, action_space, hidden_size): super(ActorCritic, self).__init__() self.state_size = observation_space.shape[0] self.action_size = action_space.s...
StarcoderdataPython
3249139
from typing import Dict, List, Union from resources.user import User as BaseUser, UserRequest, UpdateUser, SetAsOwner class user(BaseUser): @classmethod def create(cls, body: UserRequest) -> Dict: """Create user in dome9 :param body: Details for the new user :type body: UserRequest :returns: Dict that ha...
StarcoderdataPython
149485
# Copyright 2016 Google Inc. 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 applicable law or a...
StarcoderdataPython
3272531
# -*- coding:utf-8 -*- import os import json from datetime import datetime from datetime import timedelta from django.conf import settings from django.http import FileResponse from django.shortcuts import render from .models import Kepan def download_excel(request): file_path = open(settings.BASE_DIR ...
StarcoderdataPython
1774390
# Utwórz “ręcznie” plik csv zawierający informacje o dostępnych produktach. # Wykorzystaj csv.reader i napisz funkcję “ładującą” stan magazynu z pliku csv. # Uruchamiaj ją za każdym razem przy starcie programu. from shop import user_interface from shop.persistence import load_store from shop.store import Store def ...
StarcoderdataPython
3366578
""" A collection of useful variables. """ __all__ = ['PARROT_STATE', 'FUNNY_WALK_STEPS'] PARROT_STATE = 'dead' """The global state of the parrot.""" FUNNY_WALK_STEPS = [['left', 'right'], ['left', 'jump', 'right', 'jump'], ['swim']] """List of different possible walk. Each i...
StarcoderdataPython
1657857
<reponame>AnmolTomer/django_flashcard_app<gh_stars>1-10 from django.shortcuts import render # Create your views here. # View for home def home(request): return render(request, 'home.html', {}) # --------------------------------------------------------------ADD----------------------------------------------------...
StarcoderdataPython
3337
<reponame>hmendozap/master-arbeit-files import numpy as np import scipy.sparse as sp from HPOlibConfigSpace.configuration_space import ConfigurationSpace from HPOlibConfigSpace.conditions import EqualsCondition, InCondition from HPOlibConfigSpace.hyperparameters import UniformFloatHyperparameter, \ UniformIntegerH...
StarcoderdataPython
1614321
<reponame>JOiiNT-LAB/multimaster_fkie #!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2012, <NAME>/US, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: #...
StarcoderdataPython
187490
import attr from typing import Optional, List from modules.enums import Interval, ChordType, AdditionType from modules.note import Note @attr.s(frozen=True, auto_attribs=True) class ChordAddition: addition_type: AdditionType = AdditionType.NONE interval: Optional[Interval] = Interval.NONE @classmethod ...
StarcoderdataPython
190863
<filename>oompa/tracking/github/GitHubMetdataStore.py # # GitHubMetadataStore.py # """ package oompa.tracking.github """ class GitHubMetadataStore: _kinds = [ "User", "Organization", "Repository" ] _kinds_lowered = [ kind.lower() for kind in _kinds ] def __init__(self, config, githubHelpe...
StarcoderdataPython
1757119
import unittest import numpy from cqcpy.ov_blocks import one_e_blocks from cqcpy import test_utils from kelvin import ft_cc_energy from kelvin import ft_cc_equations from kelvin import quadrature def evalL(T1f, T1b, T1i, T2f, T2b, T2i, L1f, L1b, L1i, L2f, L2b, L2i, Ff, Fb, F, I, D1, D2, tir, tii, ...
StarcoderdataPython
3257534
<reponame>catniplab/ML-music-analysis """ For figuring out whether or not neural networks possess attractors, and where they are. """ import math import torch import numpy as np from src.neural_nets.models import get_model my_dict = {'architecture': "TANH", 'readout': "linear", 'input_size': 8...
StarcoderdataPython
70382
# Copyright 2017 The TensorFlow Authors modified by <NAME>. 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 ...
StarcoderdataPython
3277125
<filename>creational/example/supplier.py #!/usr/bin/python3 # -*- coding: utf-8 -*- # @Date : 2020/8/6 # @Author : <NAME> /<NAME> # @Mail : <EMAIL> from abc import ABCMeta, abstractmethod from creational.example.component import MotherBoard, CpuHigh, CpuLow, MemoryHigh, MemoryLow, \ StorageHigh, StorageLow, Mo...
StarcoderdataPython
171309
from command_gui_buttons import *
StarcoderdataPython
3322377
<filename>credential_test.py import unittest # Importing the unittest module from credential import Credential # Importing the credential class class TestCredential(unittest.TestCase): ''' Test class that defines test cases for the credential class behaviours. Args: unittest.TestCase: TestCase clas...
StarcoderdataPython
142929
# Generated by Django 3.0.13 on 2021-04-04 06:32 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ("vulnerabilities", "0001_initial"), ] operations = [ migrations.AddField( model_name="packagere...
StarcoderdataPython
4841655
#!/bin/python #Import argv from sys module from sys import argv #list variables for argv parameters script, filename = argv #write three strings with the print command print "We're going to erase %r." % filename print "If you don't want that, hit, CTRL-C (^C)." print "If you do want that, hit RETURN." raw_input("?"...
StarcoderdataPython
1670395
<reponame>laurafroelich/py-dhi-dfs<gh_stars>0 import os import numpy as np from datetime import datetime import System from System import Array from DHI.Generic.MikeZero import eumQuantity, eumItem from DHI.Generic.MikeZero.DFS import DfsFileFactory, DfsFactory, DfsBuilder, DfsSimpleType, DataValueType, StatType from D...
StarcoderdataPython
1704859
import sys import os from cx_Freeze import setup, Executable # This is hidden until we display progress inside GUI, for now we need a console window # base = None # if sys.platform == 'win32': # base = 'Win32GUI' base = "Console" executables = [ Executable('grant.py', base=base) ] buildOptions = di...
StarcoderdataPython
3305433
import json from . import TestCase from unittest.mock import patch from gcloudc.commands.management.commands import _REQUIRED_COMPONENTS, CloudDatastoreRunner class CloudDatastoreRunnerTest(TestCase): def test_check_gcloud_components(self): class MockProcess: stdout = json.dumps([{"id": cp, "c...
StarcoderdataPython
3268288
from __future__ import absolute_import, division, print_function from builtins import (bytes, str, open, super, range, zip, round, input, int, pow, object, map, zip) __author__ = "<NAME>" import numpy as np from . import minimizer #import sed_models_dic as Model_dic from .jet_model import...
StarcoderdataPython
3200708
<reponame>qiaoliuhub/AttnToCrispr from keras.models import Sequential, Model from keras.layers import Embedding, LSTM, Flatten, Dense, BatchNormalization, \ Activation, Dropout, concatenate, Lambda, Reshape, Conv2D, MaxPooling2D, TimeDistributed from keras.constraints import maxnorm from keras.optimizers import rms...
StarcoderdataPython
3224288
<reponame>shaun95/google-research # coding=utf-8 # Copyright 2022 The Google Research Authors. # # 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...
StarcoderdataPython
99116
import click import pyperclip from ..utils.logging import logger from ..utils.exceptions import handle_exceptions from ..utils.load import get_default_code_name import os @click.command(short_help='Copies code from file to clipboard.') @click.argument('code_file', type=click.Path(exists=True, dir_okay...
StarcoderdataPython
1711461
from openalea.deploy.shared_data import shared_data import rsml from rsml import misc from rsml import measurements import numpy as np from matplotlib import pyplot as plt from glob import glob import os # load rsml rsml_dir = shared_data(rsml.__path__)#,'AR570/2012_11_25_09h00_chl110_1_1.rsml') rsml_files = sorted(...
StarcoderdataPython
117558
import numpy as np with open("input", "r") as f: lines = f.readlines() rules = {} for i, line in enumerate(lines): if line == "\n": break name, rest = line.strip().split(":") range1, range2 = rest.split(" or ") min1, max1 = range1.split("-") min2, max2 = range2.split("-") rules[na...
StarcoderdataPython
3317802
<reponame>baltekgajda/recipe-scrapers from tests import ScraperTest from recipe_scrapers.craftlog import Craftlog class TestCraftlogScraper(ScraperTest): scraper_class = Craftlog def test_host(self): self.assertEqual("craftlog.com", self.harvester_class.host()) def test_author(self): se...
StarcoderdataPython
1726190
<filename>GUI/src/unodialogsample2.py #!/opt/libreoffice5.2/program/python # -*- coding: utf-8 -*- import unohelper from com.sun.star.beans.MethodConcept import ALL as MethodConcept_ALL from com.sun.star.beans.PropertyConcept import ATTRIBUTES as PropertyConcept_ATTRIBUTES, PROPERTYSET as PropertyConcept_PROPERTYSET fr...
StarcoderdataPython
1648846
<filename>test_Mathematicians.py<gh_stars>0 from Mathematicians import Mathematicians def test_get_names(): mathematicians = Mathematicians() names = mathematicians.list_names(100) assert names is not None def test_get_names_with_default_parameter_value(): mathematicians = Mathematicians() names ...
StarcoderdataPython
3366682
<gh_stars>1-10 # Copyright (c) 2018, NVIDIA CORPORATION. from itertools import product from math import floor import numpy as np import pytest from cudf import Series from cudf.tests import utils @pytest.mark.parametrize( "nelem,masked", list(product([2, 10, 100, 1000], [True, False])) ) def test_applymap_roun...
StarcoderdataPython