max_stars_repo_path stringlengths 4 237 | max_stars_repo_name stringlengths 6 117 | max_stars_count int64 0 95.2k | id stringlengths 1 7 | content stringlengths 12 593k | input_ids listlengths 7 549k |
|---|---|---|---|---|---|
rastervision_core/rastervision/core/evaluation/semantic_segmentation_evaluator.py | azavea/keras-image-segmentation | 0 | 164765 | from typing import TYPE_CHECKING, Iterable, Iterator
import logging
from shapely.geometry import shape, mapping
from shapely.strtree import STRtree
from rastervision.core.data import ActivateMixin, RasterizedSource
from rastervision.core.data.vector_source import GeoJSONVectorSourceConfig
from rastervision.core.evalu... | [
1,
515,
19229,
1053,
323,
6959,
29918,
3210,
16658,
4214,
29892,
20504,
519,
29892,
20504,
1061,
13,
5215,
12183,
13,
13,
3166,
528,
481,
873,
29889,
19156,
1053,
8267,
29892,
10417,
13,
3166,
528,
481,
873,
29889,
710,
8336,
1053,
2948... |
tableio/python/types.py | hschwane/offline_production | 1 | 113024 | <reponame>hschwane/offline_production
# -*- coding: utf-8 -*-
#
# copyright (C) 2010
# The Icecube Collaboration
#
# $Id: types.py 107762 2013-07-01 22:55:31Z nwhitehorn $
#
# @version $Revision: 107762 $
# @date $LastChangedDate: 2013-07-01 18:55:31 -0400 (Mon, 01 Jul 2013) $
# @author <NAME> <<EMAIL>> $LastChange... | [
1,
529,
276,
1112,
420,
29958,
29882,
816,
29893,
1662,
29914,
2696,
1220,
29918,
24601,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
29937,
29871,
13,
29937,
3509,
1266,
29871,
313,
29907,
29897,
... |
i2vec_cli/__main__.py | rachmadaniHaryono/i2vec_cli | 0 | 9883 | #!/usr/bin/env python3
"""get tag from http://demo.illustration2vec.net/."""
# note:
# - error 'ERROR: Request Entity Too Large' for file 1.1 mb
# <span style="color:red;">ERROR: Request Entity Too Large</span>
from collections import OrderedDict
from pathlib import Path
from pprint import pformat
import imghdr
import ... | [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
15945,
29908,
657,
4055,
515,
1732,
597,
17482,
29889,
453,
11036,
29906,
2003,
29889,
1212,
29914,
1213,
15945,
13,
29937,
4443,
29901,
13,
29937,
448,
1059,
525,
11432,
29901,
1... |
galloper/data_utils/file_utils.py | kostiantyn-yarovyi/galloper | 1 | 116283 | <reponame>kostiantyn-yarovyi/galloper<filename>galloper/data_utils/file_utils.py
from requests import get
import os
from flask import current_app
from uuid import uuid4
class File:
def __init__(self, url):
self.url = url
self.filename = url.split("/")[-1]
self.path = ""
def read(self)... | [
1,
529,
276,
1112,
420,
29958,
29895,
16098,
424,
948,
29899,
8553,
15890,
29875,
29914,
23014,
417,
546,
29966,
9507,
29958,
23014,
417,
546,
29914,
1272,
29918,
13239,
29914,
1445,
29918,
13239,
29889,
2272,
13,
3166,
7274,
1053,
679,
1... |
pyfacebook/utils/reformat_response.py | Socian-Ltd/python-facebook-1 | 0 | 31396 | <filename>pyfacebook/utils/reformat_response.py
import json
from typing import Optional, Union, Dict
def replace_from_keyword_in_json(
data, # type: Optional[Dict]
):
# type: (...) -> Dict
"""
Rename the 'from' field coming from the Graph API. As 'from' is a Python keyword, we cannot use this as a... | [
1,
529,
9507,
29958,
2272,
15445,
29914,
13239,
29914,
276,
4830,
29918,
5327,
29889,
2272,
13,
5215,
4390,
13,
3166,
19229,
1053,
28379,
29892,
7761,
29892,
360,
919,
13,
13,
13,
1753,
5191,
29918,
3166,
29918,
26766,
29918,
262,
29918,
... |
grow/translators/google_translator_toolkit_test.py | denmojo/pygrow | 0 | 98424 | <reponame>denmojo/pygrow
from . import google_translator_toolkit
from grow.common import oauth
from grow.pods import pods
from grow.pods import storage
from grow.testing import testing
from nose.plugins import skip
import time
import unittest
class GoogleTranslatorToolkitTestCase(testing.TestCase):
def setUp(sel... | [
1,
529,
276,
1112,
420,
29958,
1145,
4346,
2212,
29914,
2272,
29887,
798,
13,
3166,
869,
1053,
5386,
29918,
3286,
29880,
1061,
29918,
10154,
7354,
13,
3166,
6548,
29889,
9435,
1053,
288,
5150,
13,
3166,
6548,
29889,
15334,
29879,
1053,
... |
masq/cms/api/player.py | tehdiplomat/hidden-role-games | 0 | 113338 | from rest_framework import generics
from rest_framework import permissions
from cms.models.Player import Player, PlayerSerializer
class PlayerList(generics.ListCreateAPIView):
queryset = Player.objects.all()
serializer_class = PlayerSerializer
class PlayerDetail(generics.RetrieveUpdateDestroyAPIView):
queryset = ... | [
1,
515,
1791,
29918,
4468,
1053,
1176,
1199,
13,
3166,
1791,
29918,
4468,
1053,
11239,
13,
3166,
274,
1516,
29889,
9794,
29889,
9075,
1053,
14574,
29892,
14574,
17679,
13,
13,
1990,
14574,
1293,
29898,
4738,
1199,
29889,
1293,
4391,
8787,... |
ink2canvas/svg/Use.py | greipfrut/pdftohtml5canvas | 4 | 1711 | from ink2canvas.svg.AbstractShape import AbstractShape
class Use(AbstractShape):
def drawClone(self):
drawables = self.rootTree.getDrawable()
OriginName = self.getCloneId()
OriginObject = self.rootTree.searchElementById(OriginName,drawables)
OriginObject.runDraw()
de... | [
1,
515,
297,
29895,
29906,
15257,
29889,
15120,
29889,
9118,
24111,
1053,
25513,
24111,
13,
13,
1990,
4803,
29898,
9118,
24111,
1125,
13,
268,
13,
1678,
822,
4216,
6821,
650,
29898,
1311,
1125,
13,
4706,
4216,
1849,
353,
1583,
29889,
46... |
google-cloud-sdk/lib/surface/compute/instances/create_from_container.py | bopopescu/searchparty | 0 | 112779 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | [
1,
396,
14187,
1266,
29871,
29906,
29900,
29896,
29953,
5087,
9266,
29889,
2178,
26863,
2538,
9841,
29889,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
19... |
lists.py | Irene-Michellee/Python_DS-Algorithms | 0 | 1613306 | # Accesing elements in a list
list_a = ['phy','chem',1998,2000];
list_b = [1,2,3,4,5,6,7,8,9];
print("list_a[2] is:",list_a[2]);
print(list_b[2:7]);
#updating lists
print("updation");
print(list_a[1]);
list_a[1] = "math";
list_b.append("hello"); #append to add an element to the list
print(list_a);
print(list_b);
#Del... | [
1,
396,
4831,
267,
292,
3161,
297,
263,
1051,
13,
1761,
29918,
29874,
353,
6024,
11461,
3788,
14969,
742,
29896,
29929,
29929,
29947,
29892,
29906,
29900,
29900,
29900,
1385,
13,
1761,
29918,
29890,
353,
518,
29896,
29892,
29906,
29892,
2... |
weather/views.py | fjavierm/weather-app | 0 | 197790 | <reponame>fjavierm/weather-app
import json
import urllib.request
from django.shortcuts import render
API_KEY = '' # TODO Add the API key
# Create your views here.
def home(request):
if request.method == 'POST':
city = request.POST['city']
source = urllib.request.urlopen(
'http://api... | [
1,
529,
276,
1112,
420,
29958,
29888,
9494,
631,
29885,
29914,
705,
1624,
29899,
932,
13,
5215,
4390,
13,
5215,
3142,
1982,
29889,
3827,
13,
13,
3166,
9557,
29889,
12759,
7582,
29879,
1053,
4050,
13,
13,
8787,
29918,
10818,
353,
6629,
... |
spiderlib/db/run.py | AmerJod/common | 0 | 53690 | <filename>spiderlib/db/run.py
from spiderlib.db.database import Database
# For testing purposes
POSTGRES_CONN = {
"POSTGRES_URL": "localhost:54320",
"POSTGRES_USER": "postgres",
"POSTGRES_PW": "<PASSWORD>",
"POSTGRES_DB": "postgres"
}
if __name__ == '__main__':
db = Database(**POSTGRES_CONN)
... | [
1,
529,
9507,
29958,
1028,
1241,
1982,
29914,
2585,
29914,
3389,
29889,
2272,
13,
3166,
805,
1241,
1982,
29889,
2585,
29889,
9803,
1053,
5470,
13,
13,
29937,
29871,
1152,
6724,
11976,
13,
5438,
29954,
15989,
29918,
6007,
29940,
353,
426,
... |
cvat/apps/iam/schema.py | ACHultman/cvat | 4,197 | 35635 | <reponame>ACHultman/cvat
# Copyright (C) 2022 Intel Corporation
#
# SPDX-License-Identifier: MIT
from drf_spectacular.extensions import OpenApiFilterExtension, OpenApiAuthenticationExtension
from drf_spectacular.plumbing import build_parameter_type
from drf_spectacular.utils import OpenApiParameter
# https://drf-spec... | [
1,
529,
276,
1112,
420,
29958,
2477,
29950,
499,
1171,
29914,
29883,
9046,
13,
29937,
14187,
1266,
313,
29907,
29897,
29871,
29906,
29900,
29906,
29906,
18555,
15025,
13,
29937,
13,
29937,
10937,
29928,
29990,
29899,
29931,
293,
1947,
29899... |
embench-iot/pylib/embench_core.py | Hecmay/llvm-pass-skeleton | 2 | 45750 | <gh_stars>1-10
#!/usr/bin/env python3
# Common python procedures for use across Embench.
# Copyright (C) 2017, 2019 Embecosm Limited
#
# Contributor: <NAME> <<EMAIL>>
# Contributor: <NAME> <<EMAIL>>
#
# This file is part of Embench.
# SPDX-License-Identifier: GPL-3.0-or-later
"""
Embench common procedures.
This ve... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
13,
29937,
13103,
3017,
28648,
363,
671,
4822,
2812,
1785,
305,
29889,
13,
13,
29937,
14187,
1266,
313,... |
DQM/DTMonitorModule/python/dtChamberEfficiencyHI_cfi.py | pasmuss/cmssw | 0 | 7431 | <gh_stars>0
import FWCore.ParameterSet.Config as cms
from RecoMuon.TrackingTools.MuonServiceProxy_cff import MuonServiceProxy
dtEfficiencyMonitor = cms.EDAnalyzer("DTChamberEfficiency",
MuonServiceProxy,
debug = cms.untracked.bool(True),
TrackCollection = cms.InputTag("standAloneMuons"),
theMaxC... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
383,
29956,
9203,
29889,
9329,
2697,
29889,
3991,
408,
274,
1516,
13,
13,
3166,
3599,
29877,
29924,
29884,
265,
29889,
17936,
292,
24183,
29889,
29924,
29884,
265,
3170,
14048,
2991... |
Curso Python/ex004.py | sandro-fidelis/Cursos | 0 | 154293 | <filename>Curso Python/ex004.py<gh_stars>0
a = input('Digite algo ')
print(' O tipo primitivo desse valor é:',type(a))
print('Só tem espaços?',a.isspace())
print('É um número?', a.isnumeric())
print('É alfabético?',a.isalpha())
print('é alfanumérico?',a.isalnum())
print('Está em maiúscula?',a.isupper())
print('Está em ... | [
1,
529,
9507,
29958,
23902,
578,
5132,
29914,
735,
29900,
29900,
29946,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
29874,
353,
1881,
877,
14991,
568,
24673,
25710,
13,
2158,
877,
438,
13306,
28147,
4243,
553,
344,
1649... |
morse_DMT/write_dipha_file_3d_revise.py | YinuoJin/DMT_loss | 1 | 8137 | import sys
from matplotlib import image as mpimg
import numpy as np
import os
DIPHA_CONST = 8067171840
DIPHA_IMAGE_TYPE_CONST = 1
DIM = 3
input_dir = os.path.join(os.getcwd(), sys.argv[1])
dipha_output_filename = sys.argv[2]
vert_filename = sys.argv[3]
input_filenames = [name
for nam... | [
1,
1053,
10876,
30004,
13,
3166,
22889,
1053,
1967,
408,
22326,
2492,
30004,
13,
5215,
12655,
408,
7442,
30004,
13,
5215,
2897,
30004,
13,
30004,
13,
4571,
29925,
15715,
29918,
6007,
1254,
353,
29871,
29947,
29900,
29953,
29955,
29896,
29... |
setup.py | CollinNHays/python_qt_binding | 20 | 1606685 | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
try:
from catkin_pkg.python_setup import generate_distutils_setup
d = generate_distutils_setup()
except ImportError:
# extract information from package.xml manually when catkin_pkg is unava... | [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
13,
2202,
29901,
13,
1678,
515,
731,
21245,
8789,
1053,
6230,
13,
19499,
16032,
2392,
29901,
13,
1678,
515,
1320,
13239,
29889,
3221,
1053,
6230,
13,
13,
2202,
29901,
13,
1678,
515,
... |
bin_collection/sensor.py | davidjb/sensor.bin_collection | 0 | 88364 | <reponame>davidjb/sensor.bin_collection
import datetime
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME, CONF_WEEKDAY, ATTR_DATE
import homeassistant.util.dt as dt_util
from homeassistant.helpers.eve... | [
1,
529,
276,
1112,
420,
29958,
29881,
16093,
16761,
29914,
29879,
6073,
29889,
2109,
29918,
10855,
13,
5215,
12865,
13,
13,
5215,
1700,
21245,
17269,
408,
1700,
13,
13,
3166,
3271,
465,
22137,
29889,
3221,
1053,
6939,
13,
3166,
3271,
46... |
metaquantome/modules/run_viz.py | jj-umn/metaquantome | 4 | 23292 | import os
import subprocess
import json
from metaquantome.util.utils import BASE_DIR
from metaquantome.classes.SampleGroups import SampleGroups
def run_viz(plottype, img, infile, strip=None,
mode=None, meancol=None, nterms='5', target_rank=None, barcol=6, # barplot, stacked_bar
textannot=Non... | [
1,
1053,
2897,
13,
5215,
1014,
5014,
13,
5215,
4390,
13,
13,
3166,
12700,
12150,
608,
29889,
4422,
29889,
13239,
1053,
350,
8127,
29918,
9464,
13,
3166,
12700,
12150,
608,
29889,
13203,
29889,
17708,
24020,
1053,
21029,
24020,
13,
13,
1... |
CognosService.py | gbryant-dev/CApy | 0 | 176027 | <reponame>gbryant-dev/CApy
from GroupService import GroupService
from RESTService import RESTService
from UserService import UserService
class CognosService:
def __init__(self, **kwargs) -> None:
self._cognos_rest = RESTService(**kwargs)
self.groups = GroupService(self._cognos_rest)
self.users = U... | [
1,
529,
276,
1112,
420,
29958,
26300,
719,
424,
29899,
3359,
29914,
5454,
2272,
13,
3166,
6431,
3170,
1053,
6431,
3170,
13,
3166,
16759,
3170,
1053,
16759,
3170,
13,
3166,
4911,
3170,
1053,
4911,
3170,
13,
13,
1990,
315,
3811,
359,
31... |
tests/test_hooks.py | 647-coder/Thrall | 6 | 166594 | <reponame>647-coder/Thrall
# coding: utf-8
# flake8: noqa
from thrall.hooks import _SetDefault, _SetDefaultWithParams, SetD
class TestSetDefault(object):
@_SetDefault
def mock(self, **kwargs):
return kwargs
@_SetDefault
def mock2(self, a=1, b=2):
return a, b
def test_set_ok(self... | [
1,
529,
276,
1112,
420,
29958,
29953,
29946,
29955,
29899,
29883,
6119,
29914,
29911,
1092,
497,
13,
29937,
14137,
29901,
23616,
29899,
29947,
13,
29937,
17422,
446,
29947,
29901,
694,
25621,
13,
13,
3166,
1468,
497,
29889,
1251,
12117,
1... |
mixer/backend/mongoengine.py | mattcaldwell/mixer | 1 | 113663 | """ Support for Mongoengine ODM.
.. note:: Support for Mongoengine_ is in early development.
::
from mixer.backend.mongoengine import mixer
class User(Document):
created_at = DateTimeField(default=datetime.datetime.now)
email = EmailField(required=True)
first_name = StringField(max_l... | [
1,
9995,
18601,
363,
18294,
10599,
438,
23560,
29889,
13,
13,
636,
4443,
1057,
18601,
363,
18294,
10599,
29918,
338,
297,
4688,
5849,
29889,
13,
13,
1057,
13,
13,
1678,
515,
6837,
261,
29889,
27852,
29889,
29885,
7443,
10599,
1053,
6837... |
rbm/models/nlp/ner/nerda.py | RevolveAI/BenchmarkMyAI | 0 | 1604257 |
import NERDA as nerda
from NERDA.precooked import EN_ELECTRA_EN, EN_BERT_ML
import nltk
from nltk.tokenize import word_tokenize
import torch
from rbm.utils import plugins
from rbm.backends import TorchBackend
from rbm.backends.nlp import NER
@plugins.register
class NERDA(TorchBackend, NER):
variants = ['EN_ELECT... | [
1,
29871,
13,
13,
5215,
405,
1001,
7698,
408,
26033,
1388,
13,
3166,
405,
1001,
7698,
29889,
1457,
1111,
12504,
1053,
12524,
29918,
29923,
3281,
4717,
29918,
1430,
29892,
12524,
29918,
13635,
29911,
29918,
1988,
13,
5215,
302,
1896,
29895... |
tests/test_export_n_load_module.py | ZeyuChen/PaddleHub | 0 | 182598 | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | [
1,
396,
259,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29929,
29871,
349,
22352,
29925,
22352,
13189,
943,
29889,
2178,
26863,
2538,
9841,
29889,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
2... |
output/models/ibm_data/mixed/assertions/test15_xsd/test15.py | tefra/xsdata-w3c-tests | 1 | 109730 | from dataclasses import dataclass, field
from typing import List, Optional
@dataclass
class XType:
class Meta:
name = "x_Type"
value: Optional[int] = field(
default=None,
metadata={
"required": True,
}
)
a: Optional[str] = field(
default=None,
... | [
1,
515,
848,
13203,
1053,
848,
1990,
29892,
1746,
13,
3166,
19229,
1053,
2391,
29892,
28379,
13,
13,
13,
29992,
1272,
1990,
13,
1990,
1060,
1542,
29901,
13,
1678,
770,
20553,
29901,
13,
4706,
1024,
353,
376,
29916,
29918,
1542,
29908,
... |
download codigo fontes/PythonExercicios/ex070.py | tidesjunior2018/Exercicios-da-linguagem-pyhton | 0 | 190261 | <gh_stars>0
'''
70-Crie um programa que leia o nome e o preço de vários produtos.O programa deverá perguntar se o usuário quer continuar.No final mostre:
A)Qual o total gasto na compra.
B)Quantos produtos custam mais de R$1000,00.
C)Qual é o nome do produto mais barato.
'''
totalcompras=contproduto=menor=contador=0
nom... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
12008,
13,
29955,
29900,
29899,
29907,
2546,
1922,
16914,
712,
454,
423,
288,
9235,
321,
288,
758,
6102,
316,
9366,
13095,
11859,
20864,
29889,
29949,
16914,
316,
369,
29976,
639,
29887,
... |
pets/models.py | Gornstats/HTMX-Django-Experiments | 0 | 50284 | from django.db import models
class Pet(models.Model):
pet_name = models.CharField(max_length=20)
def __str__(self):
return self.pet_name
| [
1,
515,
9557,
29889,
2585,
1053,
4733,
13,
13,
1990,
5879,
29898,
9794,
29889,
3195,
1125,
13,
1678,
5697,
29918,
978,
353,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29906,
29900,
29897,
13,
268,
13,
1678,
822,
4770,
710,
120... |
src/main.py | linuxbytes/pyvaders | 0 | 99105 | from random import randrange
import pygame
from pygame import mixer
import random
import math
# intial instances of pygame
pygame.init()
screen = pygame.display.set_mode((800, 600))
# Add background image
background = pygame.image.load("assests/mountains03-1920-x-1080_full.png")
# Background Music
mixer.music.loa... | [
1,
515,
4036,
1053,
20088,
3881,
13,
5215,
22028,
13,
3166,
22028,
1053,
6837,
261,
13,
5215,
4036,
13,
5215,
5844,
13,
13,
29937,
938,
616,
8871,
310,
22028,
13,
2272,
11802,
29889,
2344,
580,
13,
13,
10525,
353,
22028,
29889,
4990,
... |
ecommerce/core/migrations/0020_auto_20200923_1948.py | berrondo/ecommerce | 1 | 28618 | <gh_stars>1-10
# Generated by Django 3.1.1 on 2020-09-23 19:48
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0019_auto_20200923_1942'),
]
operations = [
migrations.AlterField(
model... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
29937,
3251,
630,
491,
15337,
29871,
29941,
29889,
29896,
29889,
29896,
373,
29871,
29906,
29900,
29906,
29900,
29899,
29900,
29929,
29899,
29906,
29941,
29871,
29896,
29... |
2021-08-18.py | cooperuser/rl_ctrnn | 1 | 128530 | from job.nclimber import NClimber
from math import ceil
from multiprocessing.context import Process
from behavior.oscillator import Oscillator
from multiprocessing import Pool
from util.run import Run
from numpy import floor
import wandb
from job.learner import Learner
from rl_ctrnn.ctrnn import Ctrnn
import itertools
... | [
1,
515,
4982,
29889,
29876,
695,
326,
495,
1053,
25166,
2576,
495,
13,
3166,
5844,
1053,
2257,
309,
13,
3166,
6674,
307,
985,
292,
29889,
4703,
1053,
10554,
13,
3166,
6030,
29889,
14174,
453,
1061,
1053,
438,
1557,
453,
1061,
13,
3166... |
jenti.py | jentiai/Korean-Light-OCR-Data | 0 | 118619 | <filename>jenti.py
import os
import sys
import json
import requests
from tqdm import tqdm
def main():
url = "http://172.16.31.10:5000/evaluation"
img_dir = sys.argv[1]
with open('./jenti.json', 'w', encoding = 'UTF-8-sig') as json_res:
res_dict = {}
for img_name in tqdm(list(filter(lambda ... | [
1,
529,
9507,
29958,
29926,
7268,
29889,
2272,
13,
5215,
2897,
13,
5215,
10876,
13,
5215,
4390,
13,
5215,
7274,
13,
3166,
260,
29939,
18933,
1053,
260,
29939,
18933,
13,
13,
1753,
1667,
7295,
13,
1678,
3142,
353,
376,
1124,
597,
29896... |
src/testing/acceptance/test_firewall.py | cloudsigma/pycloudsigma | 13 | 49475 | import unittest
from nose.plugins.attrib import attr
from testing.utils import DumpResponse
import cloudsigma.resource as resource
@attr('acceptance_test')
class FirewallPolicyTest(unittest.TestCase):
def setUp(self):
unittest.TestCase.setUp(self)
self.client = resource.FirewallPolicy()
... | [
1,
1053,
443,
27958,
13,
13,
3166,
26414,
29889,
12800,
29889,
1131,
1091,
1053,
12421,
13,
13,
3166,
6724,
29889,
13239,
1053,
360,
3427,
5103,
13,
5215,
9570,
3754,
29889,
10314,
408,
6503,
13,
13,
13,
29992,
5552,
877,
16044,
749,
... |
main/python/model/Base.py | ShangxuanWu/MT_python | 0 | 49422 | <gh_stars>0
# <NAME> @ Myraid of Things
# 31 Jun 2017
# add path for root ('tf_code/') directory if not in sys.path
import sys, os
root_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
if root_path not in sys.path
sys.path.append(root_path)
from main.python.util... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
529,
5813,
29958,
732,
1619,
12240,
310,
28706,
13,
29937,
29871,
29941,
29896,
8378,
29871,
29906,
29900,
29896,
29955,
13,
13,
29937,
788,
2224,
363,
3876,
6702,
13264,
29918,
40... |
modules/ghautoknit/Engine.py | fstwn/ghautokn | 2 | 63569 | <reponame>fstwn/ghautokn<gh_stars>1-10
# PYTHON STANDARD LIBRARY IMPORTS ---------------------------------------------
from __future__ import absolute_import
from __future__ import division
import datetime
from os import path
# RHINO IMPORTS ---------------------------------------------------------------
from scriptco... | [
1,
529,
276,
1112,
420,
29958,
29888,
303,
1233,
29914,
12443,
1300,
554,
29876,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
29937,
349,
29979,
4690,
1164,
6850,
9468,
17011,
365,
8979,
29934,
19926,
306,
3580,
... |
conanfile.py | bincrafters/conan-azure-iot-sdk-c | 0 | 105800 | import os
from conans import ConanFile, CMake, tools
class AzureiotsdkcConan(ConanFile):
name = "Azure-IoT-SDK-C"
version = "1.1.27"
release_date = "2017-10-20"
generators = "cmake"
settings = "os", "compiler", "build_type", "arch"
url = "https://github.com/bincrafters/conan-azure-iot-sdk-c"
... | [
1,
1053,
2897,
13,
3166,
378,
550,
1053,
1281,
273,
2283,
29892,
315,
9984,
29892,
8492,
13,
13,
13,
1990,
12634,
29875,
1862,
8181,
29883,
1168,
273,
29898,
1168,
273,
2283,
1125,
13,
1678,
1024,
353,
376,
28413,
29899,
29902,
29877,
... |
json2geojson.py | gjwgit/pyute | 0 | 167206 | <reponame>gjwgit/pyute
#! usr/bin/env python
# Originally loned from
# https://github.com/ACT-COVID-19-TRACKER/privatekit-data-granularity-assessment/blob/master/json-to-geojson.py
from sys import argv
from os.path import exists
import simplejson as json
script, in_file, out_file = argv
data = json.load(open(in_f... | [
1,
529,
276,
1112,
420,
29958,
29887,
29926,
29893,
5559,
29914,
2272,
1082,
13,
29937,
29991,
502,
29878,
29914,
2109,
29914,
6272,
3017,
13,
13,
29937,
22118,
635,
301,
22367,
515,
29871,
13,
29937,
2045,
597,
3292,
29889,
510,
29914,
... |
openmdao/utils/file_wrap.py | friedenhe/OpenMDAO | 451 | 129809 | <filename>openmdao/utils/file_wrap.py
"""
A collection of utilities for file wrapping.
Note: This is a work in progress.
"""
import re
from pyparsing import CaselessLiteral, Combine, OneOrMore, Optional, \
TokenConverter, Word, nums, oneOf, printables, ParserElement, alphanums
import numpy as np
def _getform... | [
1,
529,
9507,
29958,
3150,
29885,
1388,
29877,
29914,
13239,
29914,
1445,
29918,
6312,
29889,
2272,
13,
15945,
29908,
13,
29909,
4333,
310,
3667,
1907,
363,
934,
28489,
29889,
13,
13,
9842,
29901,
910,
338,
263,
664,
297,
6728,
29889,
1... |
src/unicon/plugins/iosxe/quad/patterns.py | TestingBytes/unicon.plugins | 18 | 123639 | """ IOS-XE Quad Patterns """
from unicon.plugins.iosxe.patterns import IosXEPatterns
class IosXEQuadPatterns(IosXEPatterns):
def __init__(self):
super().__init__()
self.rpr_state = r'RPR Mode: Remote supervisor is already active'
self.unlock_state = r'RPR Mode: Remote Supervisor is no lon... | [
1,
9995,
306,
3267,
29899,
29990,
29923,
751,
328,
25860,
29879,
9995,
13,
3166,
443,
4144,
29889,
12800,
29889,
2363,
17115,
29889,
11037,
29879,
1053,
306,
359,
29990,
29923,
17144,
29879,
13,
13,
13,
1990,
306,
359,
29990,
29923,
2182,... |
logistic_regression/run_my_classifier.py | GuanLab/DeepSleep | 27 | 1612410 | #!/usr/bin/env python3
"""
Created on Fri Mar 30 22:03:29 2018
@author: mohammad
"""
import sys
import os
import glob
import numpy as np
import pandas as pd
import scipy.io
from sklearn.externals import joblib
import physionetchallenge2018_lib as phyc
def classify_record(record_name):
header_file = record_name + ... | [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
15945,
29908,
13,
20399,
373,
11169,
1085,
29871,
29941,
29900,
29871,
29906,
29906,
29901,
29900,
29941,
29901,
29906,
29929,
29871,
29906,
29900,
29896,
29947,
13,
13,
29992,
8921,
... |
tests/main.py | jaeglee0416/pydatalab | 0 | 184569 | <reponame>jaeglee0416/pydatalab<gh_stars>0
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | [
1,
529,
276,
1112,
420,
29958,
1764,
387,
17179,
29900,
29946,
29896,
29953,
29914,
2272,
29881,
2075,
370,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29896,
29945,
5087,
9266,
29889,
2178,
10... |
moneyforecast/tests/records/test_record_crud.py | curaloucura/money-forecast | 7 | 146947 | import pytest
import json
from pyquery import PyQuery
from django.core.urlresolvers import reverse
from records.models import Record, OUTCOME, INCOME
pytest_plugins = ['tests.records.fixtures']
@pytest.fixture
def user_client(user, client):
result = client.login(username=user.username, password=<PASSWORD>)
... | [
1,
1053,
11451,
1688,
13,
5215,
4390,
13,
3166,
11451,
1972,
1053,
10772,
3010,
13,
3166,
9557,
29889,
3221,
29889,
2271,
9778,
874,
1053,
11837,
13,
13,
3166,
6475,
29889,
9794,
1053,
14164,
29892,
19474,
3217,
2303,
29892,
2672,
3217,
... |
demo/production/production_server.py | lanius/hunk | 1 | 119876 | <filename>demo/production/production_server.py
# -*- coding: utf-8 -*-
from flask import Flask, jsonify
app = Flask(__name__)
@app.after_request
def after_request(response):
response.headers.add('Access-Control-Allow-Origin', '*')
return response
@app.route('/available/<int:i>')
def from_production(i):
... | [
1,
529,
9507,
29958,
17482,
29914,
24601,
29914,
24601,
29918,
2974,
29889,
2272,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
3166,
29784,
1053,
2379,
1278,
29892,
4390,
1598,
13,
13,
13,
93... |
var/spack/repos/builtin/packages/mitofates/package.py | whitfin/spack | 3 | 1611866 | <reponame>whitfin/spack<gh_stars>1-10
# Copyright 2013-2019 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 *
import glob
class Mitofates(Package):
"""MitoFates predict... | [
1,
529,
276,
1112,
420,
29958,
1332,
277,
4951,
29914,
1028,
547,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29896,
29941,
29899,
29906,
29900,
29896,
29929,
19520,
22469,
... |
galleries/annotations_filtering/__init__.py | mnicolas94/galleries | 0 | 53547 | <gh_stars>0
import enum
class ComparisonType(enum.Enum):
EQUAL = 0
NOTEQUAL = 1
LESS = 2
GREATER = 3
GREATER_EQUAL = 4
LESS_EQUAL = 5
CONTAINS = 6
data_type_to_comparison_type = {
bool: [
ComparisonType.EQUAL,
ComparisonType.NOTEQUAL
],
int: [
Comparis... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
14115,
13,
13,
13,
1990,
422,
20941,
1542,
29898,
18605,
29889,
16854,
1125,
13,
1678,
382,
13356,
1964,
353,
29871,
29900,
13,
1678,
6058,
29923,
13356,
1964,
353,
29871,
29896,
... |
Verify-Manual-python/train/core/train.py | skyduy/zfverify | 52 | 117976 | # coding: utf-8
from numpy import matrix
from oneVsAll import oneVsAll
from numpy import loadtxt, savetxt
from predictOneVsAll import predictOneVsAll
def train():
num_labels = 34
print '... Training'
X = matrix(loadtxt('X.dat')) / 255.0
y = matrix(loadtxt('y.dat')).transpose()
the_lambda = 0.1
... | [
1,
396,
14137,
29901,
23616,
29899,
29947,
13,
3166,
12655,
1053,
4636,
13,
3166,
697,
29963,
29879,
3596,
1053,
697,
29963,
29879,
3596,
13,
3166,
12655,
1053,
2254,
3945,
29892,
4048,
300,
486,
13,
3166,
8500,
6716,
29963,
29879,
3596,
... |
blender/2.79/scripts/addons/modules/extensions_framework/__init__.py | uzairakbar/bpy2.79 | 2 | 22987 | # -*- coding: utf-8 -*-
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
# --------------------------------------------------------------------------
# Blender 2.5 Extensions Framework
# --------------------------------------------------------------------------
#
# Authors:
# <NAME>
#
# This program is free software; you can ... | [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
29937,
13,
29937,
334,
2328,
22815,
402,
7390,
365,
2965,
1430,
1660,
350,
21339,
334,
2328,
13,
29937,
13,
29937,
448,
2683,
2683,
2683,
2683,
1378,
2... |
extended_int/__init__.py | NeilGirdhar/extended_int | 2 | 134899 | <reponame>NeilGirdhar/extended_int<gh_stars>1-10
from .extended_int import *
from .extended_integral import *
| [
1,
529,
276,
1112,
420,
29958,
8139,
309,
29954,
1823,
8222,
29914,
1062,
2760,
29918,
524,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
869,
1062,
2760,
29918,
524,
1053,
334,
13,
3166,
869,
1062,
2760,
... |
api/models/folder.py | djfoley01/ocp-monitor | 7 | 93900 | import os
import re
import rethinkdb as r
from jose import jwt
from jose.exceptions import JWTError
from datetime import datetime
from passlib.hash import pbkdf2_sha256
from flask import current_app
from api.models.RethinkDBModel import RethinkDBModel
from api.models.file import File
conn = r.connect(db='papers')
... | [
1,
1053,
2897,
13,
5215,
337,
13,
13,
5215,
337,
386,
682,
2585,
408,
364,
13,
3166,
432,
852,
1053,
432,
14554,
13,
3166,
432,
852,
29889,
11739,
29879,
1053,
435,
17755,
2392,
13,
3166,
12865,
1053,
12865,
13,
3166,
1209,
1982,
29... |
Pasture_Growth_Modelling/initialisation_support/dryland_ibasal.py | Komanawa-Solutions-Ltd/SLMACC-2020-CSRA | 0 | 13542 | """
Author: <NAME>
Created: 23/11/2020 11:06 AM
"""
import ksl_env
# add basgra nz functions
ksl_env.add_basgra_nz_path()
from supporting_functions.plotting import plot_multiple_results
from check_basgra_python.support_for_tests import establish_org_input, get_lincoln_broadfield, get_woodward_weather, _clean_harves... | [
1,
9995,
13,
13361,
29901,
529,
5813,
29958,
13,
6760,
630,
29901,
29871,
29906,
29941,
29914,
29896,
29896,
29914,
29906,
29900,
29906,
29900,
29871,
29896,
29896,
29901,
29900,
29953,
13862,
13,
9995,
13,
5215,
413,
2536,
29918,
6272,
13,... |
src/tests/profile.py | royalstream/pythonnet | 1 | 40793 | """Run all of the unit tests for this package over and over,
in order to provide for better profiling."""
from __future__ import print_function
def main():
import sys, os, gc, time
dirname = os.path.split(__file__)
sys.path.append(dirname)
import runtests
gc.set_debug(gc.DEBUG_LEAK)
star... | [
1,
9995,
6558,
599,
310,
278,
5190,
6987,
363,
445,
3577,
975,
322,
975,
29892,
13,
259,
297,
1797,
304,
3867,
363,
2253,
20077,
292,
1213,
15945,
13,
3166,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
13,
13,
13,
1753,
1667,
7... |
losses.py | abhinav-2912/Polyp-Segmentation | 0 | 16430 | <filename>losses.py
import os
import cv2
import keras
import numpy as np
import albumentations as A
import tensorflow as tf
from keras import backend as K
def jaccard_distance(y_true, y_pred, smooth=100):
intersection = K.sum(K.abs(y_true * y_pred), axis=-1)
sum_ = K.sum(K.abs(y_true) + K.abs(y_pred), axis=-1)... | [
1,
529,
9507,
29958,
6758,
267,
29889,
2272,
13,
5215,
2897,
13,
5215,
13850,
29906,
13,
5215,
13023,
294,
13,
5215,
12655,
408,
7442,
13,
5215,
27234,
942,
800,
408,
319,
13,
5215,
26110,
408,
15886,
13,
3166,
13023,
294,
1053,
14998... |
enthought/numerical_modeling/numeric_context/mask_filter.py | enthought/etsproxy | 3 | 1602405 | # proxy module
from __future__ import absolute_import
from blockcanvas.numerical_modeling.numeric_context.mask_filter import *
| [
1,
396,
10166,
3883,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
13,
3166,
2908,
15257,
29889,
8058,
936,
29918,
4299,
292,
29889,
21574,
29918,
4703,
29889,
13168,
29918,
4572,
1053,
334,
13,
2
] |
interpreter.py | vultureofficial/Vulture | 1 | 192776 | <reponame>vultureofficial/Vulture
"""
Interpreter
-----------
AST-walking interpreter.
"""
from __future__ import print_function
import operator
import aast as ast
from collections import namedtuple
from lexer import Lexer, TokenStream
from pparser import Parser
from errors import AbrvalgSyntaxError, repor... | [
1,
529,
276,
1112,
420,
29958,
29894,
12896,
29877,
7880,
29914,
29963,
12896,
13,
15945,
19451,
13,
4074,
1457,
357,
30004,
13,
1378,
5634,
30004,
13,
30004,
13,
28938,
29899,
20919,
292,
26997,
22993,
13,
15945,
19451,
13,
3166,
4770,
... |
rllib/algorithms/pg/tests/test_pg.py | willfrey/ray | 1 | 67331 | from gym.spaces import Box, Dict, Discrete, Tuple
import numpy as np
import unittest
import ray
import ray.rllib.algorithms.pg as pg
from ray.rllib.evaluation.postprocessing import Postprocessing
from ray.rllib.examples.env.random_env import RandomEnv
from ray.rllib.models.tf.tf_action_dist import Categorical
from ray... | [
1,
515,
330,
962,
29889,
22854,
1053,
11773,
29892,
360,
919,
29892,
3295,
9084,
29892,
12603,
552,
13,
5215,
12655,
408,
7442,
13,
5215,
443,
27958,
13,
13,
5215,
15570,
13,
5215,
15570,
29889,
2096,
1982,
29889,
9564,
12404,
29889,
40... |
scripts/db_change_order.py | lizschley/number_six | 1 | 128281 | <gh_stars>1-10
'''
ref: https://django-extensions.readthedocs.io/en/latest/runscript.html
Run scripts/db_updater_s1.py with json: {"group_ids": [35]} or {"category_ids": [1]} (examples)
Follow instructions in run method.
Note - This script will only change the paragraphs (or group) order, but if you... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
12008,
13,
1678,
2143,
29901,
2045,
597,
14095,
29899,
24299,
29889,
949,
386,
287,
12332,
29889,
601,
29914,
264,
29914,
12333,
29914,
3389,
2154,
29889,
1420,
13,
1... |
Examples/pcan_parser.py | Legohead259/PCAN-RS232-Interface | 0 | 84884 | def parse_frame_message(msg:str):
"""
Parses a CAN message sent from the PCAN module over the serial bus
Example: 't1234DEADBEEF' - standard (11-bit) identifier message frame
'R123456784' - extended (29-bit) identifier request frame
Returns a tuple with type, ID, size, and message
Ex... | [
1,
822,
6088,
29918,
2557,
29918,
4906,
29898,
7645,
29901,
710,
1125,
13,
1678,
9995,
13,
1678,
1459,
29879,
267,
263,
315,
2190,
2643,
2665,
515,
278,
9609,
2190,
3883,
975,
278,
7797,
3593,
13,
1678,
8741,
29901,
525,
29873,
29896,
... |
python/programas simples/saudacao.py | Don616/pratica | 0 | 60462 | """
Faça um programa que pergunte a hora para o usuário e, se baseando no horário descrito, exiba a saudação apropriada.
"""
hora = input("Que horas são aí? ")
if hora.isnumeric():
hora = int(hora)
else:
print("Por favor, digite somente números.")
if hora < 0 or hora > 23:
print("Horário inválido")
elif h... | [
1,
9995,
13,
14206,
4277,
1922,
16914,
712,
639,
29887,
17316,
263,
298,
2207,
1702,
288,
502,
29884,
12288,
321,
29892,
409,
2967,
1743,
694,
4029,
12288,
5153,
9296,
29892,
429,
16912,
263,
872,
6191,
2340,
263,
7728,
374,
1114,
29889... |
XMM/PlotRGSFluxed.py | ZGainsforth/InterstellarXAS | 0 | 128163 | <gh_stars>0
from astropy. io import fits
import matplotlib.pyplot as plt
from astroquery.simbad import Simbad
# from astroquery.esa.xmm_newton import XMMNewton
targetname = '<NAME>'
Simbad.add_votable_fields('distance')
target = Simbad.query_object(targetname)
# XMMNewton.download_data('0084020401', level='PPS', ext... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
8717,
14441,
29889,
12013,
1053,
23994,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
3166,
8717,
307,
1972,
29889,
3601,
12313,
1053,
3439,
12313,
13,
29937,
515,
8717,
307,
... |
appdaemon/settings/apps/test.py | monster1025/home-assistant | 0 | 191185 | # -*- coding: utf-8 -*-
import appdaemon.plugins.hass.hassapi as hass
from notification import send_notification
import datetime
import sys, locale
import logging, codecs
import os
#import unicode
# from automation import Automation # type: ignore
"""
Monitor events and output changes to the verbose_log. Nice for deb... | [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
5215,
623,
1388,
9857,
29889,
12800,
29889,
29882,
465,
29889,
29882,
465,
2754,
408,
298,
465,
13,
3166,
12519,
1053,
3638,
29918,
24671,
13,
5215,
1286... |
realm.py | syndbg/ssh-chat | 6 | 184398 | <reponame>syndbg/ssh-chat
from twisted.conch.avatar import ConchUser
from twisted.conch.insults import insults
from twisted.conch.interfaces import IConchUser, ISession
from twisted.conch.ssh import session
from twisted.cred.portal import IRealm
from twisted.python import log
from zope.interface import implementer
fro... | [
1,
529,
276,
1112,
420,
29958,
29879,
29891,
299,
16264,
29914,
15269,
29899,
13496,
13,
3166,
3252,
12652,
29889,
535,
305,
29889,
485,
14873,
1053,
1281,
305,
2659,
13,
3166,
3252,
12652,
29889,
535,
305,
29889,
1144,
499,
29879,
1053,
... |
accounts/api/serializers.py | loafbaker/django_blog | 0 | 168254 | <reponame>loafbaker/django_blog
from django.contrib.auth import get_user_model
from rest_framework import serializers
User = get_user_model()
class UserCreateSerializer(serializers.ModelSerializer):
email = serializers.EmailField(allow_blank=False)
email2 = serializers.EmailField(label='Confirm Email', wri... | [
1,
529,
276,
1112,
420,
29958,
417,
2142,
29890,
5790,
29914,
14095,
29918,
7312,
13,
3166,
9557,
29889,
21570,
29889,
5150,
1053,
679,
29918,
1792,
29918,
4299,
13,
13,
3166,
1791,
29918,
4468,
1053,
7797,
19427,
13,
13,
13,
2659,
353,... |
examples/NeurIPS2020-Learning-to-Run-a-Power-Network-Challenge/track2/agent.py | lp2333/PARL | 3,172 | 155832 | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
1,
396,
259,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29906,
29900,
349,
22352,
29925,
22352,
13189,
943,
29889,
2178,
26863,
2538,
9841,
29889,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
2... |
sweeper/task.py | dominoFire/sweeper | 0 | 85664 | __author__ = '@dominofire'
class Task:
"""
Represents a task in the workflow
"""
def __init__(self, name, cmd):
self.name = name
""" A name for the task that is unique among workflow scope """
self.command = cmd
""" A valid bash command to be executed """
# Used... | [
1,
4770,
8921,
1649,
353,
18803,
24130,
974,
533,
29915,
13,
13,
13,
1990,
9330,
29901,
13,
1678,
9995,
13,
1678,
830,
4569,
1237,
263,
3414,
297,
278,
27321,
13,
1678,
9995,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1024,
29892,... |
lachesis/__init__.py | j1fig/lachesis | 0 | 159824 | from flask import Flask
app = Flask(__name__)
import lachesis.views
from lachesis.models.database import init_db, clear_db
if __name__ == '__main__':
app.run(debug=True)
| [
1,
515,
29784,
1053,
2379,
1278,
13,
13,
13,
932,
353,
2379,
1278,
22168,
978,
1649,
29897,
13,
13,
13,
5215,
425,
6609,
275,
29889,
7406,
13,
3166,
425,
6609,
275,
29889,
9794,
29889,
9803,
1053,
2069,
29918,
2585,
29892,
2821,
29918... |
master/rabbitvcs-master/rabbitvcs-master/rabbitvcs/util/_locale.py | AlexRogalskiy/DevArtifacts | 4 | 17477 | <gh_stars>1-10
from __future__ import absolute_import
import locale
import os
from rabbitvcs.util.log import Log
import rabbitvcs.util.settings
import rabbitvcs.util.helper
log = Log("rabbitvcs.util.locale")
def initialize_locale():
try:
settings = rabbitvcs.util.settings.SettingsManager()
sane_... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
13,
5215,
15068,
13,
5215,
2897,
13,
13,
3166,
27127,
277,
29894,
2395,
29889,
4422,
29889,
1188,
1053,
4522,
... |
lib/python3.7/site-packages/gatco_acl/acl.py | teomoney1999/ACT_gatco_project | 0 | 62704 | <reponame>teomoney1999/ACT_gatco_project<filename>lib/python3.7/site-packages/gatco_acl/acl.py<gh_stars>0
from .models import Ability
from .exceptions import AccessDenied
class ACL(object):
"""This class is used to control the Abilities Integration to one or more Gatco applications"""
def __init__(self, app=... | [
1,
529,
276,
1112,
420,
29958,
371,
290,
4992,
29896,
29929,
29929,
29929,
29914,
17923,
29918,
28818,
1111,
29918,
4836,
29966,
9507,
29958,
1982,
29914,
4691,
29941,
29889,
29955,
29914,
2746,
29899,
8318,
29914,
28818,
1111,
29918,
562,
... |
python/raspberrypi/examples/gesture_password/gesture_password.py | qusvv/DFRobot_PAJ7620U2 | 0 | 100390 | <filename>python/raspberrypi/examples/gesture_password/gesture_password.py
#-*- coding: utf-8 -*-
'''
@file GesturePassword.py
@brief Write algorithms in fast mode to realize gesture password.
@n Input gesture password in 20sm, if correct, enter the system, otherwise, continue to wait for users to input password... | [
1,
529,
9507,
29958,
4691,
29914,
3417,
29886,
16344,
1631,
29914,
19057,
29914,
7118,
545,
29918,
5630,
29914,
7118,
545,
29918,
5630,
29889,
2272,
13,
29937,
29899,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
1... |
Data-Visualization/Seaborn/Plotting graphs with Seaborn.py | Akshat-MS/DataScience-Learning | 0 | 139458 | #!/usr/bin/env python
# coding: utf-8
# # Plotting graphs with Seaborn
# In[2]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# In[3]:
iris = sns.load_dataset('iris')
iris.shape
# In[4]:
iris.head()
# In[5]:
iris['species'].unique()
# # Univariate Analys... | [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29937,
14137,
29901,
23616,
29899,
29947,
13,
13,
29937,
396,
18399,
1259,
18445,
411,
922,
370,
1398,
13,
13,
29937,
512,
29961,
29906,
5387,
13,
13,
13,
5215,
12655,
408,
7442,
13,
... |
mantrid/loadbalancer.py | epio/mantrid | 30 | 14055 | <reponame>epio/mantrid
import eventlet
import errno
import logging
import traceback
import mimetools
import resource
import json
import os
import sys
import argparse
from eventlet import wsgi
from eventlet.green import socket
from .actions import Unknown, Proxy, Empty, Static, Redirect, NoHosts, Spin
from .config impor... | [
1,
529,
276,
1112,
420,
29958,
1022,
601,
29914,
29885,
424,
2429,
13,
5215,
1741,
1026,
13,
5215,
4589,
1217,
13,
5215,
12183,
13,
5215,
9637,
1627,
13,
5215,
286,
17528,
8789,
13,
5215,
6503,
13,
5215,
4390,
13,
5215,
2897,
13,
52... |
resources/panels/maps/images.py | exposit/pythia-oracle | 32 | 42526 | # -*- coding: utf-8 -*-
##---------------------------------------------------------------------------------------------------
#
# Images Panel
#
##---------------------------------------------------------------------------------------------------
import imports
from imports import *
import config
# set this to False... | [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
2277,
2683,
2683,
2683,
2683,
2683,
2683,
5634,
13,
29937,
13,
29937,
29871,
1954,
1179,
349,
3870,
13,
29937,
13,
2277,
2683,
2683,
2683,
2683,
2683,
... |
exam1/main.py | uzakotim/programming_for_engineers_ctu | 0 | 72411 | # This is a sample Python script.
import time
import functools
import sys
import numpy as np
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
sys.setrecursionlimit(10 ** 9)
def find_squares_opt(array):
... | [
1,
396,
910,
338,
263,
4559,
5132,
2471,
29889,
13,
5215,
931,
13,
5215,
2090,
312,
8789,
13,
5215,
10876,
13,
5215,
12655,
408,
7442,
13,
13,
29937,
5254,
1383,
2027,
29974,
29943,
29896,
29900,
304,
6222,
372,
470,
5191,
372,
411,
... |
myproject/myproject/apps/sample_rest/urls.py | gabfl/sample-django | 1 | 58622 | <filename>myproject/myproject/apps/sample_rest/urls.py
from django.urls import path
from rest_framework import routers, serializers, viewsets
from . import views
urlpatterns = [
path('', views.hello),
path('users', views.users),
path('user/<int:user_id>', views.user),
path('parse', views.parseJson),
]... | [
1,
529,
9507,
29958,
1357,
4836,
29914,
1357,
4836,
29914,
13371,
29914,
11249,
29918,
5060,
29914,
26045,
29889,
2272,
13,
3166,
9557,
29889,
26045,
1053,
2224,
13,
3166,
1791,
29918,
4468,
1053,
16053,
2153,
29892,
7797,
19427,
29892,
177... |
app.py | chiselko6/scrabble | 2 | 194540 | import os
from threading import Thread
from flask import Flask, current_app
from scrabble.engine import ServerEngine
app = Flask(__name__)
app.config['PORT'] = os.environ.get('PORT', 5678)
@app.before_first_request
def start_server():
engine = ServerEngine()
t = Thread(target=engine.run, args=(None, app.... | [
1,
1053,
2897,
13,
3166,
3244,
292,
1053,
10480,
13,
13,
3166,
29784,
1053,
2379,
1278,
29892,
1857,
29918,
932,
13,
13,
3166,
885,
4201,
569,
29889,
10599,
1053,
5656,
12412,
13,
13,
932,
353,
2379,
1278,
22168,
978,
1649,
29897,
13,... |
scripts/convertDiagnoseTargets2Table.py | dgaston/kvasir | 0 | 81379 | <filename>scripts/convertDiagnoseTargets2Table.py
__author__ = 'dan'
import sys
import argparse
import csv
import vcf
import pybedtools
import tabix
from collections import defaultdict
#Arguments and commenad line parsing
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--input', help="Input vcf file")
p... | [
1,
529,
9507,
29958,
16713,
29914,
13441,
12130,
4211,
852,
8667,
29879,
29906,
3562,
29889,
2272,
13,
1649,
8921,
1649,
353,
525,
18386,
29915,
13,
13,
5215,
10876,
13,
5215,
1852,
5510,
13,
5215,
11799,
13,
5215,
325,
6854,
13,
5215,
... |
config/kube.py | sg893052/sonic-utilities | 91 | 150817 | <reponame>sg893052/sonic-utilities<gh_stars>10-100
import click
from utilities_common.cli import AbbreviationGroup, pass_db
from .utils import log
# DB Field names
KUBE_SERVER_TABLE_NAME = "KUBERNETES_MASTER"
KUBE_SERVER_TABLE_KEY = "SERVER"
KUBE_SERVER_IP = "ip"
KUBE_SERVER_PORT = "port"
KUBE_SERVER_DISABLE = "disa... | [
1,
529,
276,
1112,
420,
29958,
5311,
29947,
29929,
29941,
29900,
29945,
29906,
29914,
1100,
293,
29899,
4422,
1907,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29899,
29896,
29900,
29900,
13,
5215,
2828,
13,
13,
3166,
3667,
1907,
... |
EXP/S2-048/uns2-048.py | Octoberr/swm0920 | 2 | 196902 | <reponame>Octoberr/swm0920
#coding:utf-8
'''
测试没有成功
2018/06/27
'''
import sys
import requests
requests.packages.urllib3.disable_warnings()
def poccheck(url, cmd='whoami'):
result = False
header = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) C... | [
1,
529,
276,
1112,
420,
29958,
25375,
4950,
29878,
29914,
2774,
29885,
29900,
29929,
29906,
29900,
13,
29937,
29883,
3689,
29901,
9420,
29899,
29947,
13,
12008,
13,
31851,
31787,
31423,
30417,
30494,
31134,
13,
29906,
29900,
29896,
29947,
2... |
src/settings/constants.py | rpSebastian/LeducPoker | 1 | 181895 | <filename>src/settings/constants.py
from base import Players, NodeTypes
class Constants():
def __init__(self):
# the number of players in the game
self.players_count = 2
# the number of betting rounds in the game
self.streets_count = 2
self.suit_count = 2
self.rank... | [
1,
529,
9507,
29958,
4351,
29914,
11027,
29914,
3075,
1934,
29889,
2272,
13,
3166,
2967,
1053,
7412,
414,
29892,
9071,
10562,
13,
13,
13,
1990,
5798,
1934,
7295,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
396,
278,
1353,
... |
src/AeroelasticSE/FAST_mdao/DLCrunner - Kopie.py | BecMax/AeroelasticSE_WG | 0 | 170483 | <reponame>BecMax/AeroelasticSE_WG
"""
Demonstration of setting up an OpenMDAO 1.x problem using the FST8Workflow component
(in FST8_aeroelasticsolver), which executes the FST8 reader, writer, and wrapper and assigns
all variables in the FAST outlist to OpenMDAO 'Unknowns'. It also
implements an "input config" function ... | [
1,
529,
276,
1112,
420,
29958,
29933,
687,
7976,
29914,
29909,
1489,
295,
6288,
1660,
29918,
29956,
29954,
13,
15945,
29908,
13,
29928,
9857,
710,
362,
310,
4444,
701,
385,
4673,
5773,
29909,
29949,
29871,
29896,
29889,
29916,
1108,
773,
... |
config.py | wangyida/voxel-dcgan | 1 | 35908 | nz = 512 # noize vector size
nsf = 4 # encoded voxel size, scale factor
nvx = 32 # output voxel size
batch_size = 64
learning_rate = 2e-4
dataset_path_i = "/media/wangyida/D0-P1/database/ShapeNetCore.v2/*/*/*/model_normalized.binvox.thinned"
dataset_path_o = "/media/wangyida/D0-P1/database/ShapeNetCore.v2/*/*/*/model_... | [
1,
302,
29920,
353,
29871,
29945,
29896,
29906,
396,
694,
675,
4608,
2159,
13,
1983,
29888,
353,
29871,
29946,
396,
18511,
992,
29916,
295,
2159,
29892,
6287,
7329,
13,
29876,
29894,
29916,
353,
29871,
29941,
29906,
396,
1962,
992,
29916,... |
TP2 - Sim/Ej_6/script.py | lucasliano/TC2 | 0 | 58678 | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import numpy as np
import matplotlib.pyplot as plt
from splane import pzmap, grpDelay, bodePlot, convert2SOS
from scipy import signal
# Esta es una liberia tomada de la comunidad [https://stackoverflow.com/questions/35304245/multiply-scipy... | [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
15945,
29908,
13,
29903,
2272,
672,
14059,
13,
13,
4013,
338,
263,
13201,
2471,
934,
29889,
13,
15945,
29908,
13,
5215,
12655,
408,
7442,
13,
5215,
228... |
Vokeur/website/migrations/0022_auto_20190616_1150.py | lsdr1999/Project | 0 | 198318 | # Generated by Django 2.2.1 on 2019-06-16 11:50
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('website', '0021_auto_20190614_1538'),
]
operations = [
migrations.RemoveField(
model_name='antw... | [
1,
396,
3251,
630,
491,
15337,
29871,
29906,
29889,
29906,
29889,
29896,
373,
29871,
29906,
29900,
29896,
29929,
29899,
29900,
29953,
29899,
29896,
29953,
29871,
29896,
29896,
29901,
29945,
29900,
13,
13,
3166,
9557,
29889,
2585,
1053,
9725,
... |
manuscript/img-src/prepie.py | ssloy/least-squares-course | 129 | 173519 | <filename>manuscript/img-src/prepie.py
import numpy as np
fa = 1 # left constraint
fb = 3 # right constraint
n = 40
x = np.linspace(0, 2*np.pi, n)
g = [np.sin(p) for p in x]
A = np.matrix(np.zeros((n-1,n-2)))
b = np.matrix(np.zeros((n-1,1)))
A[0,0] = 1
b[0,0] = fa + g[1]-g[0]
A[n-2, n-3] = -1
b[n-2,0] ... | [
1,
529,
9507,
29958,
1171,
375,
924,
29914,
2492,
29899,
4351,
29914,
1457,
12343,
29889,
2272,
13,
5215,
12655,
408,
7442,
13,
13,
5444,
353,
29871,
29896,
396,
2175,
7276,
13,
14943,
353,
29871,
29941,
396,
1492,
7276,
13,
29876,
353,... |
setup.py | williamgilpin/pypdb_legacy | 0 | 15977 | <reponame>williamgilpin/pypdb_legacy
from setuptools import setup
setup(
name = 'pypdb',
packages = ['pypdb'], # same as 'name'
version = '1.310',
install_requires=[
'xmltodict',
'beautifulsoup4',
'requests'
],
description = 'A Python wrapper for the RCSB Protein Data Bank (PDB) API',
... | [
1,
529,
276,
1112,
420,
29958,
14043,
2829,
29887,
309,
12687,
29914,
29886,
1478,
2585,
29918,
1397,
4135,
13,
3166,
731,
21245,
8789,
1053,
6230,
13,
13,
13,
14669,
29898,
13,
29871,
1024,
353,
525,
29886,
1478,
2585,
742,
13,
29871,
... |
code/models/concrete_dropout.py | yannick-t/probabilistic_forecasting_of_energy_time_series_using_deep_learning | 2 | 167003 | # Code based on https://github.com/yaringal/ConcreteDropout
# License:
# MIT License
#
# Copyright (c) 2017
#
# 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 wi... | [
1,
396,
5920,
2729,
373,
2045,
597,
3292,
29889,
510,
29914,
29891,
4362,
284,
29914,
1168,
9084,
15063,
449,
13,
29937,
19245,
29901,
13,
29937,
341,
1806,
19245,
13,
29937,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,... |
tests/pouw/nods/decentralized/test_committee_candidate.py | projectpai/pouw-main-iteration | 11 | 133353 | <reponame>projectpai/pouw-main-iteration
import random
import time
import uuid
import mock
import pytest
import yaml
from mock import MagicMock, PropertyMock
import pai.pouw.nodes.decentralized.committee_candidate
from pai.pouw.constants import CLIENT_TASK_CHANNEL, WAIT_TIME_AFTER_MINIMAL_NUMBER_OF_NODES_HAS_REGISTER... | [
1,
529,
276,
1112,
420,
29958,
4836,
29886,
1794,
29914,
29886,
7100,
29899,
3396,
29899,
1524,
362,
13,
5215,
4036,
13,
5215,
931,
13,
5215,
318,
5416,
13,
13,
5215,
11187,
13,
5215,
11451,
1688,
13,
5215,
343,
8807,
13,
3166,
11187,... |
bfs.py | ayush9304/Treasure-Hunter | 0 | 1607959 | import mazeGenerator
class Queue:
def __init__(self):
self.list = []
self.front = 0
self.last = -1
def add(self, node):
self.list.append(node)
self.last = self.last + 1
def remove(self):
if self.front > self.last:
raise Exception("Underflow!")
... | [
1,
1053,
611,
911,
21575,
13,
13,
1990,
5462,
434,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1583,
29889,
1761,
353,
5159,
13,
4706,
1583,
29889,
8862,
353,
29871,
29900,
13,
4706,
1583,
29889,
4230,
353,
448,
298... |
CoRRN.py | ZhengPeng7/CoRRN-Pytorch | 2 | 166432 | import torch
import torch.nn as nn
from torchvision import models
class Conv2D_BN_activa(nn.Module):
def __init__(
self, in_channels, out_channels, kernel_size, stride, padding=0,
dilation=1, if_bn=True, activation='relu', bias=None, initializer=None, transpose=False
):
super(C... | [
1,
1053,
4842,
305,
13,
5215,
4842,
305,
29889,
15755,
408,
302,
29876,
13,
3166,
4842,
305,
4924,
1053,
4733,
13,
13,
13,
1990,
1281,
29894,
29906,
29928,
29918,
29933,
29940,
29918,
627,
4244,
29898,
15755,
29889,
7355,
1125,
13,
1678... |
wikipediabase/persistentkv.py | fakedrake/WikipediaBase | 1 | 21388 | """
Some persistent maps (gdbm) require special encoding of keys
and/or values. This is an abstraction for these kinds of quirks.
"""
from itertools import imap
import collections
import gdbm as dbm
import json
from sqlitedict import SqliteDict
import os
class EncodedDict(collections.MutableMapping):
"""
Sub... | [
1,
9995,
13,
9526,
28152,
11053,
313,
29887,
2585,
29885,
29897,
1996,
4266,
8025,
310,
6611,
13,
392,
29914,
272,
1819,
29889,
910,
338,
385,
27086,
428,
363,
1438,
17690,
310,
439,
27064,
29889,
13,
15945,
29908,
13,
13,
3166,
4256,
... |
web/apps/web_copo/context_processors.py | rpatil524/COPO | 0 | 171273 | <reponame>rpatil524/COPO
__author__ = '<EMAIL> - 27/05/15'
from dal import Profile_Status_Info
def get_status(request):
# call method to obtain number of profiles which have outstanding issues
issues = Profile_Status_Info().get_profiles_status()
if issues['num_issues'] == 0:
return {'num_issues': ... | [
1,
529,
276,
1112,
420,
29958,
29878,
5031,
309,
29945,
29906,
29946,
29914,
3217,
13152,
13,
1649,
8921,
1649,
353,
12801,
26862,
6227,
29958,
448,
29871,
29906,
29955,
29914,
29900,
29945,
29914,
29896,
29945,
29915,
13,
3166,
2959,
1053,... |
fastq/randomly_sample_fastq.py | linsalrob/EdwardsLab | 30 | 179774 | """
Randomly sample a fraction of a fastq file and just create one file
Note that if -p is 100 you will randomize the order of sequences in the file
"""
import os
import sys
import argparse
from random import sample
from roblib import stream_fastq, message
__author__ = '<NAME>'
__copyright__ = 'Copyright 2020, <NAME... | [
1,
9995,
13,
17875,
368,
4559,
263,
15958,
310,
263,
5172,
29939,
934,
322,
925,
1653,
697,
934,
13,
13,
9842,
393,
565,
448,
29886,
338,
29871,
29896,
29900,
29900,
366,
674,
4036,
675,
278,
1797,
310,
15602,
297,
278,
934,
13,
159... |
predictor.py | WangShouDao/ecs | 1 | 119527 | <gh_stars>1-10
def count_time(time1, time2):
monthDay = [31,28,31,30,31,30,31,31,30,31,30,31]
if time1[0] % 4 !=0:
if time2[1] == time1[1]:
count = time2[2] - time1[2]
else:
count = time2[2] - time1[2] + monthDay[time1[1] - 1]
elif time1[0] % 400 != 0:
if tim... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
1753,
2302,
29918,
2230,
29898,
2230,
29896,
29892,
931,
29906,
1125,
13,
1678,
4098,
12742,
353,
518,
29941,
29896,
29892,
29906,
29947,
29892,
29941,
29896,
29892,
29... |
counting.py | codecakes/random_games | 0 | 1601024 |
from collections import Counter
def counting(arr):
'''creating an indexed counting array using Optimal Counter module'''
count = Counter(arr)
return [count.get(i, 0) for i in xrange(max(count.viewkeys()))]
| [
1,
29871,
13,
3166,
16250,
1053,
315,
5336,
13,
13,
1753,
21248,
29898,
2749,
1125,
13,
1678,
14550,
1037,
1218,
385,
27541,
21248,
1409,
773,
20693,
3039,
315,
5336,
3883,
12008,
13,
1678,
2302,
353,
315,
5336,
29898,
2749,
29897,
13,
... |
python-resources/Translate.py | pasteben/bioinformatics-app | 0 | 136989 | <reponame>pasteben/bioinformatics-app
# DNA Toolset/Code testing file
from DNAToolkit import *
import sys
import json
import base64
content = json.loads(base64.b64decode(sys.argv[1]))
if "dataset" in content:
dataset = content["dataset"]
FASTADict = {}
FASTALabel = ""
for line in dataset.splitlines... | [
1,
529,
276,
1112,
420,
29958,
16179,
1785,
29914,
24840,
262,
4830,
1199,
29899,
932,
13,
29937,
25348,
21704,
842,
29914,
3399,
6724,
934,
13,
3166,
360,
29940,
1299,
1507,
7354,
1053,
334,
13,
5215,
10876,
13,
5215,
4390,
13,
5215,
... |
core/management/commands/sync_events_dashboard.py | vanessa/djangogirls | 446 | 43268 | import datetime
import re
import time
from collections import namedtuple
from django.conf import settings
from django.core.management.base import BaseCommand
from trello import ResourceUnavailable, TrelloClient
from core.models import Event
# Create new command
class Command(BaseCommand):
help = 'Syncs event i... | [
1,
1053,
12865,
13,
5215,
337,
13,
5215,
931,
13,
3166,
16250,
1053,
4257,
23583,
13,
13,
3166,
9557,
29889,
5527,
1053,
6055,
13,
3166,
9557,
29889,
3221,
29889,
21895,
29889,
3188,
1053,
7399,
6255,
13,
3166,
2578,
29880,
417,
1053,
... |
model_time_shift.py | papersubmittest/subm | 2 | 97980 | import sys
import time
import torch
import random
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from util_torch import graphs_re,choice_by_prob,gumbel_softmax,graphs_threshold
class GNN_Block(nn.Module):
def __init__(self,input_size,output_size,gn... | [
1,
1053,
10876,
13,
5215,
931,
29871,
13,
5215,
4842,
305,
13,
5215,
4036,
29871,
13,
13,
5215,
12655,
408,
7442,
13,
5215,
4842,
305,
29889,
15755,
408,
302,
29876,
13,
5215,
4842,
305,
29889,
15755,
29889,
2220,
284,
408,
383,
13,
... |
scripts/data_handeling/calculate_areas_from_json.py | dekelmeirom/pathologylab | 0 | 139566 | <gh_stars>0
#!/usr/bin/env python
import json
import numpy as np
import os
import csv
import argparse
def poly_area(x, y, absoluteValue = True):
result = 0.5 * np.abs(np.dot(x[:-1], y[1:]) + x[-1]*y[0] - np.dot(y[:-1], x[1:]) - y[-1]*x[0])
if absoluteValue:
return abs(result)
else:
return... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
13,
13,
5215,
4390,
13,
5215,
12655,
408,
7442,
13,
5215,
2897,
13,
5215,
11799,
13,
5215,
1852,
5510,
13,
13,
1753,
15680,
29918,
... |
tests/test_vtkgenerator.py | donghaozhang/swc2vtk | 9 | 99094 | <gh_stars>1-10
# -*- coding: utf-8 -*-
import unittest
import os
import swc2vtk
class TestVtkGenerator(unittest.TestCase):
@classmethod
def setUpClass(cls):
pass
@classmethod
def tearDownClass(cls):
pass
def setUp(self):
self.swc_file_path = os.path.join('tests', 'simple.... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
5215,
443,
27958,
13,
5215,
2897,
13,
5215,
2381,
29883,
29906,
29894,
11178,
13,
... |
logger.py | PanDAWMS/harvester_monitoring | 0 | 51009 | import os
import logging
from pathlib import Path
class ServiceLogger:
def __init__(self, name, file, loglevel='DEBUG'):
p = str(Path(file).parent) + '/logs/'
i = 0
while True:
if not os.path.exists(p):
i = i + 1
p = str(Path(file).parents[i]) +... | [
1,
1053,
2897,
13,
5215,
12183,
13,
13,
3166,
2224,
1982,
1053,
10802,
13,
13,
13,
1990,
6692,
16363,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1024,
29892,
934,
29892,
1480,
5563,
2433,
18525,
29374,
13,
4706,
282,
353,
8... |
nlp-disaster-analysis/feature.py | TeamAntriksh/Automated-Detection-of-Hazards | 0 | 191489 | <reponame>TeamAntriksh/Automated-Detection-of-Hazards
import collections
import functools
import numpy as np
import scipy.sparse
named_features = collections.defaultdict(list)
def feature(name):
'''
decorator for specific classifier, the wrapped function should accept as an input a corpus and return a mat... | [
1,
529,
276,
1112,
420,
29958,
19409,
13448,
5357,
845,
29914,
28451,
630,
29899,
29928,
2650,
428,
29899,
974,
29899,
29950,
834,
3163,
13,
5215,
16250,
13,
5215,
2090,
312,
8789,
13,
5215,
12655,
408,
7442,
13,
5215,
4560,
2272,
29889... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.