id
stringlengths
1
265
text
stringlengths
6
5.19M
dataset_id
stringclasses
7 values
132491
<reponame>shlomihod/smartnoise-sdk-synth<gh_stars>10-100 from functools import wraps import numpy as np import pandas as pd import warnings from snsynth.preprocessors.preprocessing import GeneralTransformer from snsynth.base import SDGYMBaseSynthesizer class PytorchDPSynthesizer(SDGYMBaseSynthesizer): def __ini...
StarcoderdataPython
185415
import numpy as np from numpy import inf import time import random def GS_static(graph, eps, alpha, seed, method ) : # initial distribution N = graph.A.shape[0] y = np.zeros([N,1]); y[seed,0] = 1; # extract operator and coefficients if method == 'PageRank': rho = (1-alpha) psi = alpha; OP = graph.P.T g...
StarcoderdataPython
3231756
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE file in the project root for full license information. from MiniFramework.EnumDef_5_0 import * # this class is for two-layer NN only class HyperParameters_4_2(object): def __init__(self, eta=0.1, max_epoch=10000, batch_s...
StarcoderdataPython
1789023
<filename>GUnicornConfig.py import logging import sys from GServerHooks import ServerHooks from gunicorn import glogging from pythonjsonlogger import jsonlogger class CustomLogger(glogging.Logger): """Custom logger for Gunicorn log messages.""" def _set_handler(self, log, output, fmt, stream=None): ...
StarcoderdataPython
1735237
number = 6 target1 = str('{0}{1}.{1}'.format(number, (number) % 6 + 1)) target2 = str('{1}{0}.{1}'.format(number, (number - 2) % 6 + 1)) print('en\nconf t') print( f"int f0/0\n\ ip address 172.16.{number}.2 255.255.255.0\n\ no shutdown\n\ int s2/0\n\ ip address 172.16.{target1.split('.')[0]}.{number} 255.255.255.0\n\...
StarcoderdataPython
1667663
<filename>algorithm_comparison/grover_algorithm.py import math import matplotlib.pyplot as plt def GroverSteps(n): steps = math.pi * math.sqrt(2 ** n) / 4 return steps def GroverStepsMultiple(n, k): steps = math.pi * math.sqrt((2 ** n) / k) / 4 return steps if __name__ == '__main__': steps...
StarcoderdataPython
3275503
# Mês para número # Crie um programa que pergunta o nome do mês e imprime o número do mês (use os nomes dos meses com letra minúscula). month = input("month? ") months = ["janeiro", "fevereiro", "março", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro", ] num = months.index(...
StarcoderdataPython
17842
# Copyright (c) 2012-2020, <NAME> <<EMAIL>> # All rights reserved. # # See LICENSE file for full license. # # *** Do not modify - this file is autogenerated *** # Resource specification version: 18.6.0 from . import AWSObject from . import AWSProperty from . import Tags from .validators import boolean from .validator...
StarcoderdataPython
3324702
<filename>infrastructure/constructs/batch_submit_job_task.py<gh_stars>10-100 from typing import List, Mapping, Optional from aws_cdk import aws_batch, aws_iam, aws_stepfunctions, aws_stepfunctions_tasks from aws_cdk.core import Construct from .common import LOG_LEVEL from .task_job_definition import TaskJobDefinition...
StarcoderdataPython
3396624
""" Query and deal common tables. """ from __future__ import print_function from evennia.utils import logger from django.apps import apps from django.conf import settings class DialogueSentencesMapper(object): """ NPC's dialogue sentences. """ def __init__(self): self.model_name = "dialogue_...
StarcoderdataPython
1700874
# Copyright (c) 2019, CRS4 # # 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, copy, modify, merge, publish, distribu...
StarcoderdataPython
86240
import pandas as pd import matplotlib.pyplot as plt import numpy as np from .plot_error import calculate_error_area from .distance import distance # Trajectory def plot_trajectory(df, vmr, blockN, trial_vars, axs, colors): # Plot aspect for ax in axs[0]: ax.axis('equal') ax.set_box_aspect(1) ...
StarcoderdataPython
1657109
from pid import PID from lowpass import LowPassFilter from yaw_controller import YawController import rospy GAS_DENSITY = 2.858 MIN_SPEED = 0.1 class Controller(object): def __init__(self, vehicle_mass, fuel_capacity, brake_deadband, decel_limit, accel_limit, wheel_radius, wheel_base, steer_ratio, ma...
StarcoderdataPython
51911
<gh_stars>1-10 from functools import partial import argparse import os.path as osp import sys sys.path.append(osp.dirname(osp.dirname(osp.dirname(osp.abspath(__file__))))) from arena import Arena, Wrapper #from examples.rl_ppo.utils.mpi_tools import mpi_fork, mpi_avg, proc_id, mpi_statistics_scalar, num_procs from exa...
StarcoderdataPython
3308656
import pickle import os import numpy as np import argparse from matplotlib import pyplot as plt import matplotlib import glob import pandas as pd from tqdm import tqdm parser = argparse.ArgumentParser(description='save annotations') parser.add_argument('--vis', action='store_true', default=False, h...
StarcoderdataPython
3313694
<reponame>nonstorio/nosenstory<filename>core/models/NSHome.py<gh_stars>0 from . import Model, NSApp from peewee import ForeignKeyField, BigIntegerField, CharField, FixedCharField class NSHome(Model): app = ForeignKeyField(NSApp, backref = 'homes') id_int = BigIntegerField(null = True) id_str = CharField(nu...
StarcoderdataPython
155458
import pathlib import sys import unittest from OpenApiLibCore import ( Dto, IdDependency, IdReference, PathPropertiesConstraint, PropertyValueConstraint, UniquePropertyValueConstraint, dto_utils, ) unittest_folder = pathlib.Path(__file__).parent.resolve() mappings_path = unittest_folder.pa...
StarcoderdataPython
3285751
from typing import Tuple from logging import Logger import os from aiohttp import ClientSession, ClientError from pydantic import ValidationError from telegram_avatar.config import WEATHER_ICONS_FOLDER_NAME from telegram_avatar.data_classes import WeatherData, OpenWeatherMap from telegram_avatar.exceptions import ( ...
StarcoderdataPython
1772500
from django.contrib.auth.mixins import LoginRequiredMixin from django.db.models import Q from django.views.generic import CreateView, ListView from django.urls import reverse_lazy from transactions.models import Wallet, Transaction from .forms import UserRegisterForm class SignUp(CreateView): form_class = UserRe...
StarcoderdataPython
1773730
numeros = list() while True: continuar = ' ' add = int(input('Digite um número: ')) if add not in numeros: numeros.append(add) print('\033[1:32mNúmero adicionado com sucesso!\033[m') elif add in numeros: print('\033[1:31mO número não foi adicionado, pois já existe!\033[m') wh...
StarcoderdataPython
3397374
<reponame>macaodha/rel_3d_pose<gh_stars>10-100 import matplotlib.pyplot as plt import numpy as np def print_histogram_of_errors_with_cumsum(rel_loss_errs, sup_loss_errs): # https://matplotlib.org/gallery/ticks_and_spines/multiple_yaxis_with_spines.html frame_errs_rel = rel_loss_errs.mean(axis=1) / 10....
StarcoderdataPython
161349
import sys import pathlib import unittest import yaml from net_models.models.BaseModels import BaseNetModel, VendorIndependentBaseModel from net_models.utils import get_logger class TestBaseNetModel(unittest.TestCase): LOGGER = get_logger(name="NetCm-Tests", verbosity=5) TEST_CLASS = BaseNetModel def tes...
StarcoderdataPython
1706874
from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import * import sys ''' Ilk ders icin cok fazla bir karmasa yaratmayalim. Asagidaki kodu kopyalayin ve uygulamayi calistirin! Biraz incelemeye calisin ve olabildigince anlamaya calisin. Tek tek elemanlari inceleyecegiz siradaki derslerde. ''' ...
StarcoderdataPython
4817194
#!/usr/bin/env python3 """=============================================================================== FILE: money.py USAGE: ./money.py DESCRIPTION: OPTIONS: --- REQUIREMENTS: --- BUGS: --- NOTES: --- AUTHOR: <NAME> (<EMAIL>) ORGANIZATION: VERSION: --- CREATE...
StarcoderdataPython
12174
<reponame>blowekamp/polus-plugins<gh_stars>0 from bfio import BioReader import argparse, logging import numpy as np from pathlib import Path import filepattern, multiprocessing, utils from concurrent.futures import ThreadPoolExecutor COLORS = ['red', 'green', 'blue', 'yellow', '...
StarcoderdataPython
1729191
<reponame>skbu3u/core import pytest from fastapi.testclient import TestClient from main import app from src.database.models import ConsumableModel from tests.conftest import temp_database, drop_temp_database, user_authorization client = TestClient(app) def test_init_consumable(): consumable = ConsumableModel(na...
StarcoderdataPython
3289713
import sys input = sys.stdin.readline # input height, width = map(int, input().split()) rectangle = [input().rstrip() for _ in range(height)] # process ''' max(N)=max(M)=50이므로 O(NM^2) 완전탐색 알고리즘 사용 가능. 각 가로줄에서 두 개의 숫자를 고른다. 이걸로 조건을 만족하는 정사각형을 만들 수 있는지 확인한다. 이 때 윗단계에서 고른 두 숫자가 정사각형의 윗변이 됨. 아래 줄로 내려가서 반복. ''' square = 1...
StarcoderdataPython
1612764
<reponame>code4sac/ckan<gh_stars>10-100 import datetime from nose.tools import assert_equal from ckan.tests import * import ckan.model as model # NB Lots of revision tests are part of vdm. No need to repeat those here. class TestRevision: @classmethod def setup_class(cls): # Create a test package ...
StarcoderdataPython
4813259
from django.conf import settings from django.core.mail import EmailMultiAlternatives from django.template.loader import render_to_string from django.template import engines import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart class Email(object): """ A wrapper aroun...
StarcoderdataPython
1663303
import unittest from abp.configs import EvaluationConfig import os file_path = os.path.dirname(os.path.abspath(__file__)) filename = "assets/evaluation.yml" test_file = os.path.join(file_path, filename) class EvaluationConfigTests(unittest.TestCase): """Unit tests for config objects""" def test_should_creat...
StarcoderdataPython
1776414
import argparse import sys # import numpy as np # from mpl_toolkits import mplot3d import numpy as np import matplotlib.pyplot as plt from tqdm import tqdm import numpy as np import matplotlib.pyplot as plt import sympy from sympy import * import sys sys.path.append(r'C:\Users\elira\Google Drive\butools2\Py...
StarcoderdataPython
171065
from src.App import App from src.Planet import Planet from src.vecN import Vec3 def main(): # 8 loop # pos = 10 * Vec3(-0.97000436, 0.24308753) # vel2 = 10 * Vec3(-0.93240737, -0.86473146) # vel13 = 10 * Vec3(0.4662036850, 0.4323657300) # planets = [ # Planet(1000, pos, vel13, (200, 20, ...
StarcoderdataPython
1705518
<filename>maliciousSite/newApp.py import os from flask import Flask, session, render_template, url_for, escape, request, redirect app = Flask(__name__) @app.route('/cookiejar') def cookiejar(): cookie = request.args.get('c') if cookie: print cookie os.system('echo ' + cookie + ' >> static/cookies.txt') return ...
StarcoderdataPython
1720089
<gh_stars>0 from spotipy_twisted.oauth2 import SpotifyClientCredentials import spotipy_twisted import pprint client_credentials_manager = SpotifyClientCredentials() sp = spotipy_twisted.Spotify(client_credentials_manager=client_credentials_manager) search_str = 'Muse' result = sp.search(search_str) pprint.pprint(resu...
StarcoderdataPython
1623583
import unittest import time from datetime import datetime, timedelta from unittest.mock import patch from mongoengine import connect, disconnect from spaceone.core.unittest.result import print_data from spaceone.core.unittest.runner import RichTestRunner from spaceone.core import config from spaceone.core import utils...
StarcoderdataPython
1618144
from __future__ import print_function, division, absolute_import import os import time import subprocess from contextlib import contextmanager import pytest import skein @pytest.fixture(scope="session") def security(tmpdir_factory): return skein.Security.from_new_directory(str(tmpdir_factory.mktemp('security')...
StarcoderdataPython
1678348
# Simple M5 script for use with Barrelfish. This creates a very # basic machine with a set of CPUs connected directly to the # simulated memory. # # (See configs/example/* in the M5 distribution for examples of # fuller scripts -- caches, etc.). # Determine script pathname import inspect, os import optparse import...
StarcoderdataPython
1740094
<gh_stars>0 from .metromobilite import Metromobilite
StarcoderdataPython
3278697
"""A function for finding matching tokens in two lists""" def match(source, target): """Returns matching tokens from two lists of words Parameters ---------- source : [str] A list of tokens from the source text target : [str] A list of tokens from the target text, to be compared ...
StarcoderdataPython
3269931
"""Art creation utilities.""" from __future__ import annotations # stdlib from typing import Any, Dict, Tuple, Optional, List, Union import logging # external import matplotlib matplotlib.use("pdf") import matplotlib.pyplot as plt import numpy as np import pandas as pd # tdub import tdub.config import tdub.hist im...
StarcoderdataPython
31616
# Originally auto-generated on 2021-02-15-12:14:36 -0500 EST # By '--verbose --verbose x7.lib.shell_tools' from unittest import TestCase from x7.lib.annotations import tests from x7.testing.support import Capture from x7.lib import shell_tools from x7.lib.shell_tools_load import ShellTool @tests(shell_tools) class T...
StarcoderdataPython
97038
<reponame>AndreaLombardo90/SDN-Controller import inspect import os import atexit from mininet.net import Mininet from mininet.util import dumpNodeConnections from mininet.log import setLogLevel, info from mininet.cli import CLI from mininet.topo import Topo from mininet.link import TCLink from mininet.topo import Singl...
StarcoderdataPython
82466
<reponame>rongliang-tech/alpha-mind # -*- coding: utf-8 -*- """ Created on 2017-4-25 @author: cheng.li """ import numba as nb import numpy as np from alphamind.utilities import aggregate from alphamind.utilities import array_index from alphamind.utilities import group_mapping from alphamind.utilities import simple_m...
StarcoderdataPython
1648313
<filename>src/model/siren.py from torch import nn import torch import numpy as np class SirenLayer(nn.Module): def __init__(self, in_f, out_f, w0=30, is_first=False, is_last=False): super().__init__() self.in_f = in_f self.w0 = w0 self.linear = nn.Linear(in_f, out_f) self.is...
StarcoderdataPython
3209371
<filename>paystackapi/transfer_recipient.py class TransferRecipient: def __init__(self, req): self.req = req async def create(self, **kwargs): """ :param kwargs: :return: """ endpoint = "transferrecipient" return await self.req.post(endpoint=endpoint, ...
StarcoderdataPython
3209645
<filename>layout-management/Geometry_Pack_Relative Position.py import tkinter as tk main_win = tk.Tk() main_win.geometry('1000x200') btn_west = tk.Button(main_win, text="West", width=15) # Привязка в левой стороне окна: btn_west.pack(side='left', ipadx=20, # внутренний отступ (inner padding) в px. ...
StarcoderdataPython
3207400
<reponame>MartinThoma/stellar-model from unittest import TestCase from stellar_model import EffectsResponse from stellar_model.model.horizon.effects import BaseEffect from tests.response import load_response_file class TestEffectsResponse(TestCase): def test_valid(self): raw_data = load_response_file("ef...
StarcoderdataPython
1672143
# -*- coding: utf-8 -*- """DepthDependentTaylorNonLinearDiffuser Component. @author: <NAME> @author: <NAME> @author: <NAME> """ import numpy as np from landlab import Component, LinkStatus from landlab.core.messages import deprecation_message class DepthDependentTaylorDiffuser(Component): r""" This compon...
StarcoderdataPython
171064
import math from maya import OpenMaya, OpenMayaMPx class Circler(OpenMayaMPx.MPxNode): #(1) def compute(self, *args): pass def create(): #(2) return OpenMayaMPx.asMPxPtr(Circler()) def init(): #(3) return nodeName = 'circler' #(4) nodeTypeID = OpenMaya.MTypeId(0x60005) #(5) def _toplugin(mobjec...
StarcoderdataPython
115178
<filename>bench2_charm.py from charm4py import charm, Chare, Group, Future, Reducer from collections import defaultdict import numpy as np import time num_trials = 5 # this is not strictly necessary but makes it more scalable def myreducer(contribs): result = set() for c in contribs: result |= c ...
StarcoderdataPython
3248071
import numpy as np import cv2 image_list = [] for i in range(198,203): num = i print(i) org_image = cv2.imread('./../OCT_image/1026_with_glass_bead_before_irradiation/Filename_%04d.png'%(num), cv2.IMREAD_GRAYSCALE)[::2,::2] image = np.array(org_image) cv2.imshow('org_image', image) # cv2.wai...
StarcoderdataPython
1607284
<gh_stars>0 import random import re from discord.ext.commands import Bot from discord.message import Message from src.body.CogSkeleton import CogSkeleton class ChiiTFTCog(CogSkeleton): GIF_LINKS = [ 'https://c.tenor.com/dw6MV3mJADsAAAAC/hop-on-tft.gif', 'https://c.tenor.com/-0XzArRAmAYAAAAd/powd...
StarcoderdataPython
1650774
<reponame>smiledra/sparse-vqvae<gh_stars>10-100 # Copyright (c) <NAME> # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # Borrowed from https://github.com/neocxi/pixelsnail-public and ported it to PyTorch # from math import sqrt # from funct...
StarcoderdataPython
3270491
<reponame>zzk0/oneflow-backend import numpy as np import tritonclient.http as httpclient if __name__ == '__main__': triton_client = httpclient.InferenceServerClient(url='127.0.0.1:8000') inputs = [] inputs.append(httpclient.InferInput('INPUT0', [1, 10], "FP32")) input_data0 = np.random.randn(1, 10).a...
StarcoderdataPython
139494
<gh_stars>1-10 """Useful wrappers and other tools.""" import re from collections import namedtuple from ...utils import parse_qsd as parse_query, parse_json, parse_xml __all__ = ["parse_json", "parse_xml", "parse_query"] tag_re = re.compile('''(?=<(?P<tag>[a-zA-Z]+)(?P<attr>.*?)(?P<end>/)?>(?:(?P<inner>.*?)</\s*(?P...
StarcoderdataPython
3399111
def latest(scores): return scores[-1] def personal_best(scores): return max(scores) def personal_top_three(scores): sorted_scores = sorted(scores, reverse=True) return sorted_scores[0:3]
StarcoderdataPython
167210
# Given a binary tree, find a minimum path sum from root to a leaf. # For example, the minimum path in this tree is [10, 5, 1, -1], which has sum 15. # 10 # / \ # 5 5 # \ \ # 2 1 # / # -1 class Node: def __init__(self, value, left=None, right=None): self.value ...
StarcoderdataPython
3372457
<filename>src/distributed_train/laikago_stand_server.py import os,inspect,argparse, datetime, copy, itertools, time currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(os.path.dirname(currentdir)) os.sys.path.insert(0, parentdir) os.sys.path.insert(0, os.pa...
StarcoderdataPython
86808
<reponame>manuelmuehlig/ToolBOSCore<filename>test/MakeShellfiles/ToolBOSCore-pkgInfo.py<gh_stars>0 # -*- coding: utf-8 -*- # # Custom package settings # # Copyright (C) # Honda Research Institute Europe GmbH # Carl-Legien-Str. 30 # 63073 Offenbach/Main # Germany # # UNPUBLISHED PROPRIETARY MATERIAL. # ALL RIGHT...
StarcoderdataPython
3271613
# # Convert integer to list of bits using stdlib # Used a lot in CodinGame Clash of Code # i = 55 # Integer n_bits = 8 # Number of bits # Binary number starting from LSB (0, ..., 128) i_bin = [(i >> d) & 1 for d in range(n_bits)] print(i_bin) # # Remove MSB (first bit) from number # a = 500 # Number of bits : a.b...
StarcoderdataPython
3383589
""" Application configuration logic. """ import json import os from pathlib import Path config_file = f'{os.environ["HOME"]}/.config/netbench/config.json' class Config(): """App configuration.""" def __init__(self, **kwargs): self.__dict__.update(kwargs) def update(self, key: str, value: str):...
StarcoderdataPython
1627820
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities fro...
StarcoderdataPython
1640299
<gh_stars>1-10 # http://www.prologin.org/training/challenge/demi2014/rearrangement from sys import stdin nbElements = int(stdin.readline()) firstList = [int(x) for x in stdin.readline().split()] secondList = [int(x) for x in stdin.readline().split()] firstList.sort() secondList.sort() if firstList == secondList: pr...
StarcoderdataPython
1647737
# Copyright 2020 The Trieste Contributors # # 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
40889
#!/usr/bin/python #sitekey: 6Lcm qwIT AAAA AD_8 PDdc M-9A hyft RNtF Xn1U 5e_8 import json, random, requests def decrypt_1(cyphertext): plaintext = '' for letter in cyphertext: letter = chr(ord(letter) - 1) plaintext += letter return plaintext url = decrypt_1('iuuqt;00psefs/epnjopt/dpn0qpxfs0hjgudbse.cbmbodf') ...
StarcoderdataPython
3254066
import Bio.PDB.Residue from rosettautil.util import fileutil class sasa_point: def __init__(self,resname, chain,resnum, type,absolute,relative): self.resname = resname self.resnum = resnum self.chain = chain self.type = type self.absolute = absolute self.relative = r...
StarcoderdataPython
3324451
from pathlib import Path from PyQt5.QtCore import QSettings from inselect.lib.utils import debug_print class RecentDocuments(object): KEY = 'recent_documents' MAX_RECENT_DOCS = 5 def read_paths(self): """Returns a list of up to MAX_RECENT_DOCS Paths. The most recently opened path is th...
StarcoderdataPython
142200
<filename>install/install.py import subprocess subprocess.call("curl https://bootstrap.pypa.io/get-pip.py | python",shell=True) subprocess.call("pip install tqdm",shell=True) print('[+] All packages successfully installed')
StarcoderdataPython
37333
<filename>pm.py #!/usr/bin/env python3 """ ------------------------------------------------------------------------ A re-write of my original pm shell script in python pm is a script that is meant to act as a status tracker for my projects. It will use VCS integration to provide in-depth information on all proje...
StarcoderdataPython
3302944
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Build windows installer for the exported jar file ''' import os import subprocess import sys from xml.dom import minidom # command for running NSIS makensis COMMAND_NSIS = "makensis" # path to NSIS script SCRIPT_FILE = "create_windows_installer.nsi" # path to pom.x...
StarcoderdataPython
191679
<reponame>ogoodman/icegrid-starter import atexit import sys import Ice import icegrid_config from iceapp import idemo ic = Ice.initialize(sys.argv) atexit.register(ic.destroy) reg_proxy = ic.stringToProxy('IceGrid/Locator:tcp -h %s -p 4061' % icegrid_config.ICE_REG_HOST) registry = Ice.LocatorPrx.uncheckedCast(reg_pr...
StarcoderdataPython
4815443
# # Copyright 2019 Altran. 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 ...
StarcoderdataPython
1639840
# coding: utf-8 # # Copyright 2022 :Barry-Thomas-Paul: Moss # # 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 applicab...
StarcoderdataPython
1642812
<gh_stars>1-10 # -*- coding: utf-8 -*- """ <NAME> Computational Biologist Target Sciences GSK <EMAIL> """ import copy import numpy as np import stats as mlstats import scipy.cluster.hierarchy as hierarchy import scipy.spatial.distance as distance import fastcluster import matplotlib.pyplot as plt class datamatrix(obj...
StarcoderdataPython
1637700
from django.test import TestCase, RequestFactory from django.contrib.auth.models import AnonymousUser, User from rooms.models import Message, Room from rooms.views import * from datetime import datetime, timedelta from django.core.exceptions import PermissionDenied class TestBaseView(TestCase): def setUp(self): ...
StarcoderdataPython
3238770
import copy import os import random import tempfile import zipfile from django.core.files import File as DjFile from contentcuration.api import write_file_to_storage, write_raw_content_to_storage from contentcuration.models import File, generate_file_on_disk_name from le_utils.constants import format_presets, content_k...
StarcoderdataPython
22647
<reponame>sunil28rana/flask-imdb-sample-project<gh_stars>0 from datetime import datetime from sqlalchemy import UniqueConstraint from apis.initialization import db class Movie(db.Model): """ Movie Model for storing movie details""" id = db.Column(db.Integer, primary_key=True, autoincrement=True) ninety...
StarcoderdataPython
1705896
opList = { "+": {'type': 'OP', 'op': 'ADD', 'prec': 1}, "-": {'type': 'OP', 'op': 'SUB', 'prec': 1}, "*": {'type': 'OP', 'op': 'MUL', 'prec': 2}, "/": {'type': 'OP', 'op': 'DIV', 'prec': 2}, "%": {'type': 'OP', 'op': 'MOD', 'prec': 2}, "^": {'type': 'OP', 'op': 'POW', 'prec': 3}, "(": {'type': '('}, ...
StarcoderdataPython
104274
<reponame>alexeiva/google-python-exercises #!/usr/bin/python # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ import os import re import sys import urllib """L...
StarcoderdataPython
62942
from http.server import HTTPServer from http.server import BaseHTTPRequestHandler from .log import Log class HttpServer(BaseHTTPRequestHandler): request_handler_class = None @staticmethod def start(url, port, request_handler_class): HttpServer.request_handler_class = request_handler_class ...
StarcoderdataPython
1609127
""" File: list_manipulation.py Project: analysis Last Modified: 2022-7-2 Created Date: 2022-7-2 Copyright (c) 2021 Author: AHMA project (Univ Rennes, CNRS, Inria, IRISA) """ ################################################################################ import argparse import numpy as np imp...
StarcoderdataPython
114587
<gh_stars>1-10 from django.db import models from easytree.models import BaseEasyTree from easytree.managers import EasyTreeManager from easytree.signals import node_moved from easytree.validators import SingleRootAllowedValidator from django.conf import settings class ExampleNode(BaseEasyTree): title =...
StarcoderdataPython
1783117
<reponame>KurozumiGH/modo-kits-kz-tools # python # -*- coding: utf-8 -*- # http://modo.sdk.thefoundry.co.uk//td-sdk/examples.html # ---------------------------------------------------------------- # Xfrog Plants for MODO を V-RayのGPUレンダリングに対応させる # # 基本的な処理の流れ # 1. Materialの種類をV-Ray Materialに変更 # 2. Stencilの画...
StarcoderdataPython
144882
<reponame>serge-m/jina __copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved." __license__ = "Apache-2.0" import time from collections import defaultdict from functools import wraps from ..helper import colored, get_readable_size, get_readable_time if False: # fix type-hint complain for sphin...
StarcoderdataPython
3399927
<filename>examples/datasets/audio_files/load_librispeech.py # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under th...
StarcoderdataPython
3392022
<filename>tests/test_basics.py from interface import interface class Iterable: def do_loop(self): pass @interface(Iterable) class BusList: def normal_method(self): return 'bus here' def do_loop(self): return 'got it!' class CarList: def normal_method(self): return ...
StarcoderdataPython
4801002
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jul 5 14:28:55 2019 @author: xjc """ import os orig_S1_train_prob_file='/home/xjc/test/ensemble_learning_age_estimation/try_on_morph2/resnet18_version/two_group/S1_train_modified.txt' orig_S1_valid_prob_file='/home/xjc/test/ensemble_learning_age_esti...
StarcoderdataPython
184309
################################################################################ # # model_examples.py # # authors: # <NAME> # ################################################################################ from boole.elaboration.prelude import * from boole.semantics.value import * from boole.elaboration.terms import...
StarcoderdataPython
3253864
import transaction from freezegun import freeze_time from io import BytesIO from onegov.gazette.models import GazetteNotice from onegov.pdf.utils import extract_pdf_info from openpyxl import load_workbook from tests.onegov.gazette.common import login_admin from tests.onegov.gazette.common import login_editor_1 from te...
StarcoderdataPython
3320854
from hitchstory import HitchStoryException, StoryCollection from hitchrun import expected from commandlib import CommandError from strictyaml import Str, Map, Bool, load from pathquery import pathquery from hitchrun import DIR import dirtemplate import hitchpylibrarytoolkit from engine import Engine """ --------------...
StarcoderdataPython
3302349
<gh_stars>1-10 # -*- coding: utf-8 -*- # Copyright (c) 2019-2021 <NAME>. # All rights reserved. # Licensed under BSD-3-Clause-Clear. See LICENSE file for details. from django.contrib import admin from .models import SiteFeedback, SiteTijdelijkeUrl class IsAfgehandeldListFilter(admin.SimpleListFilter): # pra...
StarcoderdataPython
3265066
<reponame>HenryChenV/iJiangNan from rest_framework.decorators import api_view from rest_framework.response import Response from django.http import Http404 from misago.conf import settings @api_view() def question(request): if settings.qa_question: return Response({ 'question': settings.qa_qu...
StarcoderdataPython
3331221
<gh_stars>1-10 """ Lightweight session-based messaging system. Time-stamp: <2009-03-10 19:22:29 carljm __init__.py> """ VERSION = (0, 1, 'pre') def create_message (request, message): """ Create a message in the current session. """ assert hasattr(request, 'session'), "django-session-messages require...
StarcoderdataPython
97243
# python3 # coding=utf-8 # Copyright 2021 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
StarcoderdataPython
1723839
<reponame>noah-ziethen/py-pde<filename>pde/tools/plotting.py ''' Tools for plotting and controlling plot output using context managers .. autosummary:: :nosignatures: add_scaled_colorbar finalize_plot disable_interactive plot_on_axes plot_on_figure PlotReference BasicPlottingContext Jupyter...
StarcoderdataPython
1609099
import json import sys, os # FIXME: Conform to PEP 8 import subprocess import tempfile import cmd import random import requests def autoUpdate(): print("Getting from https://raw.githubusercontent.com/host12prog/ntaterm/master/ntaterm.py") url = 'https://raw.githubusercontent.com/host12prog/ntaterm/m...
StarcoderdataPython
1741878
# Copyright 2015 <NAME>, S.L. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import controllers
StarcoderdataPython
1658201
<filename>Exercise 3 (demo)/arc.py class Arc: def __init__(self, name, n, nextT=None, nextP=None, prevP=None): self.name = name self.nextT = nextT self.nextP = nextP self.prevP = prevP self.n = n
StarcoderdataPython
3311514
<filename>custom_components/hildebrandglow/mqttpayload.py """Helper classes for Zigbee Smart Energy Profile data.""" import json import struct from enum import Enum from typing import Any, Dict, Optional class Meter: """Information received regarding a single smart meter.""" class ReadingInformationSet: ...
StarcoderdataPython
1706469
<gh_stars>0 # coding: utf-8 algos = 'abcdefghijk' codes = [] for algo in algos: codes.append(ord(algo)) codes codes.clear() codes codes = [ord(algo) for algo in algos] codes
StarcoderdataPython