id
stringlengths
1
265
text
stringlengths
6
5.19M
dataset_id
stringclasses
7 values
3334409
<gh_stars>0 import logging from django.core.management.base import BaseCommand from ... import __title__ from ...core.esitools import is_esi_online from ...tasks import ( _eve_object_names_to_be_loaded, load_map, load_ship_types, load_structure_types, ) from ...utils import LoggerAddTag from . import ...
StarcoderdataPython
196459
import numpy as np def select_threshold(yval, pval): f1 = 0 # You have to return these values correctly best_eps = 0 best_f1 = 0 for epsilon in np.linspace(np.min(pval), np.max(pval), num=1001): # ===================== Your Code Here ===================== # Instructions: Compute ...
StarcoderdataPython
4815640
<gh_stars>0 import logging from logging import Formatter from logging.handlers import RotatingFileHandler def set_logger(logger, log_path="log/audio-visualization.log"): logger.setLevel(logging.INFO) formatter = Formatter("[%(levelname)s] %(asctime)s - %(name)s - %(message)s") file_handler = RotatingFile...
StarcoderdataPython
156251
<gh_stars>1-10 ''' Created on Feb. 9, 2020 @author: cefect ''' #========================================================================== # logger setup----------------------- #========================================================================== import logging, configparser, datetime start = datetime.datetime....
StarcoderdataPython
105797
<filename>containerchaos/main.py import subprocess import time import measure_response_time import utils URL = "http://localhost/" def _run(cmd: str): print("Running cmd: {}".format(cmd)) print(subprocess.run(cmd, shell=True, capture_output=True, cwd="../docker-nginx-flask-redis-postgres/")) def _sleep(t: in...
StarcoderdataPython
4808479
import os from application_files.log.logger import Logger from application_files.create_directory.create_directory import DirectoryCreator from application_files.traffic_tracking.traffic_tracking import TrafficTracking from application_files.model_file_operation.file_operation import FileOperationModelLoader from ...
StarcoderdataPython
45723
<filename>cdd/pkg_utils.py """ pkg_utils """ from distutils.sysconfig import get_python_lib def relative_filename(filename, remove_hints=tuple()): """ Remove all the paths which are not relevant :param filename: Filename :type filename: ```str``` :param remove_hints: Hints as to what can be rem...
StarcoderdataPython
1659360
from murmansk_culture_api.datatypes import ArtmuseumAddress from murmansk_culture_api.scraping.artmuseum import parse_address def test_address_museum(): cases = [ "в Мурманском областном художественном музее (Коминтерна, д.13)", "В главном здании Мурманского областного художественного музея", ...
StarcoderdataPython
3326507
<filename>tests/test_trajectory_displacement.py """ Tests center of mass and mean square displacement for Trajectory class """ import os import numpy as np from thermof import Trajectory mof_trial_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'ideal-mof-trial') ipmof_trial_dir = os.path.join(os.path....
StarcoderdataPython
1622137
""" Implementation of basic transforms on video data by <NAME> <EMAIL> """ import math import numbers import random import warnings from collections.abc import Sequence from typing import Tuple, List, Optional import numpy as np import torch from PIL import Image from PIL import ImageFilter from PIL import ImageOps fr...
StarcoderdataPython
1713228
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2016, <NAME> <<EMAIL>> # # Permission to use, copy, modify, and/or distribute this software for any purpose # with or without fee is hereby granted, provided that the above copyright notice # and this permission notice appear in all copies. # # THE SOFTWARE IS P...
StarcoderdataPython
47725
import os import numpy as np import tensorflow as tf import tensorflow_addons as tfa from loguru import logger import config from Train import train from Model import EEGNet class OptunaTrainer: def __init__(self, checkpointPath, epochs, batchsize, logPath=None): self.checkpointPath = checkpointPath self.logpa...
StarcoderdataPython
13633
<filename>mimic/model/rackspace_image_store.py """ An image store representing Rackspace specific images """ from __future__ import absolute_import, division, unicode_literals import attr from six import iteritems from mimic.model.rackspace_images import (RackspaceWindowsImage, ...
StarcoderdataPython
1669817
from twisted.protocols.basic import LineReceiver from _protocol import makeMain class LineReceiver(LineReceiver): def lineReceived(self, line): pass main = makeMain(LineReceiver, ((b"a" * 50) + b"\r\n") * 1000) main.__module__ = "lines" if __name__ == '__main__': import sys impo...
StarcoderdataPython
3293701
<filename>assignments/04-python-bash/head.py<gh_stars>0 #!/usr/bin/env python3 import os import sys def main(): args = sys.argv[1:] # #If there are no argument if len(args) != 1: print('Usage: {} FILE [NUM_LINES]'.format(os.path.basename(sys.argv[0]))) sys.exit(1) # #If first argument is no...
StarcoderdataPython
3386249
<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Sep 28 07:41:35 2019 @author: kaniska """ FIGSIZE = (7, 4) SMALL_FIG = (4,3)
StarcoderdataPython
32927
from fim_mission import * import torch import torch.nn as nn import torch.nn.parallel import torch.nn.functional as F import torch.backends.cudnn as cudnn import torch.optim as optim from torch.optim import lr_scheduler import torchvision.transforms as transforms from torchvision import datasets, models import matplo...
StarcoderdataPython
1617655
#!/usr/bin/python from __future__ import absolute_import, division, print_function # Copyright 2019-2020 Fortinet, Inc. # # 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
3388894
from xml.dom.minidom import Document import xml.etree.ElementTree as ET from pyosm.shapeify import get_shapes from pyosm.model import Node, Way import requests from math import radians, cos, sin, asin, sqrt from datetime import datetime def haversine(lon1, lat1, lon2, lat2): """ Calculate the great circle dist...
StarcoderdataPython
3342382
"""Define states, state transition messages and keyboards.""" from telegram import ReplyKeyboardMarkup, InlineKeyboardMarkup # STATE DEFINITIONS MAX_STATES = 9 # one constant per stage BIO, GENDER, BIRTHDATE, EMAIL, TELEPHONE, LOCATION, PHOTO, SUMMARY, COMPLETED = range(MAX_STATES) # transition messages to display ...
StarcoderdataPython
1753786
#!/usr/bin/env python import os,sys from optparse import OptionParser import time import fastq import preprocesser from multiprocessing import Process, Queue import copy from util import * AFTERQC_VERSION = "0.9.6" def parseCommand(): usage = "Automatic Filtering, Trimming, Error Removing and Quality Control for...
StarcoderdataPython
1772913
<gh_stars>0 ''' If you have some .pdf file, but only need a few pages out of the whole and you know exactly the page numbers that you want to remove or alternatively keep. Here's the code to help you do that. Credit for this code - https://stackoverflow.com/a/39574231/2126357 ''' #Do install the library if not avail...
StarcoderdataPython
197229
<gh_stars>1000+ import pytest class CustomItem(pytest.Item): def runtest(self): pass class CustomFile(pytest.File): def collect(self): yield CustomItem.from_parent(name="foo", parent=self) def pytest_collect_file(path, parent): return CustomFile.from_parent(fspath=path, parent=parent)
StarcoderdataPython
153864
# # Copyright 2020–21, by the California Institute of Technology. ALL RIGHTS # RESERVED. United States Government Sponsorship acknowledged. Any commercial # use must be negotiated with the Office of Technology Transfer at the # California Institute of Technology. # """ ==================== service_validator.py ===...
StarcoderdataPython
3200111
<gh_stars>1-10 # Copyright © 2016-2019 Medical Image Analysis Laboratory, University Hospital Center and University of Lausanne (UNIL-CHUV), Switzerland # # This software is distributed under the open-source license Modified BSD # # Modified by the brainhackers at BrainHack Global Geneva 2019 # """ PyMIALSRTK preproc...
StarcoderdataPython
102215
import matplotlib.pyplot as plt import generate import convert import analyse import equilibrate import yaml from pathlib import Path def main(settings: str, run: bool = False): if run: generate.run(settings) with open(settings, 'r') as f: params = yaml.safe_load(f) N = params['initial...
StarcoderdataPython
3273843
from django.apps import AppConfig class OperationsConfig(AppConfig): name = "operations" def ready(self): import operations.signals # noqa
StarcoderdataPython
4822105
<filename>ts_analysis.py import matplotlib.pyplot as plt import numpy as np import seaborn as sns from tslearn.clustering import TimeSeriesKMeans from tslearn.piecewise import ( OneD_SymbolicAggregateApproximation, PiecewiseAggregateApproximation, SymbolicAggregateApproximation, ) from tslearn.preprocessing...
StarcoderdataPython
3262526
#!/usr/bin/python # Send a value to change the opening of the Robotiq gripper using an action import rospy # brings the SimpleActionClient import actionlib import argparse from robotiq_2f_gripper_msgs.msg import CommandRobotiqGripperFeedback, CommandRobotiqGripperResult, CommandRobotiqGripperAction, CommandRobotiqGri...
StarcoderdataPython
3347730
# Copyright 2014 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 at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
StarcoderdataPython
1757117
<reponame>vgripon/clean-train<gh_stars>0 import torch import torch.nn as nn import torch.nn.functional as F from args import * from utils import linear class BasicBlock(nn.Module): expansion = 1 def __init__(self, in_planes, planes, stride=1, downsample=None): super(BasicBlock, self).__init__() ...
StarcoderdataPython
175836
cases = int(input()) for a in range(cases): tracks = int(input().split(" ")[0]) requests = input().split(" ") last = int(requests[0]) total = 0 for i in requests[1:]: next = int(i) total += min(tracks - ((next - last - 1) % tracks + tracks) % tracks, ((next - last - 1) % trac...
StarcoderdataPython
1712928
<filename>imgbbpy/aio.py """ The MIT License (MIT) Copyright (c) 2021 scrazzz 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, ...
StarcoderdataPython
1649112
<reponame>shiminasai/interteam-1 # -*- coding: UTF-8 -*- from django.db import models from .models import * from contrapartes.models import * from django import forms from ckeditor_uploader.widgets import CKEditorUploadingWidget class ProductoForm(forms.ModelForm): descripcion = forms.CharField(widget=CKEditorUplo...
StarcoderdataPython
3398045
<gh_stars>0 class SettingsEntity: def __init__(self, key): if isinstance(key, str): self.key = key else: raise TypeError("") self.settings = {} self.default_settings = {} def add_entry(self, key, entry): self.settings[key] = entry def add_en...
StarcoderdataPython
182297
import numpy as np from mlxtend.feature_selection import SequentialFeatureSelector as SFS from sklearn.model_selection import KFold from sklearn.feature_selection import SelectPercentile, mutual_info_classif import sys from pathlib import Path sys.path[0] = str(Path(sys.path[0]).parent) from metrics import metrics, m...
StarcoderdataPython
85881
import json import sys from application import produce_multiple from mental_lexicon import MentalLexicon from words import * if __name__ == "__main__": lexicon = MentalLexicon() hund = Subject("m", "hund", True) nehmen = Action("nehmen", "genommen", True) lexicon.add_item(hund) lexicon.add_item(n...
StarcoderdataPython
178543
#! /usr/bin/env python # -*- coding: utf-8 -*- # # %FFILE% # # Created by %USER% on %YEAR%/%MONTH%/%DAY%. # Copyright (c) %YEAR%年 %USER% All rights reserved. # """ %HERE% """ if __name__ == '__main__': pass
StarcoderdataPython
3233794
<reponame>rithik/CampusMarketplace DB_URL = 'sqlite:///database.db' SECRET_KEY = '<KEY>'
StarcoderdataPython
3389441
from __future__ import unicode_literals import os import json import unittest import base64 import tempfile from mock import patch import pep8 import requests import responses from werkzeug.exceptions import InternalServerError from . import create_app from .api import log_request, ha_policy_name from .http_client ...
StarcoderdataPython
1745950
<reponame>MinRegret/deluca-lung<gh_stars>1-10 import numpy as np import tqdm import datetime from deluca.lung.controllers import PID from deluca.lung.environments import PhysicalLung from deluca.lung.utils import Analyzer, BreathWaveform from deluca.lung.utils import run_calibration from deluca.lung.utils import run_...
StarcoderdataPython
96076
<gh_stars>0 #!/bin/python3 import math import os import random import re import sys #@author: r33 - <EMAIL> #@timestamp_creation: 02/18/2019 - 18:44 GMT-3 # # Complete the 'reformatDate' function below. # # The function is expected to return a STRING_ARRAY. # The function accepts STRING_ARRAY dates as parameter. # ...
StarcoderdataPython
3240637
<gh_stars>1-10 from allauth.account.forms import default_token_generator, user_pk_to_url_str from allauth.account.models import EmailConfirmation from directory_constants import choices from django.conf import settings from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, PermissionsMixin from djang...
StarcoderdataPython
3229072
# Copyright (C) 2020 NVIDIA Corporation. All rights reserved. # # This work is made available under the Nvidia Source Code License-NC. # To view a copy of this license, check out LICENSE.md import warnings import torch import torch.nn as nn from imaginaire.layers import Conv2dBlock, Res2dBlock class Re...
StarcoderdataPython
1666607
<reponame>kaushik-mac/py-wiki '''01001011 01000001 01010101 01010011 01001000 01001001 01001011 00100000 01000111 01010101 01010000 01010100 01000001''' # '''import all modules needed''' from tkinter import Button, Label, Listbox, PhotoImage, Tk ,Text from tkinter.constants import ACTIVE, END, SINGLE import wik...
StarcoderdataPython
1728894
<filename>pacote-download/PycharmProjects/pyhtonexercicios/ex101.py<gh_stars>1-10 def voto(ano): from datetime import date atual = date.today().year idade = atual - ano if idade < 16: return f'Com {idade} anos: Não vota.' elif 16 >= idade <18 or idade >65: return f'Com {idade}: Voto ...
StarcoderdataPython
4836031
import threading,time from ..sensors.sonar import Sonar from ..sensors.wheels import WheelsSensor from ..sensors.temperatures import Temperatures from ..sensors.laser import Laser from ..sensors.head_touch import Head_touch from ..sensors.hand_touch import Left_hand_touch from ..sensors.hand_touch import Right_hand_tou...
StarcoderdataPython
4826025
<filename>run_parser.py import logging import os import json from datetime import datetime from concurrent.futures.thread import ThreadPoolExecutor import riotwatcher try: lol_watcher = riotwatcher.LolWatcher(os.environ["RIOT_API_KEY"]) except KeyError: logging.error("'RIOT_API_KEY' environment v...
StarcoderdataPython
1780773
<reponame>j1c/graspologic<filename>graspologic/simulations/__init__.py # Copyright (c) Microsoft Corporation and contributors. # Licensed under the MIT License. from .simulations import er_nm, er_np, mmsbm, p_from_latent, rdpg, sample_edges, sbm from .simulations_corr import er_corr, sample_edges_corr, sbm_corr from ...
StarcoderdataPython
1600212
from kombu import Queue from transport.rabbitmq import exchanges ASK_EXCHANGE = exchanges.get('ask') LOG_EXCHANGE = exchanges.get('log') MAIN_EXCHANGE = exchanges.get('internal') # reply to pong pong_queue = Queue('pong', durable=False, exchange=ASK_EXCHANGE, ...
StarcoderdataPython
1667996
""" Copyright 2018 EPAM Systems, 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...
StarcoderdataPython
4838481
<filename>02/main.py import re with open("input.txt","r") as f: input_data = f.readlines() input_data = list(map(lambda row: list(filter(lambda x: x!="",re.split(r"[^\d^\w]",row))), input_data)) print(input_data[0]) valid = 0 for [mini,maxi,parameter,password] in input_data: if (password[int(mini)-1] == pa...
StarcoderdataPython
1692082
<gh_stars>1000+ # Copyright (C) 2018-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 from openvino.tools.mo.ops.scatter import ScatterElementsUpdate from openvino.tools.mo.ops.scatternd import ScatterNDUpdate from openvino.tools.mo.front.extractor import FrontExtractorOp from openvino.tools.mo.front.onnx....
StarcoderdataPython
3345820
import os import kaggle kaggle.api.authenticate() comp = 'digit-recognizer' files = ['train.csv', 'test.csv'] path = './data' for file in files: if not os.path.exists(os.path.join(path, file)): kaggle.api.competition_download_file(competition=comp, file_name=file, path=path)
StarcoderdataPython
1727395
<gh_stars>0 # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations def register_to_rockit(apps, schema_editor): Association = apps.get_model("core", "Association") association = Association() association.name = "Rockit" association.descrip...
StarcoderdataPython
125111
# -*- coding: utf-8 -*- from __future__ import division, print_function __all__ = ["Parameter", "UnitVector", "Model"] import numpy as np import tensorflow as tf def get_param_for_value(value, min_value, max_value): if ((min_value is not None and np.any(value <= min_value)) or (max_value is not Non...
StarcoderdataPython
1775441
<reponame>wudenggang/mindspore # Copyright 2020 Huawei Technologies Co., Ltd # # 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
3217434
import setuptools setuptools.setup( name="myutils", version="0.0.1", author="<NAME>", author_email="<EMAIL>", description="A collection of my personal utility functions.", url="https://github.com/rjgpacheco/my_utils", packages=setuptools.find_packages(), python_requires='>=3.7', )
StarcoderdataPython
18242
<filename>nnutils/laplacian_loss.py # -------------------------------------------------------- # Written by <NAME> (https://github.com/JudyYe) # -------------------------------------------------------- from __future__ import print_function from __future__ import absolute_import from __future__ import division # Copyrig...
StarcoderdataPython
3210711
# Use this file to run some Python code adhoc
StarcoderdataPython
3394596
<reponame>settipalli/goodtime-alfred-workflow # encoding: utf-8 """app.py [<date>] Fetch and compute details of time slots in a day that are considered auspicious as per the Hindu Astrology. Usage: app.py [<date>]... app.py (-h|--help) Options: [<date>]... Date in yyyy-mmm-dd format -h, --help ...
StarcoderdataPython
44754
from _testcapi import instancemethod from .ParentView import View from typing import TYPE_CHECKING if TYPE_CHECKING: from ..Server import Server class Logging(View): def __init__(self, server: 'Server'): super().__init__(name=self.__class__.__name__, server=server)
StarcoderdataPython
20189
<reponame>1mplex/segmentation_image_augmentation<filename>utils/pack_images.py import copy import math import numpy as np # import rpack from rectpack import newPacker from rectpack.maxrects import MaxRectsBssf def _change_dim_order(sizes): return [[s[1], s[0]] for s in sizes] # def get_pack_coords(sizes): # ...
StarcoderdataPython
3345988
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
StarcoderdataPython
18786
from Level.Render import Render from Level.Data import Data from Constants import * import os class Level: def __init__(self, folder, main): self.main = main self.name = folder self.folder = LEVEL_PATH + "/" + folder self.dataFiles = [] files = os.listdir(self.folder) ...
StarcoderdataPython
3338154
import numpy as np import keras from neuralparticles.tools.plot_helpers import plot_particles import os os.environ["CUDA_VISIBLE_DEVICES"] = "" data_cnt = 10000 train_cnt = int(data_cnt * 0.9) np.random.seed(10) data = np.random.random((data_cnt,1,4))-0.5 data[:,0,:2] *= 0 data = np.repeat(data, 3, axis=1) for t in...
StarcoderdataPython
39328
"""create pipeline_retries table Revision ID: d04cf726555d Revises: <PASSWORD> Create Date: 2021-09-02 13:04:36.053768 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'd04cf726555d' down_revision = '<PASSWORD>' branch_labels = None depends_on = None def upgra...
StarcoderdataPython
3321749
import logging from termcolor import colored from .config import get_config _valid_levels = { 'DEBUG': logging.DEBUG, 'INFO': logging.INFO, 'WARN': logging.WARN, 'ERROR': logging.ERROR, } def reload(): _log_level = get_config('log_level', 'INFO') if _log_level not in _valid_levels: ...
StarcoderdataPython
74192
<reponame>MuAuan/llightning-pytorch import numpy as np import torch import torchvision from torch.utils.data import DataLoader, random_split from torchvision import transforms import cv2 import matplotlib.pyplot as plt import glob import os from PIL import Image ts = transforms.ToPILImage() ts2 = transforms.ToTensor...
StarcoderdataPython
3295983
from ursina import * from ursina.prefabs.dropdown_menu import DropdownMenu from controls import LocalController from game_modes import OneVOne, OneVSAI from model.qubic import Qubic from composite import Composite from ui.general_ui import QubicButton from ui.menu.online import OnlineMenu from ui.qubic.vue_qubic impor...
StarcoderdataPython
1786430
<filename>sprint/tools_zf/random_select.py import random def random_select(file_in_dir=0,file_out_dir=0,ratio=1): fi=open(file_in_dir) fo=open(file_out_dir,'w') for line in fi: if random.random()<=ratio: fo.write(line) fi.close() fo.close()
StarcoderdataPython
3361630
<filename>src/scripts/login.py driver.fill("#userId-input", "Jordan19M") driver.fill("#password", <PASSWORD>?") sleep(1) driver.click("#fs-login-button")
StarcoderdataPython
1694405
<reponame>dscarmo/quickNAT_pytorch """ Contains commong functions useful throughout the application """ import os def create_if_not(path): """ Creates a folder at the given path if one doesnt exist before === :param path: destination to check for existense :return: None """ if not os.path...
StarcoderdataPython
3249205
<gh_stars>10-100 from pydantic import BaseModel class UserInfo(BaseModel): pass
StarcoderdataPython
3311398
<filename>src/test/basicTests.py<gh_stars>10-100 #from model.conversation import Conversation import argparse import logging import os import sys import numpy as np from matplotlib import pyplot as plt from scipy.stats.stats import pearsonr from model.conversationDataframe import ConversationDataframe from util impor...
StarcoderdataPython
1734375
from django.contrib.auth.mixins import LoginRequiredMixin from django.http import Http404, HttpResponseRedirect from django.shortcuts import render from django.views.generic import CreateView, DetailView from django.contrib import messages from job.models import Job, Resume from django.contrib.auth.models import Group ...
StarcoderdataPython
1769098
<gh_stars>1-10 from flask import session from wtforms import Form, StringField, SelectField, BooleanField, SelectMultipleField from wtforms.csrf.session import SessionCSRF from wtforms.validators import input_required, length from wtforms.widgets import CheckboxInput, ListWidget def init_app(app): BaseForm.Meta.c...
StarcoderdataPython
1667552
import warnings import random from collections import OrderedDict class InkPrinter: def __init__(self, paper_color='b', ink_color='g'): # Available colors. # When initiating an instance, both full color name and the one-letter name will work. self.colors_to_use = OrderedDict({ ...
StarcoderdataPython
54921
# Copyright (C) 2022 National Center for Atmospheric Research and National Oceanic and Atmospheric Administration # SPDX-License-Identifier: Apache-2.0 # import numpy as np from pandas.api.types import is_float_dtype def write_ncf(dset, output_name, title=''): """Function to write netcdf4 files with some compress...
StarcoderdataPython
20026
<filename>fun.py #def add(num,num1): # add1=num+num1 # print add1 #add(6,7) #def welcome(): # print "python kaisa lagta h aapko" # print "but please reply na kare aap" #welcome() user = int(raw_input("enter a number")) i = 0 new = [] while i < (user): user1 = int(raw_input("enter a number")) new.append(user1) i =...
StarcoderdataPython
14056
# -*- coding: utf-8 -*- # Copyright © 2018 PyHelp Project Contributors # https://github.com/jnsebgosselin/pyhelp # # This file is part of PyHelp. # Licensed under the terms of the GNU General Public License. # ---- Standard Library Imports import os import os.path as osp # ---- Third Party imports import numpy as ...
StarcoderdataPython
1753161
<reponame>nick6655/management-sdk-python # -*- coding: utf-8 -*- # Copyright 2021 Cohesity Inc. class ReplicationStrategyEnum(object): """Implementation of the 'ReplicationStrategy' enum. Replication stragegy for the keyspace. Specifies the type of an Cassandra source entity. Attributes: KSI...
StarcoderdataPython
1636947
import numpy as np import pandas as pd from statsmodels.regression.lme import MixedLM from numpy.testing import assert_almost_equal from . import lme_r_results from scipy.misc import derivative from statsmodels.base import _penalties as penalties import os import csv class R_Results(object): """ A class for h...
StarcoderdataPython
173400
<gh_stars>1-10 import time import unittest from robot import PinMode from robot.robot import Robot from tests.mock_robotd import MockRobotDFactoryMixin class GPIOTest(MockRobotDFactoryMixin, unittest.TestCase): def setUp(self): mock = self.create_mock_robotd() mock.new_powerboard() time.s...
StarcoderdataPython
3339419
<gh_stars>0 # -*- coding: utf-8 -*- # Generated by Django 1.9.9 on 2016-08-18 23:25 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('climate_data', '0006_auto_20160816_1429'), ] operations = [ migr...
StarcoderdataPython
3272672
<reponame>andrew-cybsafe/django-db-views<gh_stars>10-100 from django.db.migrations import operations class ViewRunPython(operations.RunPython): pass
StarcoderdataPython
1654475
<reponame>joshduf/DisinformationNetworks # These functions take tweets in a csv format and organize them # for processing by a deep learning framework import csv import numpy as np import random import re # Non-ASCII values are ignored to ensure the model doesn't # use artifacts from the encoding process to class...
StarcoderdataPython
33282
<reponame>HsinYiHung/HARK_HY # %% ''' Example implementations of HARK.ConsumptionSaving.ConsPortfolioModel ''' from HARK.ConsumptionSaving.ConsPortfolioModel import PortfolioConsumerType, init_portfolio from HARK.ConsumptionSaving.ConsIndShockModel import init_lifecycle from HARK.utilities import plotFuncs from copy im...
StarcoderdataPython
3362368
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Model for a group of alerts.""" import logging from google.appengine.ext import ndb from dashboard import quick_logger from dashboard.common import uti...
StarcoderdataPython
20011
import os import cv2 import numpy as np import matplotlib.pyplot as plt import scipy ROWS = 64 COLS = 64 CHANNELS = 3 TRAIN_DIR = 'Train_data/' TEST_DIR = 'Test_data/' train_images = [TRAIN_DIR+i for i in os.listdir(TRAIN_DIR)] test_images = [TEST_DIR+i for i in os.listdir(TEST_DIR)] def read_image(file_path): ...
StarcoderdataPython
1746022
from MA import * import math import time import dwgsim from bokeh.plotting import figure, show, reset_output from bokeh.palettes import Category20, Category10 from bokeh.io import export_png, export_svgs import os from bokeh_style_helper import * from config import * from runBackwardMEMOhlebusch import * str_mm = str(...
StarcoderdataPython
3291143
import baseObject import config import synthDriverHandler import queueHandler from autoSettingsUtils.driverSetting import BooleanDriverSetting, NumericDriverSetting class SynthSetting(baseObject.AutoPropertyObject): """a numeric synth setting. Has functions to set, get, increase and decrease its value """ def __ini...
StarcoderdataPython
59176
from hashlib import blake2s def hash(x): return blake2s(x).digest()[:32] def get_primes(givenNumber): # Initialize a list primes = [] for possiblePrime in range(2, givenNumber + 1): # Assume number is prime until shown it is not. isPrime = True for num in range(2, int(possibleP...
StarcoderdataPython
77362
"""The classic exhibitor of chaos, consisting of 3 coupled ODEs. The ODEs are derived by modelling, with many simplifications, the fluid convection between horizontal plates with different temperatures. Its phase-plot (with typical param settings) looks like a butterfly. See demo.py for more info. """ import numpy...
StarcoderdataPython
3372907
import numpy as np from scipy.ndimage import affine_transform try: from numba import njit as jit except: jit = None # jit = None def affine_jit(img, m, offset, output_shape=0, output=0, order=0, prefilter=0): kr=m[0]; kc=m[1]; ofr=offset[0]; ofc=offset[1]; for r in range(output_shape[0]): for c in rang...
StarcoderdataPython
4823065
<reponame>EdmundoSanchezM/ADOM-F def CuentaM (id): Cuentas = dict() if(int(id)==0): Cuentas = {0:'Almacen',1:'Ventas',2:'Costo de ventas'} else: Cuentas = {0:"Inventario",1:"Compras",2:"Gasto de Compra",3:"Devoluciones sobre compra",4:"Rebajas sobre compra", 5:"Ventas",6:"Devolucione...
StarcoderdataPython
1733458
#!/usr/bin/env python from systemofrecord.server import app app.run(host="0.0.0.0", port=8003, debug=True, processes=3)
StarcoderdataPython
1709656
<reponame>hyperplan-io/cli from hyperplan.api import Api from hyperplan.features_descriptors import * from hyperplan.labels_descriptors import * from hyperplan.project import * from hyperplan.predict import * class TestWorkingApi: def setUp(self): self.api = Api("test_service", "http://localhost:8080", "a...
StarcoderdataPython
95237
from random import randrange import re def test_phones_on_home_page(app): list_of_contacts_from_home_page = app.contact.get_contact_list() index = randrange(len(list_of_contacts_from_home_page)) contact_from_home_page = list_of_contacts_from_home_page[index] contact_from_edit_page = app.contact.get_con...
StarcoderdataPython
4812966
<reponame>ICT4H/dcs-web<filename>datawinners/home/urls.py # vim: ai ts=4 sts=4 et sw=4 encoding=utf-8 from datawinners.accountmanagement.forms import LoginForm from datawinners.accountmanagement.views import custom_login from django.conf.urls.defaults import patterns, url from datawinners.home.views import index, switc...
StarcoderdataPython