id stringlengths 1 265 | text stringlengths 6 5.19M | dataset_id stringclasses 7
values |
|---|---|---|
31653 | <reponame>pulumi-bot/pulumi-azure-native
# 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! ***
from enum import Enum
__all__ = [
'AlertNotifications',
'AlertsToAdmins',
'DataSource',
'Expo... | StarcoderdataPython |
44978 | from .client_side import OverpassWrapperClientSide
from .server_side import OverpassWrapperServerSide
from .overpass_wrapper import OverpassWrapper
| StarcoderdataPython |
141914 | <reponame>abock/runtime
#!/usr/bin/env python
#
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the MIT license.
# See the LICENSE file in the project root for more information.
#
######################################################################... | StarcoderdataPython |
1620464 | <filename>toolkit/amd_data_generation_toolkit/classification/scripts/step-1.py
# Copyright (c) 2018 - 2021 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# ... | StarcoderdataPython |
57192 | <gh_stars>0
# -*- coding: utf-8 -*-
from fdscraper import pd
import json
from . import NoSuchElementException
def get_date_and_price(price_data):
date = []
price = []
for date_data in price_data:
date.append(date_data[0])
price.append(float(date_data[1]))
return date,price
def get_pri... | StarcoderdataPython |
3213236 | # Reward Types Include :
# ('item', 'crypits', 'koinium', 'ethereal')
# 'item' = String
# 'crypits' = Int (Ex. 23213123 ) Divides By Users, This Balances['Decimal']
# 'koinium' = Int (Ex. 23213123 ) Divides By Users, This Balances['Decimal']
# 'ethereal' = Int (Ex. 23213123 ) Divides By Users, This Balances['Decim... | StarcoderdataPython |
1761825 | <reponame>blue-marble/gridpath
# Copyright 2016-2020 Blue Marble Analytics 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 r... | StarcoderdataPython |
14283 | import struct
from six import binary_type
from capnpy import ptr
from capnpy.packing import mychr
from capnpy.printer import print_buffer
class SegmentBuilder(object):
def __init__(self, length=None):
self.buf = bytearray()
def get_length(self):
return len(self.buf)
def as_string(self):... | StarcoderdataPython |
1755336 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib import animation
def init_byouga(plt):
""" 迷路の初期描画"""
# 迷路を描画
fig = 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', lin... | StarcoderdataPython |
179269 | from ._version import __version__
from ._rwlock import RWLock as RWLock
from ._streams import (
BufferedReceiveStream as BufferedReceiveStream,
TextReceiveStream as TextReceiveStream,
)
from ._multi_cancel import MultiCancelScope as MultiCancelScope
from ._service_nursery import open_service_nursery as open_se... | StarcoderdataPython |
1774813 | <filename>scripts/models/NeuralCDE/controldiffeq/__init__.py
from .cdeint_module import cdeint, VectorField
from .interpolate import natural_cubic_spline_coeffs, NaturalCubicSpline
| StarcoderdataPython |
3386361 | <reponame>jihyunbak/rec_to_nwb
from .device import Device
class HardwareConfiguration:
def __init__(self, element):
self.tree = element
self.devices = [Device(device_element) for device_element in self.tree.findall('Device')]
self.tag = self.tree.tag
self.sampling_rate = self.tree... | StarcoderdataPython |
1617209 | <filename>shy no.py
#program to find whether a no. is shy no. or not
ch=1 #initialiing the choice variable with 1
while ch ==1:
s=0 #initializing sum of digits as 0
p=1 #initializing product of digits as 1
... | StarcoderdataPython |
3215409 | <filename>custom_components/securitas/sensor.py
"""Securitas direct sentinel sensor."""
from datetime import timedelta
from .securitas_direct_new_api.dataTypes import (
AirQuality,
Sentinel,
Service,
)
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
from homeassistant.const impo... | StarcoderdataPython |
3264526 | <filename>dynamicProgramming/max-len-of-repeated-subarray.py<gh_stars>1-10
#coding: utf-8
''' mbinary
#######################################################################
# File : max-len-of-repeated-subarray.py
# Author: mbinary
# Mail: <EMAIL>
# Blog: https://mbinary.xyz
# Github: https://github.com/mbinary
# Crea... | StarcoderdataPython |
56078 | <filename>tests/test_simple_diabetes_model_oo_refactor.py
"""
Tests to confirm that Cameron's refactor of Ed's diabetes model code gives the same output
"""
import numpy as np
from tidepool_data_science_models.models.simple_metabolism_model import SimpleMetabolismModel
from tidepool_data_science_models.models.simple_... | StarcoderdataPython |
1685079 | from pylspclient import lsp_structs
#from pylspclient import LspEndpoint
from typing import List
class LspClient(object):
# TODO: refactor in a way we can strongly type here
#lsp_endpoint: LspEndpoint
def __init__(self, lsp_endpoint):
"""
Constructs a new LspClient instance.
:para... | StarcoderdataPython |
1679697 | <reponame>zhq921/cfWGBS-bioinfo-pip
import time
import sys
def get_sam_lab_nm_early(file):
print(time.asctime( time.localtime(time.time()))+" Start reading from {}".format(file))
normal_samples = []
early_samples = []
with open(file) as f:
for line in f:
if line.startswith("sample"):... | StarcoderdataPython |
4823743 | default_app_config = 'wagtail.wagtailsnippets.apps.WagtailSnippetsAppConfig'
| StarcoderdataPython |
7109 | import numpy as np
img_dtype = np.float32
imgX, imgY, imgZ = (256, 256, 150)
imgs_path_withfaces = '../dataset/withfaces'
imgs_path_nofaces = '../dataset/nofaces'
imgX_dwt1, imgY_dwt1, imgZ_dwt1 = (128, 128, 75)
imgs_path_withfaces_dwt = './dataset/withfaces'
imgs_path_nofaces_dwt = './dataset/nofaces'
dwt_flag = (... | StarcoderdataPython |
20681 | <reponame>VaibhavBhujade/Blockchain-ERP-interoperability
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import hashlib
import json
from odoo import api, models
from odoo.http import request
from odoo.tools import ustr
from odoo.addons.web.controllers.main import mod... | StarcoderdataPython |
1668685 | import numpy as np
df_x = np.load("Dados Normalizados.npy")
print(df_x.shape)
df_y = np.load("Target.npy")
print(df_y.shape)
df = np.concatenate([df_x, np.expand_dims(df_y,axis=-1)], axis=-1)
#df = np.expand_dims(df, axis = -1)
#df = df.reshape(df.shape[0], 1, df.shape[1], df.shape[2])
print(df.shape)
import numpy as... | StarcoderdataPython |
129598 | <reponame>StephenSchroeder/pyjanitor<filename>tests/functions/test_bin_numeric.py
import pytest
from hypothesis import given
from janitor.testing_utils.strategies import df_strategy
@pytest.mark.functions
@given(df=df_strategy())
def test_bin_numeric_expected_columns(df):
df = df.bin_numeric(from_column="a", to... | StarcoderdataPython |
162733 | <reponame>ccooper21/mrimg-tools
#!/usr/bin/python
import sys
class ImageDecompressor(object):
IMAGE_PREAMBLE_LEN = 9
_file = None
def __init__(self, file_name):
self._file = open(file_name, 'rb')
def __del__(self):
if self._file is not None:
self._file.close()
def... | StarcoderdataPython |
171707 | import numpy as np
import matplotlib.pyplot as plt
def m2d( m=1.0, a=1.0, b=1.0 ):
return( a * np.power( m, b ) )
def get_v( mmin=0.0, mmax=0.1, minc=0.1,
alpha=40.0, beta=0.230, gamma=1/2,
rho_0=1.0, rho=1.0 ):
m_l = np.arange( mmin, mmax+minc, minc )
v_l = np.zeros( m_l.shape )... | StarcoderdataPython |
3223795 | <reponame>ruttenb/django-dynamic-attachments
from django.conf import settings
from django.http import Http404, JsonResponse, StreamingHttpResponse
from django.shortcuts import get_object_or_404, render
from django.template import loader
from django.utils.encoding import force_text
from django.views.decorators.csrf impo... | StarcoderdataPython |
3262866 | #
# Copyright (c) 2020 Idiap Research Institute, http://www.idiap.ch/
# Written by <NAME> <<EMAIL>>,
# <NAME> <<EMAIL>>
#
from glob import iglob
from os import path, rename
import time
from collections import namedtuple
import sys
import numpy as np
import torch
import torch.nn.functional as F
from radam import RAda... | StarcoderdataPython |
1799079 | <gh_stars>10-100
import matplotlib.pyplot as plt
def keras_log_plot(train_log=None):
plt.plot(train_log['acc'], label='acc', color='red')
plt.plot(train_log['loss'], label='loss', color='yellow')
if 'val_acc' in train_log.columns:
plt.plot(train_log['val_acc'], label='val_acc', color='green')
... | StarcoderdataPython |
4830063 | from __future__ import division
import pygame
from math import pi
from random import random
from arena import Arena, ARENA_MARKINGS_COLOR, ARENA_MARKINGS_WIDTH
from ..markers import Token
class PiratePlunderArena(Arena):
start_locations = [( 0, -3),
( 3, 0),
( 0, 3... | StarcoderdataPython |
1672810 | import requests
from dotenv import load_dotenv
import os
load_dotenv()
key = os.getenv('GIMG_KEY')
cx = os.getenv('CX')
def lyrictoimage(text):
newtext = text.split()
res = []
for i in newtext:
response = requests.get("https://www.googleapis.com/customsearch/v1?key="+key+"&cx="+cx+"&q="+i+"&searchT... | StarcoderdataPython |
4834707 | from .cache import *
from .enums import *
from .exceptions import *
from .gateway import *
from .http import *
from .models import *
| StarcoderdataPython |
92483 | <gh_stars>0
import spectroscope
from ethereumapis.v1alpha1 import validator_pb2, validator_pb2_grpc
from spectroscope.model import ChainTimestamp, ValidatorIdentity
from spectroscope.model.update import (
ValidatorActivationUpdate,
ActivationBatch,
)
from spectroscope.exceptions import Invalid, ValidatorInvalid... | StarcoderdataPython |
1651245 | import sys
import time
import pandas as pd
import numpy as np
import os
import pyodbc as odbc
import teradata
from joblib import Parallel, delayed
from ..auth.auth import read_credential_file, load_db_info
def connect_teradata(env, connector):
env_n, env_dsn, env_short, usr, passw = load_db_info(env)
if con... | StarcoderdataPython |
3354935 | <gh_stars>0
# markov algorithm
import os
import django
import sys
from elasticsearch import Elasticsearch
pro_dir = os.getcwd()
sys.path.append(pro_dir)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "BioDesigner.settings")
from design.models import parts
def cal_probability(data_set):
'''calculate... | StarcoderdataPython |
1791397 | <gh_stars>1-10
# Code taken from http://www.pygame.org/project-2D+Cellular+Automaton+Simulation-1944-.html
# Almost nothing changed, except - removed 3 fps clock, added gsdl2
try:
import gsdl2 as pygame
except:
import pygame
import random
class MapGrid():
def __init__(self, map_width, map_height):
... | StarcoderdataPython |
114060 | <reponame>karannewatia/Mycelium
import random
from sympy import ntt, intt
class Ring(object):
# Defines parameters for the ring Z/pZ/<X^n + 1>
# i.e. A ring of polynomials where coefficients are
# in Z/pZ, and where polynomial multiplication is
# reduced over X^n+1
# p is the prime modulus
# Require a... | StarcoderdataPython |
24769 | """dRest core API connection library."""
import re
from . import interface, resource, request, serialization, meta, exc
from . import response
class API(meta.MetaMixin):
"""
The API class acts as a high level 'wrapper' around multiple lower level
handlers. Most of the meta arguments are optionally passed... | StarcoderdataPython |
3269192 | ### DAY 1: Sonar Sweep ###
import pandas as pd
fp = '1_input.txt'
df = pd.read_csv(fp,header=None)
df_results = df > df.shift(1)
df_results.sum()
### PART TWO ###
df_3m = df + df.shift(1) + df.shift(2)
df_results2 = df_3m > df_3m.shift(1)
df_results2.sum()
| StarcoderdataPython |
1670690 | <gh_stars>0
"""
Read out the raw icd code from the eicu database and separate them
into icd9 and icd10 lists.
"""
import csv
import json
import os
from tqdm import tqdm
# pulmonary|respiratory failure|Tracheostomy performed during this admission for ventilatory support # noqa
CHECKED_V_CODES = ['V08', 'V62.84', 'V42... | StarcoderdataPython |
3245366 | <reponame>pyrustic/hubstore<filename>hubstore/view/openlist.py
import tkinter as tk
from viewable import Viewable
from megawidget.scrollbox import ScrollBox
from megawidget.toast import Toast
from hubstore.misc.theme import get_entry_description_style, \
get_info_entry_owner_repo_style, get_package_size_style
from ... | StarcoderdataPython |
3394605 | import logging
import os
from settings import FileConf, LogConf
def create_dir(dir_name, logger):
if os.path.isdir(dir_name):
logger.warning("Function create_dir: dir_name %s already exists.", dir_name)
return dir_name
os.makedirs(dir_name)
logger.info("Function create_dir: dir_name %s cr... | StarcoderdataPython |
3371257 | <gh_stars>0
from django.conf import settings
from django.core.mail import send_mail
from django.utils.encoding import force_bytes
from django.utils.http import urlsafe_base64_encode
from django.template.loader import render_to_string
from django.contrib.sites.shortcuts import get_current_site
from .token import accoun... | StarcoderdataPython |
11948 | """
MDCrane demo
=============
.. seealso::
`Material Design spec,
Crane <https://material.io/design/material-studies/crane.html#>`
Crane is a travel app that helps users find and book travel, lodging, and
restaurant options that match their input preferences.
"""
import os
import sys
from pathlib i... | StarcoderdataPython |
3225189 | <filename>launch_site.py
#!/usr/bin/env python3
# <NAME>
# CS 483, Fall 2019
# Quick script to launch the cherrypy engine to serve our content.
from mtg_qe.site.main import main
if __name__ == "__main__":
main() | StarcoderdataPython |
3311628 | from yaml import load, dump
try:
from yaml import CLoader as Loader, CDumper as Dumper
except ImportError:
from yaml import Loader, Dumper
fixtures = load(open('features/fixtures/scrape.yml'), Loader=Loader)
visited = set()
def already_visited(uri):
if uri in visited:
return True
else:
... | StarcoderdataPython |
180069 | import pytest
from asn1PERser.codec.per.decoder import decode as per_decoder
from asn1PERser.classes.data.builtin.BooleanType import BooleanType
@pytest.mark.parametrize("schema, encoded, value", [
(BooleanType, '80', BooleanType(value=True)),
(BooleanType, '00', BooleanType(value=False)),
])
def test_boolean... | StarcoderdataPython |
36969 | <gh_stars>0
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import binascii
from odoo import fields, http, _
from odoo.exceptions import AccessError, MissingError, UserError
from odoo.http import request
from odoo.addons.payment.controllers.portal import PaymentProce... | StarcoderdataPython |
3368012 | <gh_stars>0
UNSCOPED_TOKEN = {
u'access': {u'serviceCatalog': {},
u'token': {u'expires': u'2012-10-03T16:58:01Z',
u'id': u'3e2813b7ba0b4006840c3825860b86ed'},
u'user': {u'id': u'c4da488862bd435c9e6c0275a0d0e49a',
u'name': u'example... | StarcoderdataPython |
109095 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Library with PME calculation functions, provides utility for Private Equity analysis.
@author: <NAME> (<EMAIL>)
"""
import pandas as pd
import numpy as np
import scipy.optimize
from datetime import date
#Helper functions
def nearest(series, lookup, debug = False):
... | StarcoderdataPython |
3229097 | <filename>trace-viewer/third_party/pywebsocket/src/test/test_handshake_draft75.py
#!/usr/bin/env python
#
# Copyright 2011, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * ... | StarcoderdataPython |
1755229 | <reponame>RLado/Aeropendulum-IOT
#views.py
#Flask app for the Aeropendulum_IOT project
#8th October 2019
#<NAME> <<EMAIL>>
from flask import Blueprint, render_template, Response
#Camera
from .camera_opencv import Camera
#Chart modules
from datetime import datetime
import time
import json
#Serial comunications
from mul... | StarcoderdataPython |
3365185 | import time
from django.contrib.sites.shortcuts import get_current_site
from graphql_auth.settings import graphql_auth_settings as app_settings
from graphql_auth.utils import get_token
from templated_email import send_templated_mail
# --------------------------------
# Django-Templated-Email support
# --------------... | StarcoderdataPython |
1760994 | #!/usr/bin/env python3
#
# Cross Platform and Multi Architecture Advanced Binary Emulation Framework
#
import sys
sys.path.append("..")
from qiling import Qiling
if __name__ == "__main__":
ql = Qiling(["rootfs/arm_linux/bin/arm_hello"], "rootfs/arm_linux")
ql.filter = r"^open"
ql.run()
| StarcoderdataPython |
3218556 | from PIL import Image
import numpy as np
import warnings
from multiprocessing import Process, Value
class FrqNGram:
def __init__(self, path, N, L, ngram=None):
self.N = N
self.L = L
self.Counter = ngram
if ngram is None:
self.extract_NGram(path)
self.fetch_t... | StarcoderdataPython |
69103 | <reponame>robertodr/spack<filename>var/spack/repos/builtin/packages/py-torch-sparse/package.py
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class... | StarcoderdataPython |
78126 | # https://raspi.tv/2015/7-segment-display-python-raspberry-pi-countdown-ticker
from threading import Timer
import time
from RPi import GPIO as gpio
class CountDownTimer(Timer):
cycle_wait = 0.001
servo = 6
# gpio ports for the 7seg pins
segments = (11, 4, 23, 8, 7, 10, 18, 25)
# gpio ports for... | StarcoderdataPython |
1767858 | import os
import io
from typing import List, Iterable, Callable, Optional
import jieba
import spacy
from pyltp import (
Segmentor,
Postagger,
NamedEntityRecognizer,
Parser,
SementicRoleLabeller,
)
Tokenizer = Callable[[str], List[str]]
class JiebaTokenizer(object):
def __init__(self, token_se... | StarcoderdataPython |
122690 | <filename>__getDomainUsingPTRandDNS.py
'''
Write a Python program to get the domain name using PTR
DNS records from a given IP address.
Domain name using PTR DNS:
dns.google
ec2-13-251-106-90.ap-southeast-1.compute.amazonaws.com
dns.google
ec2-23-23-212-126.compute-1.amazonaws.com
'''
def get_domain_name(ip_address)... | StarcoderdataPython |
3361499 | import json
import os
from nltk.tokenize import TreebankWordTokenizer, sent_tokenize
t = TreebankWordTokenizer()
with open(os.path.join('testdata', 'tokenize.json')) as d:
data = json.load(d)
words = []
sents = []
for text in data:
for s in sent_tokenize(text):
sents.append(s)
words.append(t.... | StarcoderdataPython |
5752 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: protobufs/services/feature/actions/get_flags.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database... | StarcoderdataPython |
1799731 | from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.button import Button
from kivy.uix.image import Image
class TestApp(App):
def build(self):
layout = GridLayout(cols=2,rows=2)
layout.add_widget(Button(text="1"))
layout.add_widget(Button(text="2"))
la... | StarcoderdataPython |
3240725 | <reponame>o-kei/design-computing-aij<gh_stars>10-100
from rect import * # rect.pyの内容をインポートする
class Square(Rectangle):
def __init__(self, dx):
self.dx = dx
self.dy = self.dx # 2辺の長さを等しくする | StarcoderdataPython |
3265719 | #!/usr/bin/python
import math
N=2048
# Hann window
with open("window.h", "w") as f:
f.write("// %u point Hann window\n" % N)
f.write("static const float hannWindow[%u] = {\n" % N)
for w in [ 1-math.cos((2*math.pi*n)/(N-1)) for n in range(0, N) ]:
f.write(" %8f,\n" % w)
f.write("};\n")
| StarcoderdataPython |
3242014 | # coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------... | StarcoderdataPython |
1792781 | from fastapi.templating import Jinja2Templates
from pastetape.core.config import settings
templates = Jinja2Templates(directory=settings.TEMPLATES_DIR)
| StarcoderdataPython |
3219972 | <gh_stars>1-10
#<NAME>
from turtle import * # Makes code look a bit cleaner
def curvemove(): # A function!
for i in range(200):
right(1)
forward(1)
color('red','pink')
begin_fill()
left(140)
forward(111.65)
curvemove()
left(120)
curvemove()
forward(111.65)
e... | StarcoderdataPython |
1725059 | <filename>test/test_test_system/test_routes/test_tests.py<gh_stars>0
# std
from json import loads as json_loads
from typing import List
# 3rd party
from pytest import fixture
from flask.testing import FlaskClient
from sqlalchemy.orm import scoped_session
# custom
from test_system.models import Token, Test
from test_sys... | StarcoderdataPython |
1790307 | from django.shortcuts import render,redirect
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
from .forms import ProfileForm
from .models import Profile
from images.models import Image
# Create your views here.
@login_required(login_url='/accounts/login/')
def create_prof... | StarcoderdataPython |
1716553 | <reponame>zyh911/tencentcloud-cli<gh_stars>0
# -*- coding: utf-8 -*-
DESC = "gaap-2018-05-29"
INFO = {
"DescribeProxyGroupList": {
"params": [
{
"name": "Offset",
"desc": "偏移量,默认值为0。"
},
{
"name": "Limit",
"desc": "返回数量,默认值为20,最大值为100。"
},
{
"n... | StarcoderdataPython |
3206298 | <reponame>offish/tf2-express
from multiprocessing import Process, Pool
from time import sleep, time
from express.database import *
from express.settings import *
from express.logging import Log, f
from express.prices import update_pricelist
from express.config import *
from express.client import Client
from express.of... | StarcoderdataPython |
112545 | from golem import actions
description = 'Verify press_key action'
def test(data):
actions.navigate(data.env.url + 'elements/')
actions.press_key(('id', 'input-one'), 'NUMPAD2')
actions.verify_text_in_element(('id', 'input-one-input-result'), 'Welcome 2')
try:
actions.press_key(('id', 'input-on... | StarcoderdataPython |
1792018 | from pyrecipepuppy import RecipePuppy
import pprint
if __name__ == '__main__':
rp = RecipePuppy()
recipes = rp.get_recipes(ingredients='salmon,onions,cheese', search_query='omelet')
print(f'Some fancy omelets')
pprint.pprint(recipes)
print(f'Easy dinners with tuna, lettuce and avocado')
recipes... | StarcoderdataPython |
3350637 | <reponame>asedev/iPlug2<filename>Examples/IPlugReaperExtension/scripts/update_installer_version.py<gh_stars>1-10
#!/usr/bin/python3
# this script will update the versions in packages and innosetup installer files to match that in config.h
import plistlib, os, datetime, fileinput, glob, sys, string
scriptpath = os.pat... | StarcoderdataPython |
1655008 | import os
from subprocess import run, PIPE
class AssemblyStats:
"""
Wrapper for https://github.com/sanger-pathogens/assembly-stats
:returns dictionary: with the following entries:
{
'filename': 'path_to_assembly.fasta',
'total_length': 1836358,
'number': 62,
'mean_leng... | StarcoderdataPython |
1614963 | <reponame>my-aws-org/cloudiscovery
from typing import List
from shared.common import Filterable, BaseOptions
from shared.common_aws import BaseAwsOptions, BaseAwsCommand, AwsCommandRunner
from shared.diagram import NoDiagram
class AllOptions(BaseAwsOptions, BaseOptions):
services: List[str]
# pylint: disabl... | StarcoderdataPython |
1646216 | # Generated by Django 3.2 on 2021-04-28 08:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('AnalysisApp', '0005_polen'),
]
operations = [
migrations.AddField(
model_name='polen',
name='AnalysisResult',
... | StarcoderdataPython |
83175 | <filename>py_tdlib/constructors/delete_passport_element.py
from ..factory import Method
class deletePassportElement(Method):
type = None # type: "PassportElementType"
| StarcoderdataPython |
3344479 | <filename>software/tasks.py
import setup
import machine
import time
import serial
class Tasks:
def __init__(self):
print("started tasks")
self.pins = setup.Pins()
# hardware interface configuration
self.stim1Pin = self.pins.dout25
self.stim2Pin = self.pins.dout26
se... | StarcoderdataPython |
170910 | <reponame>joshua-software-dev/FF14AnglerParser<gh_stars>1-10
#! /usr/bin/env python3
from typing import Dict, List, Optional
from bs4 import BeautifulSoup # type: ignore
from bs4.element import Tag # type: ignore
from ff14angler.constants.regex import mooch_name_regex, non_number_replacement_regex
from ff14angler.... | StarcoderdataPython |
4842 | # PyRipple
#
# Copyright 2015 <NAME>
#
# 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 wr... | StarcoderdataPython |
3247149 | # -*- coding: utf-8 -*-
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Python module to draw heat map for Chrome
heat map is a histogram used to analyze the locality of function layout.
This modul... | StarcoderdataPython |
3339716 | from datetime import datetime
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
class User(db.Model):
__tablename__ = "users"
id = db.Column('user_id', db.Integer, primary_key=True)
username = db.Column('username', db.String(20), unique=True, index=True)
password = db.Column('password', db.S... | StarcoderdataPython |
1613218 | # Unless explicitly stated otherwise all files in this repository are licensed
# under the 3-clause BSD style license (see LICENSE).
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
def test_version():
"""Check the version import works."""
... | StarcoderdataPython |
1642407 | class Solution(object):
def palindromePairs(self, words):
"""
:type words: List[str]
:rtype: List[List[int]]
"""
self.pair = []
def helper(i, words):
word = words[i]
for j in xrange(len(words)):
if j != i:
c ... | StarcoderdataPython |
14036 | <gh_stars>1-10
"""
Copyright (c) 2020 The Orbit Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
"""
from absl import app
from core.orbit_e2e import E2ETestSuite
from test_cases.connection_window import FilterAndSelectFirstProcess, Connect... | StarcoderdataPython |
1758601 | <reponame>nbbull/RIDE
# Copyright 2008-2012 Nokia Siemens Networks Oyj
#
# 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 requ... | StarcoderdataPython |
4832967 | <reponame>gongjunhuang/Spider
# -*- coding: utf-8 -*-
import scrapy
from scrapy.http import Request, FormRequest
from urllib.request import urlretrieve
class DbSpider(scrapy.Spider):
name = 'db'
allowed_domains = ['douban.com']
header = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64; rv:57.0) Gecko/201... | StarcoderdataPython |
1618146 | <gh_stars>0
from django.urls import path
from apps.auction import views
urlpatterns =[
path('', views.auction_list_create),
path('change-status/<int:pk>', views.auction_status_update),
path('bid/', views.bid_list_and_create),
]
| StarcoderdataPython |
1793817 | <filename>train.py
# -*- coding: utf-8 -*-
# Copyright 2020. SHENGYUKing.
# 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 |
1609613 | from django.shortcuts import render,get_object_or_404
# Create your views here.
from . import models
def blog_summary(request):
blogs = models.BlogArticles.objects.all()
return render(request, 'blog/summary.html', {'blogs' : blogs})
def blog_article(request, article_id):
article = get_object_or_404(mode... | StarcoderdataPython |
4818673 | #============================================================
from linebot import (LineBotApi, WebhookHandler)
from linebot.exceptions import (InvalidSignatureError)
from linebot.models import *
import random
import time
#============================================================
from FlexMessage import *
from Anim... | StarcoderdataPython |
1758251 | # encoding: utf-8
# =========================================================================
# ©2017-2018 北京国美云服科技有限公司
# -------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this work except in compliance with the ... | StarcoderdataPython |
3309279 | # -*- coding: utf-8 -*-
"""Unit test package for loganalysis."""
| StarcoderdataPython |
3362005 | from pyschism.forcing.atmosphere import nws
from pyschism.forcing.atmosphere.nws.nws import NWS
from pyschism.forcing.atmosphere.nws.nws2 import NWS2
from pyschism.forcing.atmosphere import gfs
from pyschism.forcing.atmosphere.gfs import GlobalForecastSystem
__all__ = [
'nws',
"NWS",
"NWS2",
'gfs',
... | StarcoderdataPython |
190192 | <filename>asynet/unittests/sparse_max_pooling_test.py<gh_stars>1-10
"""
Example command: python -m unittests.sparse_max_pooling_test
"""
import numpy as np
import sparseconvnet as scn
import torch
import tqdm
import unittest
import utils.test_util as test_util
import layers.max_pool as ascn
class TestMaxPoolSync(uni... | StarcoderdataPython |
138131 | # -*- coding: utf-8 -*-
# !/usr/bin/env python
"""
__version__ = "1.0"
__license__ = "Copyright (c) 2014-2010, levp-inc, All rights reserved."
__author__ = "madeling <<EMAIL>>"
"""
from django.conf.urls import patterns, url
from account.views import LoginView, LogOutView
urlpatterns = patterns('',
... | StarcoderdataPython |
3359012 | #!/usr/bin/env python2.7
import asciiarmor
import binary
import crypto
import json_serialization
json = json_serialization.JSONSerializer({
"binary": binary.ByteArray,
"rsa-key": crypto.RSAKey,
"signed-binary": crypto.SignedBinary
})
import http_proxy
from __main__ import main
| StarcoderdataPython |
1613648 | <filename>pgbedrock/spec_inspector.py
from collections import defaultdict
import copy
import os
import cerberus
import jinja2
import yaml
from pgbedrock import common
from pgbedrock import context
from pgbedrock.jinja import add_filters
DEPENDENT_OBJECTS_MSG = ('Spec error: Ownership listed for dependent {objkind}: ... | StarcoderdataPython |
3213550 | # Generated by Django 3.1.5 on 2021-01-20 07:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('supermap', '0012_auto_20210120_1520'),
]
operations = [
migrations.AlterField(
model_name='resblock_st',
name='sign_... | StarcoderdataPython |
51741 | # Create your views here.
import mimetypes
from django.http import HttpResponse
from django import shortcuts
from sample import models
def serve_mongo_download(request, mongo_id):
obj = shortcuts.get_object_or_404(models.SampleModel, content=mongo_id)
return get_mongo_response(obj.content)
def get_mongo_re... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.