max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
challenges/ch-28/quick_sort/quick_sort/quick_sort/quick_sort.py | Talafhamohammad-cloud/data-structures-and-algorithms-python | 0 | 6625651 | arr1 = [8, 4, 23, 42, 16, 15]
arr2 = [20, 18, 12, 8, 5, -2]
arr3 = [5, 12, 7, 5, 5, 7]
arr4 = [2, 3, 5, 7, 13, 11]
def partition(array, low, high):
pivot = array[high]
i = low - 1
for j in range(low, high):
if array[j] <= pivot:
i = i + 1
(array[i], array[j]) = (array[j], array[i])
(array[i +... | arr1 = [8, 4, 23, 42, 16, 15]
arr2 = [20, 18, 12, 8, 5, -2]
arr3 = [5, 12, 7, 5, 5, 7]
arr4 = [2, 3, 5, 7, 13, 11]
def partition(array, low, high):
pivot = array[high]
i = low - 1
for j in range(low, high):
if array[j] <= pivot:
i = i + 1
(array[i], array[j]) = (array[j], array[i])
(array[i +... | de | 0.797399 | ##############################################################") ##############################################################") ##############################################################") ##############################################################") ############################################################... | 3.663706 | 4 |
utils/scripts/OOOlevelGen/src/levels/The_Grand_Final.py | fullscreennl/monkeyswipe | 0 | 6625652 | <reponame>fullscreennl/monkeyswipe<filename>utils/scripts/OOOlevelGen/src/levels/The_Grand_Final.py<gh_stars>0
import LevelBuilder
from sprites import *
def render(name,bg):
lb = LevelBuilder.LevelBuilder(name+".plist",background=bg)
lb.addObject(Hero.HeroSprite(x=160,y=40))
lb.addObject(EnemyBucketW... | import LevelBuilder
from sprites import *
def render(name,bg):
lb = LevelBuilder.LevelBuilder(name+".plist",background=bg)
lb.addObject(Hero.HeroSprite(x=160,y=40))
lb.addObject(EnemyBucketWithStar.EnemyBucketWithStarSprite(width=150,height=100, x=240, y=160, num_enemies=30, enemy_size=20))
... | en | 0.205868 | #lb.addObject(CyclingEnemyObject.CyclingEnemyObjectSprite(name='num2',x=420,y=160,width=80,height=80,enemy_size=20)) #lb.addObject(Rotor.RotorSprite(x=180,y=160,speed=1,torque=10000)) #lb.addObject(Nut.NutSprite(x=32,y=272, eventName='onNutHitAll')) | 2.654472 | 3 |
routemaster/config/tests/test_next_states.py | thread/routemaster | 13 | 6625653 | <reponame>thread/routemaster
import pytest
from routemaster.config import (
NoNextStates,
ConstantNextState,
ContextNextStates,
ContextNextStatesOption,
)
def test_constant_next_state():
next_states = ConstantNextState(state='foo')
assert next_states.all_destinations() == ['foo']
assert n... | import pytest
from routemaster.config import (
NoNextStates,
ConstantNextState,
ContextNextStates,
ContextNextStatesOption,
)
def test_constant_next_state():
next_states = ConstantNextState(state='foo')
assert next_states.all_destinations() == ['foo']
assert next_states.next_state_for_lab... | none | 1 | 2.099654 | 2 | |
bases.py | rhbvkleef/aoc-2018 | 0 | 6625654 | # Copyright 2018 <NAME>
# This library is licensed under the BSD 3-clause license. This means that you
# are allowed to do almost anything with it. For exact terms, please refer to
# the attached license file.
import os
from abc import ABC, abstractmethod
from unittest import TestCase
from typing import Tuple, Any, ... | # Copyright 2018 <NAME>
# This library is licensed under the BSD 3-clause license. This means that you
# are allowed to do almost anything with it. For exact terms, please refer to
# the attached license file.
import os
from abc import ABC, abstractmethod
from unittest import TestCase
from typing import Tuple, Any, ... | en | 0.957602 | # Copyright 2018 <NAME> # This library is licensed under the BSD 3-clause license. This means that you # are allowed to do almost anything with it. For exact terms, please refer to # the attached license file. # noinspection PyPep8Naming | 3.436379 | 3 |
openmdao/util/array_util.py | colinxs/OpenMDAO | 17 | 6625655 | """ Some useful array utilities. """
import sys
from six.moves import range, zip
import numpy as np
from numpy import ndarray
from itertools import product
def array_idx_iter(shape):
"""
Return an iterator over the indices into a n-dimensional array.
Args
----
shape : tuple
shape of the ... | """ Some useful array utilities. """
import sys
from six.moves import range, zip
import numpy as np
from numpy import ndarray
from itertools import product
def array_idx_iter(shape):
"""
Return an iterator over the indices into a n-dimensional array.
Args
----
shape : tuple
shape of the ... | en | 0.771655 | Some useful array utilities. Return an iterator over the indices into a n-dimensional array. Args ---- shape : tuple shape of the array. Given a number of divisions and the size of an array, chop the array up into pieces according to number of divisions, keeping the distribution of entries ... | 3.264871 | 3 |
data_process/vocab.py | maopademiao/mams | 0 | 6625656 | import operator
from src.module.utils.constants import PAD, UNK, ASPECT
class Vocab(object):
def __init__(self):
self._count_dict = dict()
self._predefined_list = [PAD, UNK, ASPECT]
def add(self, word):
if word in self._count_dict:
self._count_dict[word] += 1
else:... | import operator
from src.module.utils.constants import PAD, UNK, ASPECT
class Vocab(object):
def __init__(self):
self._count_dict = dict()
self._predefined_list = [PAD, UNK, ASPECT]
def add(self, word):
if word in self._count_dict:
self._count_dict[word] += 1
else:... | none | 1 | 3.037024 | 3 | |
Day 04/MonkandNiceStrings.py | sandeep-krishna/100DaysOfCode | 0 | 6625657 | '''
*** Problem ***
Monk and Nice Strings
Monk's best friend Micro's birthday is coming up. Micro likes Nice Strings very much, so Monk decided to gift him one. Monk is having N nice strings, so he'll choose one from those. But before he selects one, he need to know the Niceness value of all of those. Strings are arra... | '''
*** Problem ***
Monk and Nice Strings
Monk's best friend Micro's birthday is coming up. Micro likes Nice Strings very much, so Monk decided to gift him one. Monk is having N nice strings, so he'll choose one from those. But before he selects one, he need to know the Niceness value of all of those. Strings are arra... | en | 0.936643 | *** Problem *** Monk and Nice Strings Monk's best friend Micro's birthday is coming up. Micro likes Nice Strings very much, so Monk decided to gift him one. Monk is having N nice strings, so he'll choose one from those. But before he selects one, he need to know the Niceness value of all of those. Strings are arranged... | 3.88185 | 4 |
pagination_vm/merge.py | recs12/pagination_vm | 0 | 6625658 | from PyPDF4 import PdfFileReader, PdfFileWriter
from PyPDF4.pdf import PageObject
def paginate_pdf(pdf_name, number_page, pagination_template):
"""Create a new pdf with the pagination footer
starting from the second page of the manual.
"""
writer = PdfFileWriter()
stream_manuals = open(pdf_name, "rb")... | from PyPDF4 import PdfFileReader, PdfFileWriter
from PyPDF4.pdf import PageObject
def paginate_pdf(pdf_name, number_page, pagination_template):
"""Create a new pdf with the pagination footer
starting from the second page of the manual.
"""
writer = PdfFileWriter()
stream_manuals = open(pdf_name, "rb")... | en | 0.538737 | Create a new pdf with the pagination footer starting from the second page of the manual. # pageNumber: 0 # Stack blank page # width = 1224 # height = 792 # Stack pagination # Stack manual # New name of the output pdf file. | 3.359417 | 3 |
stupid/meta.py | masell/stupid | 0 | 6625659 | from abc import ABCMeta
from dataclasses import dataclass
class StupidMeta(ABCMeta):
def __new__(mcls, name, bases, namespace, **kwargs):
inherited_annotations = {}
for base in bases:
try:
inherited_annotations.update(base.__annotations__)
except AttributeErr... | from abc import ABCMeta
from dataclasses import dataclass
class StupidMeta(ABCMeta):
def __new__(mcls, name, bases, namespace, **kwargs):
inherited_annotations = {}
for base in bases:
try:
inherited_annotations.update(base.__annotations__)
except AttributeErr... | none | 1 | 2.663021 | 3 | |
compressible_examples/schur_complement_solver.py | thomasgibson/firedrake-hybridization | 0 | 6625660 | <reponame>thomasgibson/firedrake-hybridization
from firedrake import (split, LinearVariationalProblem, Constant,
LinearVariationalSolver, TestFunctions, TrialFunctions,
TestFunction, TrialFunction, lhs, rhs, DirichletBC, FacetNormal,
div, dx, jump, av... | from firedrake import (split, LinearVariationalProblem, Constant,
LinearVariationalSolver, TestFunctions, TrialFunctions,
TestFunction, TrialFunction, lhs, rhs, DirichletBC, FacetNormal,
div, dx, jump, avg, dS_v, dS_h, ds_v, ds_t, ds_b, ds_tb, inner,
... | en | 0.800861 | Timestepping linear solver object for the compressible equations in theta-pi formulation with prognostic variables u,rho,theta. This solver follows the following strategy: (1) Analytically eliminate theta (introduces error near topography) (2) Solve resulting system for (u,rho) using a Schur preconditio... | 2.15922 | 2 |
test/input_gen/genModelTests.py | dongju-chae/nntrainer | 0 | 6625661 | <gh_stars>0
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
##
# Copyright (C) 2020 <NAME> <<EMAIL>>
#
# @file getModelTests.py
# @date 13 October 2020
# @brief Generate tc using KerasRecorder
# @author <NAME> <<EMAIL>>
import warnings
from recorder import KerasRecorder
with warnings.catch_warnings():
... | #!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
##
# Copyright (C) 2020 <NAME> <<EMAIL>>
#
# @file getModelTests.py
# @date 13 October 2020
# @brief Generate tc using KerasRecorder
# @author <NAME> <<EMAIL>>
import warnings
from recorder import KerasRecorder
with warnings.catch_warnings():
warnings.... | en | 0.221761 | #!/usr/bin/env python3 # SPDX-License-Identifier: Apache-2.0 ## # Copyright (C) 2020 <NAME> <<EMAIL>> # # @file getModelTests.py # @date 13 October 2020 # @brief Generate tc using KerasRecorder # @author <NAME> <<EMAIL>> | 2.196177 | 2 |
moto/route53/responses.py | orenmazor/moto | 1 | 6625662 | from __future__ import unicode_literals
from jinja2 import Template
from six.moves.urllib.parse import parse_qs, urlparse
from moto.core.responses import BaseResponse
from .models import route53_backend
import xmltodict
class Route53(BaseResponse):
def list_or_create_hostzone_response(self, request, full_url, he... | from __future__ import unicode_literals
from jinja2 import Template
from six.moves.urllib.parse import parse_qs, urlparse
from moto.core.responses import BaseResponse
from .models import route53_backend
import xmltodict
class Route53(BaseResponse):
def list_or_create_hostzone_response(self, request, full_url, he... | en | 0.32114 | # in boto3, this field is set directly in the xml # if a VPC subsection is only included in xmls params when private_zone=True, # see boto: boto/route53/connection.py # sort by names, but with domain components reversed # see http://boto3.readthedocs.io/en/latest/reference/services/route53.html#Route53.Client.list_host... | 1.951159 | 2 |
pyiid/tests/test_calc/test_calc_1d.py | ZhouHUB/pyIID | 0 | 6625663 | from pyiid.tests import *
from pyiid.experiments.elasticscatter import ElasticScatter
from pyiid.calc.calc_1d import Calc1D
__author__ = 'christopher'
def check_meta(value):
value[0](value[1:])
def check_nrg(value):
"""
Check two processor, algorithm pairs against each other for PDF energy
Paramet... | from pyiid.tests import *
from pyiid.experiments.elasticscatter import ElasticScatter
from pyiid.calc.calc_1d import Calc1D
__author__ = 'christopher'
def check_meta(value):
value[0](value[1:])
def check_nrg(value):
"""
Check two processor, algorithm pairs against each other for PDF energy
Paramet... | en | 0.567802 | Check two processor, algorithm pairs against each other for PDF energy Parameters ---------- value: list or tuple The values to use in the tests # setup Check two processor, algorithm pairs against each other for PDF forces :param value: :return: # setup # '-s', # '--nocapture', # env={"NOS... | 2.167449 | 2 |
django_blog/admin.py | Emiliemorais/blog_django_plugin | 0 | 6625664 | <gh_stars>0
from django.contrib import admin
from .models import Post
class PostAdmin(admin.ModelAdmin):
pass
admin.site.register(Post, PostAdmin) | from django.contrib import admin
from .models import Post
class PostAdmin(admin.ModelAdmin):
pass
admin.site.register(Post, PostAdmin) | none | 1 | 1.382541 | 1 | |
mmcls/models/backbones/mobilenet_v2.py | agim-a/mmclassification | 29 | 6625665 | import logging
import torch.nn as nn
import torch.utils.checkpoint as cp
from mmcv.cnn import ConvModule, constant_init, kaiming_init
from mmcv.runner import load_checkpoint
from torch.nn.modules.batchnorm import _BatchNorm
from mmcls.models.utils import make_divisible
from ..builder import BACKBONES
from .base_backb... | import logging
import torch.nn as nn
import torch.utils.checkpoint as cp
from mmcv.cnn import ConvModule, constant_init, kaiming_init
from mmcv.runner import load_checkpoint
from torch.nn.modules.batchnorm import _BatchNorm
from mmcls.models.utils import make_divisible
from ..builder import BACKBONES
from .base_backb... | en | 0.696937 | InvertedResidual block for MobileNetV2. Args: in_channels (int): The input channels of the InvertedResidual block. out_channels (int): The output channels of the InvertedResidual block. stride (int): Stride of the middle (first) 3x3 convolution. expand_ratio (int): adjusts number of... | 2.490853 | 2 |
src/mtensorflow/tf_linear_regression.py | mumupy/mmdeeplearning | 9 | 6625666 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/10/23 10:43
# @Author : ganliang
# @File : tf_linear_regression.py
# @Desc : 单特征的线性回归
import tensorflow as tf
from tensorflow.contrib.learn.python.learn import datasets
import numpy as np
from matplotlib import pyplot as plt
from src.config import ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/10/23 10:43
# @Author : ganliang
# @File : tf_linear_regression.py
# @Desc : 单特征的线性回归
import tensorflow as tf
from tensorflow.contrib.learn.python.learn import datasets
import numpy as np
from matplotlib import pyplot as plt
from src.config import ... | zh | 0.798739 | #!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/10/23 10:43 # @Author : ganliang # @File : tf_linear_regression.py # @Desc : 单特征的线性回归 数据归一化处理 :param X: :return: 获取到数据集 :return: # X_train=normaize(X_train) 定义模型 :return: # 定义X,Y占位符 # 定义权重和偏差 定义损失函数 :return: # 线性回归模型 # 平方损失 获取优化方... | 3.140103 | 3 |
Lib/lib2to3/fixes/fix_dict.py | orestis/python | 1 | 6625667 | <filename>Lib/lib2to3/fixes/fix_dict.py
# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for dict methods.
d.keys() -> list(d.keys())
d.items() -> list(d.items())
d.values() -> list(d.values())
d.iterkeys() -> iter(d.keys())
d.iteritems() -> iter(d.items())... | <filename>Lib/lib2to3/fixes/fix_dict.py
# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for dict methods.
d.keys() -> list(d.keys())
d.items() -> list(d.items())
d.values() -> list(d.values())
d.iterkeys() -> iter(d.keys())
d.iteritems() -> iter(d.items())... | en | 0.55099 | # Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. Fixer for dict methods. d.keys() -> list(d.keys()) d.items() -> list(d.items()) d.values() -> list(d.values()) d.iterkeys() -> iter(d.keys()) d.iteritems() -> iter(d.items()) d.itervalues() -> iter(d.values()) Except ... | 2.289939 | 2 |
FWCore/Skeletons/python/cms.py | nistefan/cmssw | 0 | 6625668 | <gh_stars>0
#!/usr/bin/env python
#-*- coding: utf-8 -*-
#pylint: disable-msg=
"""
File : cms.py
Author : <NAME> <<EMAIL>>
Description: CMS-related utils
"""
# system modules
import os
import sys
# package modules
from FWCore.Skeletons.utils import code_generator
def config(tmpl, pkg_help, tmpl_dir):
"... | #!/usr/bin/env python
#-*- coding: utf-8 -*-
#pylint: disable-msg=
"""
File : cms.py
Author : <NAME> <<EMAIL>>
Description: CMS-related utils
"""
# system modules
import os
import sys
# package modules
from FWCore.Skeletons.utils import code_generator
def config(tmpl, pkg_help, tmpl_dir):
"Parse input ... | en | 0.511637 | #!/usr/bin/env python #-*- coding: utf-8 -*- #pylint: disable-msg= File : cms.py Author : <NAME> <<EMAIL>> Description: CMS-related utils # system modules # package modules # user give us arguments # need to walk Inject arguments parsed upstream into mk-scripts. The arguments are parsed by the different f... | 2.467916 | 2 |
crawl_ccass(mysql+proxyip)/crawl_ccass/middlewares.py | easy00000000/spider | 0 | 6625669 | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy.conf import settings
import random
class RandomUserAgentMiddleware(object):
def process_request(self, request, spider):
ua = ra... | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy.conf import settings
import random
class RandomUserAgentMiddleware(object):
def process_request(self, request, spider):
ua = ra... | en | 0.541728 | # -*- coding: utf-8 -*- # Define here the models for your spider middleware # # See documentation in: # http://doc.scrapy.org/en/latest/topics/spider-middleware.html | 2.575898 | 3 |
21/test/test_url_2_label_by_word_vector_controller_api.py | apitore/apitore-sdk-python | 3 | 6625670 | # coding: utf-8
"""
Url2Label by word vector APIs
Url to label by word2vec of contents.<BR />[Endpoint] https://api.apitore.com/api/21 # noqa: E501
OpenAPI spec version: 0.0.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import u... | # coding: utf-8
"""
Url2Label by word vector APIs
Url to label by word2vec of contents.<BR />[Endpoint] https://api.apitore.com/api/21 # noqa: E501
OpenAPI spec version: 0.0.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import u... | en | 0.613116 | # coding: utf-8 Url2Label by word vector APIs Url to label by word2vec of contents.<BR />[Endpoint] https://api.apitore.com/api/21 # noqa: E501 OpenAPI spec version: 0.0.1 Generated by: https://github.com/swagger-api/swagger-codegen.git # noqa: E501 Url2LabelByWordVectorControllerApi unit test stubs... | 2.580001 | 3 |
tin2dem/plane_math.py | lekks/tin2dem | 7 | 6625671 |
# https://www.geeksforgeeks.org/program-to-find-equation-of-a-plane-passing-through-3-points/
def equation_plane(p1, p2, p3):
(x1, y1, z1) = p1
(x2, y2, z2) = p2
(x3, y3, z3) = p3
a1 = x2 - x1
b1 = y2 - y1
c1 = z2 - z1
a2 = x3 - x1
b2 = y3 - y1
c2 = z3 - z1
a = b1 * c2 - b2 * c... |
# https://www.geeksforgeeks.org/program-to-find-equation-of-a-plane-passing-through-3-points/
def equation_plane(p1, p2, p3):
(x1, y1, z1) = p1
(x2, y2, z2) = p2
(x3, y3, z3) = p3
a1 = x2 - x1
b1 = y2 - y1
c1 = z2 - z1
a2 = x3 - x1
b2 = y3 - y1
c2 = z3 - z1
a = b1 * c2 - b2 * c... | en | 0.536825 | # https://www.geeksforgeeks.org/program-to-find-equation-of-a-plane-passing-through-3-points/ | 3.82157 | 4 |
mahjong/hand_calculating/yaku_list/sanshoku_douko.py | Enerccio/mahjong | 0 | 6625672 | <filename>mahjong/hand_calculating/yaku_list/sanshoku_douko.py
# -*- coding: utf-8 -*-
from mahjong.hand_calculating.yaku import Yaku
from mahjong.utils import is_pon, is_sou, is_pin, is_man, simplify
class SanshokuDoukou(Yaku):
"""
Three pon sets consisting of the same numbers in all three suits
"""
... | <filename>mahjong/hand_calculating/yaku_list/sanshoku_douko.py
# -*- coding: utf-8 -*-
from mahjong.hand_calculating.yaku import Yaku
from mahjong.utils import is_pon, is_sou, is_pin, is_man, simplify
class SanshokuDoukou(Yaku):
"""
Three pon sets consisting of the same numbers in all three suits
"""
... | en | 0.86291 | # -*- coding: utf-8 -*- Three pon sets consisting of the same numbers in all three suits # cast tile indices to 1..9 representation | 3.101743 | 3 |
openapi_spec_validator/handlers/file.py | sthagen/openapi-spec-validator | 1 | 6625673 | <filename>openapi_spec_validator/handlers/file.py<gh_stars>1-10
"""OpenAPI spec validator handlers file module."""
import io
import json
from yaml import load
from openapi_spec_validator.handlers.base import BaseHandler
from openapi_spec_validator.handlers.compat import SafeLoader
from openapi_spec_validator.handlers... | <filename>openapi_spec_validator/handlers/file.py<gh_stars>1-10
"""OpenAPI spec validator handlers file module."""
import io
import json
from yaml import load
from openapi_spec_validator.handlers.base import BaseHandler
from openapi_spec_validator.handlers.compat import SafeLoader
from openapi_spec_validator.handlers... | en | 0.315364 | OpenAPI spec validator handlers file module. OpenAPI spec validator file-like object handler. OpenAPI spec validator file path handler. | 2.340891 | 2 |
packages/serpent-msbuild/__init__.py | phr34k/serpent | 1 | 6625674 | <reponame>phr34k/serpent
import sys, os;
base_dir = os.path.dirname(os.path.realpath(__file__))
if sys.maxsize > 2**32:
sys.path.append( os.path.join(base_dir, "x64"))
else:
sys.path.append( os.path.join(base_dir, "x86")) | import sys, os;
base_dir = os.path.dirname(os.path.realpath(__file__))
if sys.maxsize > 2**32:
sys.path.append( os.path.join(base_dir, "x64"))
else:
sys.path.append( os.path.join(base_dir, "x86")) | none | 1 | 2.303981 | 2 | |
tensealstat/statistic/student_t_repeated_measures.py | kozzion/tensealstat | 6 | 6625675 | import math
from tensealstat.algebra.abstract_algebra import AbstractAlgebra
from tensealstat.statistic.abstract_statistic import AbstractStatistic
from tensealstat.statistic.test_assertion import TestAssertion
class StudentTRepeatedMeasures(object):
def encrypt_statistic(self, algebra:AbstractAlgebra, list_sam... | import math
from tensealstat.algebra.abstract_algebra import AbstractAlgebra
from tensealstat.statistic.abstract_statistic import AbstractStatistic
from tensealstat.statistic.test_assertion import TestAssertion
class StudentTRepeatedMeasures(object):
def encrypt_statistic(self, algebra:AbstractAlgebra, list_sam... | en | 0.923115 | #TODO these all need to get pickled properly or jsonsed or something so they can be moved over http | 2.823844 | 3 |
contrib/PyTorch/Official/cv/image_classification/SPNASNet_100_for_PyTorch/timm/models/layers/cond_conv2d.py | Ascend/modelzoo | 12 | 6625676 | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | en | 0.739719 | # Copyright 2020 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to... | 2.205783 | 2 |
scripts/get-relpath.py | cr1901/libmodem | 0 | 6625677 | <filename>scripts/get-relpath.py
#!/usr/bin/env python3
import os.path
import sys
if __name__ == "__main__":
print(os.path.relpath(sys.argv[1], sys.argv[2]))
| <filename>scripts/get-relpath.py
#!/usr/bin/env python3
import os.path
import sys
if __name__ == "__main__":
print(os.path.relpath(sys.argv[1], sys.argv[2]))
| fr | 0.221828 | #!/usr/bin/env python3 | 2.55193 | 3 |
bwdist.py | KitwareMedical/TubeTK-pypbm | 6 | 6625678 | """bwdist.py
"""
__license__ = "Apache License, Version 2.0"
__author__ = "<NAME>, Kitware Inc., 2013"
__email__ = "E-Mail: <EMAIL>"
__status__ = "Development"
from optparse import OptionParser
import SimpleITK as sitk
import numpy as np
import sys
import os
def invert(orgImg):
"""Compute image inverse.
... | """bwdist.py
"""
__license__ = "Apache License, Version 2.0"
__author__ = "<NAME>, Kitware Inc., 2013"
__email__ = "E-Mail: <EMAIL>"
__status__ = "Development"
from optparse import OptionParser
import SimpleITK as sitk
import numpy as np
import sys
import os
def invert(orgImg):
"""Compute image inverse.
... | en | 0.542937 | bwdist.py Compute image inverse. Paramters --------- orgImg : sitk.Image Input image. Returns ------- invImg : sitk.Image Inverse of input image. Print usage information Take a binary image, apply skeletonization and output an inverted Euclidean distance transform image. U... | 2.666479 | 3 |
apps/reports/util.py | commtrack/commtrack-old-to-del | 1 | 6625679 | <filename>apps/reports/util.py
"""
Utility functions for report framework
"""
import inspect
from reports.custom.all import default
def is_mod_function(mod, func):
'''Returns whether the object is a function in the module'''
return inspect.isfunction(func) and inspect.getmodule(func) == mod
def get_custom_re... | <filename>apps/reports/util.py
"""
Utility functions for report framework
"""
import inspect
from reports.custom.all import default
def is_mod_function(mod, func):
'''Returns whether the object is a function in the module'''
return inspect.isfunction(func) and inspect.getmodule(func) == mod
def get_custom_re... | en | 0.759609 | Utility functions for report framework Returns whether the object is a function in the module Get the reports module for a domain, if it exists. Otherwise this returns nothing Get the global reports module for a domain. Gets a domained report by name, checking first the explicit custom reports and then t... | 2.782321 | 3 |
setup.py | standanley/fault | 0 | 6625680 | <reponame>standanley/fault<filename>setup.py
"""
Setup file for fault
"""
from setuptools import setup
with open("README.md", "r") as fh:
LONG_DESCRIPTION = fh.read()
DESCRIPTION = """\
A Python package for testing hardware (part of the magma ecosystem)\
"""
setup(
name='fault',
version='2.0.19',
de... | """
Setup file for fault
"""
from setuptools import setup
with open("README.md", "r") as fh:
LONG_DESCRIPTION = fh.read()
DESCRIPTION = """\
A Python package for testing hardware (part of the magma ecosystem)\
"""
setup(
name='fault',
version='2.0.19',
description=DESCRIPTION,
scripts=[],
pa... | en | 0.692674 | Setup file for fault \ A Python package for testing hardware (part of the magma ecosystem)\ | 1.653795 | 2 |
examples/stock/urls.py | soapteam/soapfish | 20 | 6625681 | <gh_stars>10-100
from django.conf.urls import url
urlpatterns = [
url(r'^stock/soap11$', 'stock.web.views.dispatch11'),
url(r'^stock/soap12$', 'stock.web.views.dispatch12'),
url(r'^ws/ops$', 'stock.web.views.ops_dispatch'),
]
| from django.conf.urls import url
urlpatterns = [
url(r'^stock/soap11$', 'stock.web.views.dispatch11'),
url(r'^stock/soap12$', 'stock.web.views.dispatch12'),
url(r'^ws/ops$', 'stock.web.views.ops_dispatch'),
] | none | 1 | 1.281294 | 1 | |
icsv/instantCsv.py | bponsler/icsv | 1 | 6625682 | <reponame>bponsler/icsv<gh_stars>1-10
from copy import deepcopy
from os.path import exists
from icsv.base import Row, Col, Cell
class icsv:
'''The icsv class encapsulates the data contained in a single CSV
file.
A CSV consists of zero or more rows of information where each row
has one or more named ... | from copy import deepcopy
from os.path import exists
from icsv.base import Row, Col, Cell
class icsv:
'''The icsv class encapsulates the data contained in a single CSV
file.
A CSV consists of zero or more rows of information where each row
has one or more named columns. The names of the columns are ... | en | 0.616738 | The icsv class encapsulates the data contained in a single CSV file. A CSV consists of zero or more rows of information where each row has one or more named columns. The names of the columns are referred to as headers. The icsv class provides an interface for easily adding new data to a CSV, w... | 3.996339 | 4 |
release/scripts/mgear/rigbits/sdk_io.py | tk-aria/mgear4 | 72 | 6625683 | """Rigbits, SDK i/o
exportSDKs(["drivenNodeA", "drivenNodeB"], "path/to/desired/output.json")
importSDKs(path/to/desired/output.json)
# MIRRORING -------
# copy from source, say left, to target, right
copySDKsToNode("jacketFlap_L1_fk0_sdk",
"neck_C0_0_jnt",
"jacketFlap_R1_fk0_sdk")
# in... | """Rigbits, SDK i/o
exportSDKs(["drivenNodeA", "drivenNodeB"], "path/to/desired/output.json")
importSDKs(path/to/desired/output.json)
# MIRRORING -------
# copy from source, say left, to target, right
copySDKsToNode("jacketFlap_L1_fk0_sdk",
"neck_C0_0_jnt",
"jacketFlap_R1_fk0_sdk")
# in... | en | 0.7043 | Rigbits, SDK i/o exportSDKs(["drivenNodeA", "drivenNodeB"], "path/to/desired/output.json") importSDKs(path/to/desired/output.json) # MIRRORING ------- # copy from source, say left, to target, right copySDKsToNode("jacketFlap_L1_fk0_sdk", "neck_C0_0_jnt", "jacketFlap_R1_fk0_sdk") # inver... | 2.189811 | 2 |
gitlint/__init__.py | Lorac/gitlint | 0 | 6625684 | __version__ = "0.16.0dev"
| __version__ = "0.16.0dev"
| none | 1 | 1.023569 | 1 | |
slackest/channels.py | usserysig1/slackest | 7 | 6625685 | from .base_api import BaseAPI
from .utils import *
class Channels(BaseAPI):
"""Follows the Slack Channels API. See https://api.slack.com/methods"""
def create(self, name):
"""
Creates a public channel
:param name: The name
:type name: str
:return: A response object to ... | from .base_api import BaseAPI
from .utils import *
class Channels(BaseAPI):
"""Follows the Slack Channels API. See https://api.slack.com/methods"""
def create(self, name):
"""
Creates a public channel
:param name: The name
:type name: str
:return: A response object to ... | en | 0.749802 | Follows the Slack Channels API. See https://api.slack.com/methods Creates a public channel :param name: The name :type name: str :return: A response object to run the API request. :rtype: :class:`Response <Response>` object Retrieves information about a public channel :param na... | 2.998763 | 3 |
sdk/python/pulumi_azure_nextgen/machinelearningservices/v20191101/get_workspace.py | test-wiz-sec/pulumi-azure-nextgen | 0 | 6625686 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | en | 0.914259 | # 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! *** An object that represents a machine learning workspace. ARM id of the application insights associated with this workspace. This cannot be changed once t... | 1.614012 | 2 |
homeassistant/components/vicare/water_heater.py | Watchfox/home-assistant | 2 | 6625687 | """Viessmann ViCare water_heater device."""
import logging
from homeassistant.components.water_heater import (
SUPPORT_TARGET_TEMPERATURE,
WaterHeaterDevice,
)
from homeassistant.const import TEMP_CELSIUS, ATTR_TEMPERATURE, PRECISION_WHOLE
from . import DOMAIN as VICARE_DOMAIN
from . import VICARE_API
from . ... | """Viessmann ViCare water_heater device."""
import logging
from homeassistant.components.water_heater import (
SUPPORT_TARGET_TEMPERATURE,
WaterHeaterDevice,
)
from homeassistant.const import TEMP_CELSIUS, ATTR_TEMPERATURE, PRECISION_WHOLE
from . import DOMAIN as VICARE_DOMAIN
from . import VICARE_API
from . ... | en | 0.782186 | Viessmann ViCare water_heater device. Create the ViCare water_heater devices. Representation of the ViCare domestic hot water device. Initialize the DHW water_heater device. Let HA know there has been an update from the ViCare API. Return the list of supported features. Return the name of the water_heater device. Retur... | 2.46015 | 2 |
SCN_fractal_test.py | Tnorm/SCN | 0 | 6625688 | <reponame>Tnorm/SCN
from SCN import SCN
from Fractal_generator import koch, binary_frac
import torch
from torch.autograd import Variable
import numpy as np
import matplotlib.pyplot as plt
import pickle
from scipy.stats import norm
direction = [0.0,float(1)/243]
#X, Y = koch([[0,0]], 5, direction)
X, Y = binary_fra... | from SCN import SCN
from Fractal_generator import koch, binary_frac
import torch
from torch.autograd import Variable
import numpy as np
import matplotlib.pyplot as plt
import pickle
from scipy.stats import norm
direction = [0.0,float(1)/243]
#X, Y = koch([[0,0]], 5, direction)
X, Y = binary_frac([], 4, 0, 1)
X = t... | en | 0.209839 | #X, Y = koch([[0,0]], 5, direction) #X = torch.from_numpy(np.arange(0.0, 1.0, 0.005, dtype=np.float32)).view(len(np.arange(0.0, 1.0, 0.005)), -1) #Y = torch.from_numpy(np.asarray(norm.pdf(X, 0.05, 0.1)/3 + norm.pdf(X, 0.95, 0.1)/3 + norm.pdf(X, 0.5, 0.2)/3 + norm.pdf(X, 0.35, 0.2)/3 + norm.pdf(X, 0.65, 0.2)/3 - # norm.... | 2.006572 | 2 |
kaptan/__about__.py | sunpoet/kaptan | 134 | 6625689 | <reponame>sunpoet/kaptan<gh_stars>100-1000
__title__ = 'kaptan'
__package_name__ = 'kaptan'
__version__ = '0.5.12'
__description__ = 'Configuration manager'
__email__ = '<EMAIL>'
__url__ = 'https://github.com/emre/kaptan'
__author__ = '<NAME>'
__license__ = 'BSD'
__copyright__ = 'Copyright 2013-2019 <NAME>'
| __title__ = 'kaptan'
__package_name__ = 'kaptan'
__version__ = '0.5.12'
__description__ = 'Configuration manager'
__email__ = '<EMAIL>'
__url__ = 'https://github.com/emre/kaptan'
__author__ = '<NAME>'
__license__ = 'BSD'
__copyright__ = 'Copyright 2013-2019 <NAME>' | none | 1 | 0.935269 | 1 | |
youTubedownloadalex2.py | unis369/Mytubedownload | 0 | 6625690 | <filename>youTubedownloadalex2.py
# from pytube import YouTube
import pytube
with open('./list.txt', 'r') as f_stream:
count = 1
line = f_stream.readline()
while line:
print(count, line)
yt = pytube.YouTube(line)
yt.streams.first().download(filename='test' + str(count))
coun... | <filename>youTubedownloadalex2.py
# from pytube import YouTube
import pytube
with open('./list.txt', 'r') as f_stream:
count = 1
line = f_stream.readline()
while line:
print(count, line)
yt = pytube.YouTube(line)
yt.streams.first().download(filename='test' + str(count))
coun... | en | 0.390796 | # from pytube import YouTube | 2.903382 | 3 |
virtual/bin/django-admin.py | Tyra-hans/neighbourhood-blitz | 0 | 6625691 | #!/home/tyra/Desktop/MS-Python-Pre-work/django/neighbourhood/virtual/bin/python
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| #!/home/tyra/Desktop/MS-Python-Pre-work/django/neighbourhood/virtual/bin/python
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| en | 0.725312 | #!/home/tyra/Desktop/MS-Python-Pre-work/django/neighbourhood/virtual/bin/python | 1.049699 | 1 |
neo/core/analogsignalarray.py | guangxingli/python-neo | 0 | 6625692 | # -*- coding: utf-8 -*-
'''
This module implements :class:`AnalogSignalArray`, an array of analog signals.
:class:`AnalogSignalArray` derives from :class:`BaseAnalogSignal`, from
:module:`neo.core.analogsignal`.
:class:`BaseAnalogSignal` inherits from :class:`quantites.Quantity`, which
inherits from :class:`numpy.arr... | # -*- coding: utf-8 -*-
'''
This module implements :class:`AnalogSignalArray`, an array of analog signals.
:class:`AnalogSignalArray` derives from :class:`BaseAnalogSignal`, from
:module:`neo.core.analogsignal`.
:class:`BaseAnalogSignal` inherits from :class:`quantites.Quantity`, which
inherits from :class:`numpy.arr... | en | 0.711186 | # -*- coding: utf-8 -*- This module implements :class:`AnalogSignalArray`, an array of analog signals. :class:`AnalogSignalArray` derives from :class:`BaseAnalogSignal`, from :module:`neo.core.analogsignal`. :class:`BaseAnalogSignal` inherits from :class:`quantites.Quantity`, which inherits from :class:`numpy.array`.... | 2.309999 | 2 |
influxdb/influxdbplugin.py | Odianosen25/appdaemon_custom_plugins | 1 | 6625693 | import asyncio
import copy
from influxdb_client import InfluxDBClient
from influxdb_client.client.write_api import SYNCHRONOUS
from datetime import datetime, timedelta
import iso8601
from appdaemon.appdaemon import AppDaemon
from appdaemon.plugin_management import PluginBase
import appdaemon.utils as utils
... | import asyncio
import copy
from influxdb_client import InfluxDBClient
from influxdb_client.client.write_api import SYNCHRONOUS
from datetime import datetime, timedelta
import iso8601
from appdaemon.appdaemon import AppDaemon
from appdaemon.plugin_management import PluginBase
import appdaemon.utils as utils
... | en | 0.749743 | # get AD loop # set to continue # # Placeholder for constraints # # # Get initial state # # # Utility gets called every second (or longer if configured # Allows plugin to do any housekeeping required # # self.logger.info("*** Utility ***".format(self.state)) # # Handle state updates # # set to continue # it has not bee... | 2.05077 | 2 |
final_project/machinetranslation/translator.py | ankur1198/xzceb-flask_eng_fr | 0 | 6625694 | <gh_stars>0
"""Peer graded Assognment"""
import json
import os
from ibm_watson import LanguageTranslatorV3
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from dotenv import load_dotenv
load_dotenv()
apikey = '<KEY>'
url = 'https://api.us-south.language-translator.watson.cloud.ibm.com/instances/113e5b0... | """Peer graded Assognment"""
import json
import os
from ibm_watson import LanguageTranslatorV3
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from dotenv import load_dotenv
load_dotenv()
apikey = '<KEY>'
url = 'https://api.us-south.language-translator.watson.cloud.ibm.com/instances/113e5b0a-69a2-4f4e-... | en | 0.751874 | Peer graded Assognment Translates From English to French #englishText = input() Translates From French to English #frenchText = input() | 2.826004 | 3 |
mqtt-poly.py | therealmysteryman/udi-mqtt-poly | 0 | 6625695 | <gh_stars>0
#!/usr/bin/env python3
import polyinterface
import sys
import logging
import paho.mqtt.client as mqtt
import json
import yaml
LOGGER = polyinterface.LOGGER
class Controller(polyinterface.Controller):
def __init__(self, polyglot):
super().__init__(polyglot)
self.name = 'MQTT Controller... | #!/usr/bin/env python3
import polyinterface
import sys
import logging
import paho.mqtt.client as mqtt
import json
import yaml
LOGGER = polyinterface.LOGGER
class Controller(polyinterface.Controller):
def __init__(self, polyglot):
super().__init__(polyglot)
self.name = 'MQTT Controller Sensor Raw'... | en | 0.8745 | #!/usr/bin/env python3 # example: [ {'id': 'sonoff1', 'type': 'switch', 'status_topic': 'stat/sonoff1/power', 'cmd_topic': 'cmnd/sonoff1/power'} ] # LOGGER.setLevel(logging.INFO) # motion detector # temperature # heatIndex # humidity # light detecor reading # LED # LED is present # this is meant as a flag for if you ha... | 2.484437 | 2 |
codebase/people_counter HOrizontal.py | hiteshsdata/Adaptive-Optimum-Scheduling-of-campus-buses | 3 | 6625696 | # USAGE
# To read and write back out to video:
# python people_counter.py --prototxt mobilenet_ssd/MobileNetSSD_deploy.prototxt \
# --model mobilenet_ssd/MobileNetSSD_deploy.caffemodel --input videos/example_01.mp4 \
# --output output/output_01.avi
#
# To read from webcam and write back out to disk:
# python people_cou... | # USAGE
# To read and write back out to video:
# python people_counter.py --prototxt mobilenet_ssd/MobileNetSSD_deploy.prototxt \
# --model mobilenet_ssd/MobileNetSSD_deploy.caffemodel --input videos/example_01.mp4 \
# --output output/output_01.avi
#
# To read from webcam and write back out to disk:
# python people_cou... | en | 0.789422 | # USAGE # To read and write back out to video: # python people_counter.py --prototxt mobilenet_ssd/MobileNetSSD_deploy.prototxt \ # --model mobilenet_ssd/MobileNetSSD_deploy.caffemodel --input videos/example_01.mp4 \ # --output output/output_01.avi # # To read from webcam and write back out to disk: # python people_cou... | 2.82059 | 3 |
awx/main/migrations/0039_v330_custom_venv_help_text.py | DamoR25/awxnew | 11,396 | 6625697 | <gh_stars>1000+
# -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-05-23 20:17
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0038_v330_add_deleted_activitystream_actor'),
]
operations... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-05-23 20:17
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0038_v330_add_deleted_activitystream_actor'),
]
operations = [
mig... | en | 0.686883 | # -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2018-05-23 20:17 | 1.649288 | 2 |
parser/team19/BDTytus/Gramatica/Gramatica.py | XiomRB/tytus | 1 | 6625698 | import Errores.Nodo_Error as err
from ply import lex
from AST.Sentencias import Raiz, Sentencia
import AST.SentenciasDDL as DDL
import ply.yacc as yacc
reservadas = {
'select': 't_select',
'distinct': 't_distinct',
'as': 't_as',
'from': 't_from',
'where': 't_where',
'having': 't_having',
'a... | import Errores.Nodo_Error as err
from ply import lex
from AST.Sentencias import Raiz, Sentencia
import AST.SentenciasDDL as DDL
import ply.yacc as yacc
reservadas = {
'select': 't_select',
'distinct': 't_distinct',
'as': 't_as',
'from': 't_from',
'where': 't_where',
'having': 't_having',
'a... | en | 0.229756 | # Tokens # se remueven comillas # se remueven comillas # Check for reserved words # Comentario simple // ... # Caracteres ignorados # Between , in , like, ilike, simiar, is isnull notnull #def p_Sentencia_SQL_DML(p): # 'Sentencia_SQL : EXP pyc' # p[0] = Sentencia("EXP", [p[1]]) # ------------------------------------... | 1.98308 | 2 |
src/licensedcode/models.py | chetanya-shrimali/scancode-toolkit | 0 | 6625699 | <gh_stars>0
#
# Copyright (c) 2017 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You... | #
# Copyright (c) 2017 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... | en | 0.850379 | # # Copyright (c) 2017 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. # ScanCode is a trademark of nexB Inc. # # You may not use... | 1.216173 | 1 |
lib/plugins/generator/replay.py | muh-bazm/eventgen | 3 | 6625700 | <reponame>muh-bazm/eventgen<gh_stars>1-10
# TODO Add timestamp detection for common timestamp format
from __future__ import division
from generatorplugin import GeneratorPlugin
import os
import logging
import datetime, time
import math
import re
from eventgentoken import Token
from eventgenoutput import Output
class ... | # TODO Add timestamp detection for common timestamp format
from __future__ import division
from generatorplugin import GeneratorPlugin
import os
import logging
import datetime, time
import math
import re
from eventgentoken import Token
from eventgenoutput import Output
class ReplayGenerator(GeneratorPlugin):
queu... | en | 0.918742 | # TODO Add timestamp detection for common timestamp format # Logger already setup by config, just get an instance # Load sample from a file, using cache if possible, from superclass GeneratorPlugin # 8/18/15 CS Because this is not a queueable plugin, we can in a threadsafe way modify these data structures at init # Ite... | 2.267199 | 2 |
src/genie/libs/parser/iosxe/tests/ShowIpv6Neighbors/cli/equal/golden_output2_expected.py | balmasea/genieparser | 204 | 6625701 | expected_output = {
"interface": {
"GigabitEthernet3": {
"interface": "GigabitEthernet3",
"neighbors": {
"2001:db8:888c:1::2": {
"age": "0",
"ip": "2001:db8:888c:1::2",
"link_layer_address": "fa16.3eff.1b7b",... | expected_output = {
"interface": {
"GigabitEthernet3": {
"interface": "GigabitEthernet3",
"neighbors": {
"2001:db8:888c:1::2": {
"age": "0",
"ip": "2001:db8:888c:1::2",
"link_layer_address": "fa16.3eff.1b7b",... | none | 1 | 1.443934 | 1 | |
experiments/evaluate.py | mwydmuch/napkinXC | 36 | 6625702 | <filename>experiments/evaluate.py
#!/usr/bin/env python
import sys
import os
napkinxc_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../python")
sys.path.append(napkinxc_path)
from napkinxc.measures import *
def load_true_file(filepath):
with open(filepath) as file:
Y = []
for... | <filename>experiments/evaluate.py
#!/usr/bin/env python
import sys
import os
napkinxc_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../python")
sys.path.append(napkinxc_path)
from napkinxc.measures import *
def load_true_file(filepath):
with open(filepath) as file:
Y = []
for... | en | 0.310364 | #!/usr/bin/env python #"HL": {"func": hamming_loss, "inv_ps": False}, | 2.304459 | 2 |
adhoc/histogram_area_optim2_repl_good.py | MrCsabaToth/IK | 0 | 6625703 | histogram = [6, 2, 5, 4, 5, 1, 6]
histogram = [1, 1, 2, 1, 1]
l = 1
r = 3
print("start")
stack = list()
max_area = 0
index = l
while index <= r:
print("s0", stack)
if (not stack) or (histogram[stack[-1]] <= histogram[index]):
stack.append(index)
index += 1
print("s1", stack)
else:... | histogram = [6, 2, 5, 4, 5, 1, 6]
histogram = [1, 1, 2, 1, 1]
l = 1
r = 3
print("start")
stack = list()
max_area = 0
index = l
while index <= r:
print("s0", stack)
if (not stack) or (histogram[stack[-1]] <= histogram[index]):
stack.append(index)
index += 1
print("s1", stack)
else:... | none | 1 | 3.500255 | 4 | |
nncf/tensorflow/accuracy_aware_training/runner.py | GreenWaves-Technologies/nncf | 136 | 6625704 | <gh_stars>100-1000
"""
Copyright (c) 2022 Intel Corporation
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 ... | """
Copyright (c) 2022 Intel Corporation
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 writin... | en | 0.861283 | Copyright (c) 2022 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, so... | 1.757285 | 2 |
tools/TopicFastMerge/topic_model_fastmerge.py | StevenLOL/Familia | 2,753 | 6625705 | #coding=utf-8
# Copyright (c) 2017, Baidu.com, Inc. All Rights Reserved
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
from collections import defaultdict as ddict
import operator
class TopicModelFastMerge(object):
"""
针对超大模型的主题去重,如果计算两两主题之间的相... | #coding=utf-8
# Copyright (c) 2017, Baidu.com, Inc. All Rights Reserved
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
from collections import defaultdict as ddict
import operator
class TopicModelFastMerge(object):
"""
针对超大模型的主题去重,如果计算两两主题之间的相... | zh | 0.846225 | #coding=utf-8 # Copyright (c) 2017, Baidu.com, Inc. All Rights Reserved # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. 针对超大模型的主题去重,如果计算两两主题之间的相似度会非常耗时,我们引入simhash的快速去重算法。 主要分为两步:基于Simhash的主题预分析以及基于Weighted Jaccard Similarity的Cluster内主题相关性分析。 Attributes: ... | 1.98149 | 2 |
photonpump/conversations.py | bopopescu/photon-pump | 48 | 6625706 | import json
import logging
import sys
import time
from asyncio import Future, Queue
try:
from asyncio.exceptions import InvalidStateError
except ImportError:
from asyncio.futures import InvalidStateError
from enum import IntEnum
from typing import Optional, Sequence, Union
from uuid import UUID, uuid4
from ph... | import json
import logging
import sys
import time
from asyncio import Future, Queue
try:
from asyncio.exceptions import InvalidStateError
except ImportError:
from asyncio.futures import InvalidStateError
from enum import IntEnum
from typing import Optional, Sequence, Union
from uuid import UUID, uuid4
from ph... | en | 0.733437 | Command class for writing a sequence of events to a single stream. Args: stream: The name of the stream to write to. events: A sequence of events to write. expected_version (optional): The expected version of the target stream used for concurrency control. requir... | 2.149136 | 2 |
inverted_pendulum.py | tderensis/digital_control | 0 | 6625707 | <filename>inverted_pendulum.py<gh_stars>0
"""
Design of a state space controller for an inverted pendulum driven by stepper motor.
"""
import control_plot, control_sim, control_design, control_optimize, control_eval, control_poles
from scipy import signal
import numpy as np
import math
# System Clasification... | <filename>inverted_pendulum.py<gh_stars>0
"""
Design of a state space controller for an inverted pendulum driven by stepper motor.
"""
import control_plot, control_sim, control_design, control_optimize, control_eval, control_poles
from scipy import signal
import numpy as np
import math
# System Clasification... | en | 0.733788 | Design of a state space controller for an inverted pendulum driven by stepper motor. # System Clasification Results # motor position low pass filter (bessel with 1 sec settling time) # natural frequency # damping # State Space Equations x = | x | - motor position (m)
| vel | - motor velocity (m/s)
... | 2.899764 | 3 |
beem/nodelist.py | MWFIAE/beem | 0 | 6625708 | <reponame>MWFIAE/beem<gh_stars>0
# This Python file uses the following encoding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import next
import re
import time
import math
import json
from beem.in... | # This Python file uses the following encoding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import next
import re
import time
import math
import json
from beem.instance import shared_steem_instan... | en | 0.692638 | # This Python file uses the following encoding: utf-8 Returns a node list .. code-block:: python from beem.nodelist import NodeList n = NodeList() nodes_urls = n.get_nodes() Reads metadata from fullnodeupdate and recalculates the nodes score :params list/dict w... | 2.276386 | 2 |
components/cronet/PRESUBMIT.py | metux/chromium-deb | 0 | 6625709 | <reponame>metux/chromium-deb<filename>components/cronet/PRESUBMIT.py
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for src/components/cronet.
See http://dev.chromium.org/de... | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for src/components/cronet.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about ... | en | 0.855897 | # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. Top-level presubmit script for src/components/cronet. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the ... | 1.596515 | 2 |
setup.py | getaaron/athenacli | 0 | 6625710 | <reponame>getaaron/athenacli
#!/usr/bin/env python
import re
import ast
from setuptools import setup, find_packages
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('athenacli/__init__.py', 'rb') as f:
version = str(ast.literal_eval(_version_re.search(
f.read().decode('utf-8')).group(1)))
d... | #!/usr/bin/env python
import re
import ast
from setuptools import setup, find_packages
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('athenacli/__init__.py', 'rb') as f:
version = str(ast.literal_eval(_version_re.search(
f.read().decode('utf-8')).group(1)))
description = 'CLI for Athena ... | ru | 0.26433 | #!/usr/bin/env python | 1.599817 | 2 |
trainer.py | xenbaloch/efficientderain | 109 | 6625711 | import time
import datetime
import os
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.autograd as autograd
from torch.utils.data import DataLoader
import torch.backends.cudnn as cudnn
from pytorch_msssim import ssim, ms_ssim, SSIM, MS_SSIM
#import encoding
from tor... | import time
import datetime
import os
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.autograd as autograd
from torch.utils.data import DataLoader
import torch.backends.cudnn as cudnn
from pytorch_msssim import ssim, ms_ssim, SSIM, MS_SSIM
#import encoding
from tor... | en | 0.409387 | #import encoding # ---------------------------------------- # Network training parameters # ---------------------------------------- #torch.cuda.set_device(1) # cudnn benchmark # configurations # Loss functions #criterion_rainypred = torch.nn.L1Loss().cuda() #criterion_rainypred = torch.nn.L1Loss().cuda() # Initi... | 2.211857 | 2 |
python/baseline/dy/seq2seq/encoders.py | domyounglee/baseline | 0 | 6625712 | <reponame>domyounglee/baseline
from collections import namedtuple
import dynet as dy
from baseline.model import register_encoder
from baseline.dy.transformer import TransformerEncoderStack
from baseline.dy.dynety import DynetModel, Linear, rnn_forward_with_state, sequence_mask, unsqueeze
RNNEncoderOutput = namedtuple... | from collections import namedtuple
import dynet as dy
from baseline.model import register_encoder
from baseline.dy.transformer import TransformerEncoderStack
from baseline.dy.dynety import DynetModel, Linear, rnn_forward_with_state, sequence_mask, unsqueeze
RNNEncoderOutput = namedtuple("RNNEncoderOutput", ("output",... | en | 0.385317 | Input Shape: ((T, H), B). Output Shape: [((H,), B)] * T Input shape: ((T, H), B) Output Shape: [((H,), B)] * T | 2.316501 | 2 |
gsoc/aman/get_properties.py | ashutosh16399/NSpM | 78 | 6625713 | <reponame>ashutosh16399/NSpM<filename>gsoc/aman/get_properties.py
import urllib2, urllib, httplib, json, sys, csv, io
import argparse
from bs4 import BeautifulSoup
parser = argparse.ArgumentParser()
requiredNamed = parser.add_argument_group('Required Arguments');
requiredNamed.add_argument('--url', dest='url', metavar... | import urllib2, urllib, httplib, json, sys, csv, io
import argparse
from bs4 import BeautifulSoup
parser = argparse.ArgumentParser()
requiredNamed = parser.add_argument_group('Required Arguments');
requiredNamed.add_argument('--url', dest='url', metavar='url', help='Webpage URL: eg-http://mappings.dbpedia.org/server/o... | en | 0.86698 | # print type(soup) # with io.open("test.csv", mode='w', encoding='utf-8') as toWrite: # writer = csv.writer(toWrite) # writer.writerows(props) | 3.080496 | 3 |
statham/schema/parser.py | george-fry/statham-schema | 23 | 6625714 | # pylint: disable=too-many-lines
"""Parsing tools to convert JSON Schema dictionaries to Element instances.
Some JSON Schema documents will be converted to an equivalent but structurally
differing representation. In particular, those that combine composition
keywords or use multiple types will be recomposed using ``"a... | # pylint: disable=too-many-lines
"""Parsing tools to convert JSON Schema dictionaries to Element instances.
Some JSON Schema documents will be converted to an equivalent but structurally
differing representation. In particular, those that combine composition
keywords or use multiple types will be recomposed using ``"a... | en | 0.693054 | # pylint: disable=too-many-lines Parsing tools to convert JSON Schema dictionaries to Element instances. Some JSON Schema documents will be converted to an equivalent but structurally differing representation. In particular, those that combine composition keywords or use multiple types will be recomposed using ``"allO... | 2.289284 | 2 |
requisitos/a-zerinho-o-um/resolucao_zerinho.py | robsoncartes/projeto-javalin | 0 | 6625715 | <reponame>robsoncartes/projeto-javalin
def get_vencedor(index):
if index == 0:
return "A"
elif index == 1:
return "B"
elif index == 2:
return "C"
numeros_texto = input()
numeros = numeros_texto.split(" ")
n_0 = numeros.count("0")
n_1 = numeros.count("1")
if n_0 == 1:
print (g... | def get_vencedor(index):
if index == 0:
return "A"
elif index == 1:
return "B"
elif index == 2:
return "C"
numeros_texto = input()
numeros = numeros_texto.split(" ")
n_0 = numeros.count("0")
n_1 = numeros.count("1")
if n_0 == 1:
print (get_vencedor(numeros.index("0")))
elif n... | none | 1 | 3.676899 | 4 | |
src/rsactftool/RsaCtfTool.py | borari/RsaCtfTool | 0 | 6625716 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
----------------------------------------------------------------------------
"THE BEER-WARE LICENSE" (Revision 42):
ganapati (@G4N4P4T1) wrote this file. As long as you retain this notice you
can do whatever you want with this stuff. If we meet some day, and you think... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
----------------------------------------------------------------------------
"THE BEER-WARE LICENSE" (Revision 42):
ganapati (@G4N4P4T1) wrote this file. As long as you retain this notice you
can do whatever you want with this stuff. If we meet some day, and you think... | en | 0.724527 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- ---------------------------------------------------------------------------- "THE BEER-WARE LICENSE" (Revision 42): ganapati (@G4N4P4T1) wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this... | 1.97197 | 2 |
neurovault/settings.py | chrisgorgo/NeuroVault | 0 | 6625717 | <gh_stars>0
# Django settings for neurovault project.
import os
import sys
import tempfile
from datetime import timedelta
import matplotlib
from kombu import Exchange, Queue
matplotlib.use('Agg')
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DEBUG = True
DOMAIN_NAME = "https://neurovault.org"
TEMPLATE_DEB... | # Django settings for neurovault project.
import os
import sys
import tempfile
from datetime import timedelta
import matplotlib
from kombu import Exchange, Queue
matplotlib.use('Agg')
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DEBUG = True
DOMAIN_NAME = "https://neurovault.org"
TEMPLATE_DEBUG = DEBUG
... | en | 0.574025 | # Django settings for neurovault project. # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. # The following settings are not used with sqlite3: # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. # Set to empty string for default. # Hosts/domain names that are valid for thi... | 1.95738 | 2 |
src/data/common.py | praeclarumjj3/AOT-GAN-Experiments | 3 | 6625718 |
import zipfile
class ZipReader(object):
file_dict = dict()
def __init__(self):
super(ZipReader, self).__init__()
@staticmethod
def build_file_dict(path):
file_dict = ZipReader.file_dict
if path in file_dict:
return file_dict[path]
else:
file_h... |
import zipfile
class ZipReader(object):
file_dict = dict()
def __init__(self):
super(ZipReader, self).__init__()
@staticmethod
def build_file_dict(path):
file_dict = ZipReader.file_dict
if path in file_dict:
return file_dict[path]
else:
file_h... | none | 1 | 3.090914 | 3 | |
Python_Challenge_115/7/C.py | LIkelion-at-KOREATECH/LikeLion_Django_Study_Summary | 28 | 6625719 | '''
Statement
It is possible to place 8 queens on an 8×8 chessboard so that no two queens threaten each other. Thus, it requires that no two queens share the same row, column, or diagonal.
Given a placement of 8 queens on the chessboard. If there is a pair of queens that violates this rule, print YES, otherwise print ... | '''
Statement
It is possible to place 8 queens on an 8×8 chessboard so that no two queens threaten each other. Thus, it requires that no two queens share the same row, column, or diagonal.
Given a placement of 8 queens on the chessboard. If there is a pair of queens that violates this rule, print YES, otherwise print ... | en | 0.817594 | Statement It is possible to place 8 queens on an 8×8 chessboard so that no two queens threaten each other. Thus, it requires that no two queens share the same row, column, or diagonal. Given a placement of 8 queens on the chessboard. If there is a pair of queens that violates this rule, print YES, otherwise print NO. ... | 3.922832 | 4 |
tests/test_cmdline.py | hemanthmantri/coveragepy | 0 | 6625720 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Test cmdline.py for coverage.py."""
import pprint
import re
import sys
import textwrap
from unittest import mock
import pytest
import coverage
import coverage... | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Test cmdline.py for coverage.py."""
import pprint
import re
import sys
import textwrap
from unittest import mock
import pytest
import coverage
import coverage... | en | 0.488508 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt Test cmdline.py for coverage.py. Tests of execution paths through the command line interpreter. # Make a dict mapping function names to the default values that cmdli... | 2.175381 | 2 |
Team.py | jrandj/FPL-draft-picker | 0 | 6625721 | import math
from collections import OrderedDict
from tabulate import tabulate
class Team:
"""
A class that represents a team.
Attributes
----------
teamName : str
The name of the team.
teamID : str
The unique identifier of the team.
consolidatedData : object
An ins... | import math
from collections import OrderedDict
from tabulate import tabulate
class Team:
"""
A class that represents a team.
Attributes
----------
teamName : str
The name of the team.
teamID : str
The unique identifier of the team.
consolidatedData : object
An ins... | en | 0.805427 | A class that represents a team. Attributes ---------- teamName : str The name of the team. teamID : str The unique identifier of the team. consolidatedData : object An instance of ConsolidatedData. playersInTeam : sequence A list of the players in the team. f... | 3.725908 | 4 |
setup.py | timeyyy/async_gui | 38 | 6625722 | <gh_stars>10-100
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import glob
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'test':
os.chdir('tests')
for test in glob.glob('*.py'):
os.system('python %s' % test)
s... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import glob
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'test':
os.chdir('tests')
for test in glob.glob('*.py'):
os.system('python %s' % test)
sys.exit()
if sys... | en | 0.352855 | #!/usr/bin/env python # -*- coding: utf-8 -*- | 1.481646 | 1 |
CodeWars/2016/SquareEveryDigit-6k.py | JLJTECH/TutorialTesting | 0 | 6625723 | <reponame>JLJTECH/TutorialTesting<gh_stars>0
#Square every digit of a passed int
def square_digits(num):
squares = []
for i in str(num):
squares.append(int(i)**2)
x = ''.join(map(str, squares))
print(x.replace("'", ""))
#Alternate solution
def square_digits(num):
ret = ""
for x in str(... | #Square every digit of a passed int
def square_digits(num):
squares = []
for i in str(num):
squares.append(int(i)**2)
x = ''.join(map(str, squares))
print(x.replace("'", ""))
#Alternate solution
def square_digits(num):
ret = ""
for x in str(num):
ret += str(int(x)**2)
retur... | en | 0.697886 | #Square every digit of a passed int #Alternate solution | 3.835134 | 4 |
aRibeiro/opengl/GLVertexArrayObject.py | A-Ribeiro/ARibeiroPythonFramework | 1 | 6625724 | #
# For this is how God loved the world:<br/>
# he gave his only Son, so that everyone<br/>
# who believes in him may not perish<br/>
# but may have eternal life.
#
# John 3:16
#
from OpenGL.GL import *
from aRibeiro.window import *
class GLVertexArrayObject:
def __init__(self, window:Window):
self.w... | #
# For this is how God loved the world:<br/>
# he gave his only Son, so that everyone<br/>
# who believes in him may not perish<br/>
# but may have eternal life.
#
# John 3:16
#
from OpenGL.GL import *
from aRibeiro.window import *
class GLVertexArrayObject:
def __init__(self, window:Window):
self.w... | en | 0.973201 | # # For this is how God loved the world:<br/> # he gave his only Son, so that everyone<br/> # who believes in him may not perish<br/> # but may have eternal life. # # John 3:16 # | 2.768767 | 3 |
training/localized_linear_model/TrainingEpoch.py | khoehlein/CNNs-for-Wind-Field-Downscaling | 5 | 6625725 | <reponame>khoehlein/CNNs-for-Wind-Field-Downscaling
import torch
from training.modular_downscaling_model.TrainingEpoch import TrainingEpoch as BaseEpoch
class TrainingEpoch(BaseEpoch):
def __init__(self, training_process):
super(TrainingEpoch, self).__init__(training_process=training_process)
def _pr... | import torch
from training.modular_downscaling_model.TrainingEpoch import TrainingEpoch as BaseEpoch
class TrainingEpoch(BaseEpoch):
def __init__(self, training_process):
super(TrainingEpoch, self).__init__(training_process=training_process)
def _prepare_data(self, batch):
(
targe... | none | 1 | 2.154437 | 2 | |
sup.py | k-webb/supreme | 10 | 6625726 | import requests as r
from datetime import datetime
import json, re, socket, time, sys, random
from slackclient import SlackClient
def UTCtoEST():
current = datetime.now()
return str(current) + " CST"
socket.setdefaulttimeout(2)
sc = SlackClient("SLACK KEY HERE")
class Supreme:
def __init__(self):
self.headers ... | import requests as r
from datetime import datetime
import json, re, socket, time, sys, random
from slackclient import SlackClient
def UTCtoEST():
current = datetime.now()
return str(current) + " CST"
socket.setdefaulttimeout(2)
sc = SlackClient("SLACK KEY HERE")
class Supreme:
def __init__(self):
self.headers ... | en | 0.452319 | ###USE PROXIES, RANDOM CHOICE with open('proxies.txt','r+') as goodproxies: proxies = goodproxies.read().splitlines() x = random.choice(proxies) bs = {'http': x} print (bs) #HARD CODE PROXIES #proxies = {'http': '192.168.127.12:53281','https': '192.168.127.12:53281'} a = r.get(link,headers=self.hea... | 2.859648 | 3 |
scripts/image_compare.py | young-oct/OCT-sparse-estimation-with-CBPDN-framework | 1 | 6625727 | # -*- coding: utf-8 -*-
# @Time : 2021-04-26 3:49 p.m.
# @Author : <NAME>
# @FileName: image_compare.py
# @Software: PyCharm
'''From left to right: OCT images of a middle ear,
index finger (palmar view), index finger (side view),
and onion slice. The white arrow indicates the sidelobe
artifacts caused by the ... | # -*- coding: utf-8 -*-
# @Time : 2021-04-26 3:49 p.m.
# @Author : <NAME>
# @FileName: image_compare.py
# @Software: PyCharm
'''From left to right: OCT images of a middle ear,
index finger (palmar view), index finger (side view),
and onion slice. The white arrow indicates the sidelobe
artifacts caused by the ... | en | 0.393699 | # -*- coding: utf-8 -*- # @Time : 2021-04-26 3:49 p.m. # @Author : <NAME> # @FileName: image_compare.py # @Software: PyCharm From left to right: OCT images of a middle ear, index finger (palmar view), index finger (side view), and onion slice. The white arrow indicates the sidelobe artifacts caused by the PSF ... | 2.338384 | 2 |
src/compas_tna/equilibrium/vertical.py | wenqian157/compas_tna | 0 | 6625728 | <filename>src/compas_tna/equilibrium/vertical.py<gh_stars>0
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from numpy import array
from numpy import float64
from scipy.sparse import diags
from scipy.sparse.linalg import spsolve
from compas.numerical impor... | <filename>src/compas_tna/equilibrium/vertical.py<gh_stars>0
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from numpy import array
from numpy import float64
from scipy.sparse import diags
from scipy.sparse.linalg import spsolve
from compas.numerical impor... | en | 0.301615 | For the given form and force diagram, compute the scale of the force diagram for which the highest point of the thrust network is equal to a specified value. Parameters ---------- form : compas_tna.diagrams.formdiagram.FormDiagram The form diagram force : compas_tna.diagrams.forcediagra... | 2.079972 | 2 |
lib/djado/paves.py | hdknr/djado | 0 | 6625729 | <gh_stars>0
from paver.easy import (
task, cmdopts, consume_args
)
import os
def path(name):
return os.path.join(
os.path.dirname(os.path.abspath(__file__)),
name
)
def manage_py(args, do=False, settings_class="app.settings"):
#: manage.py
os.environ.setdefault("DJANGO_SETTINGS_M... | from paver.easy import (
task, cmdopts, consume_args
)
import os
def path(name):
return os.path.join(
os.path.dirname(os.path.abspath(__file__)),
name
)
def manage_py(args, do=False, settings_class="app.settings"):
#: manage.py
os.environ.setdefault("DJANGO_SETTINGS_MODULE", sett... | en | 0.76023 | #: manage.py Run Django Web Application Run manage.py with additional functions | 2.214145 | 2 |
resimpy/simulate/dispatcher/batch/Bulk.py | cribbslab/resimpy | 0 | 6625730 | <filename>resimpy/simulate/dispatcher/batch/Bulk.py
__version__ = "v1.0"
__copyright__ = "Copyright 2022"
__license__ = "MIT"
__lab__ = "<NAME> lab"
import numpy as np
from resimpy.simulate.dispatcher.single.Bulk import bulk as simubulk
from resimpy.gspl.FromSimulator import fromSimulator
from resimpy.Path import to
... | <filename>resimpy/simulate/dispatcher/batch/Bulk.py
__version__ = "v1.0"
__copyright__ = "Copyright 2022"
__license__ = "MIT"
__lab__ = "<NAME> lab"
import numpy as np
from resimpy.simulate.dispatcher.single.Bulk import bulk as simubulk
from resimpy.gspl.FromSimulator import fromSimulator
from resimpy.Path import to
... | en | 0.131261 | # self.seq_len_fixed = 100 # self.umi_num_fixed = 50 # print(pcr_errs) # print(seq_errs) # 'seq_len': self.seq_len_fixed - self.umi_unit_len_fixed, # 'is_sv_seq_lib': True, # 'seq_lib_fpn': to('data/simu/monomer/bulk/pcr_num/permute_') + str(pn) + '/seq.txt', # 'seq_len': self.seq_len_fixed - self.umi_unit_len_fixed, #... | 2.205883 | 2 |
apps/chat/engine/utils.py | SeniorDev34/Django_React_Chat | 58 | 6625731 | <gh_stars>10-100
import calendar
def timestamp(dt):
return int(calendar.timegm(dt.timetuple()))
| import calendar
def timestamp(dt):
return int(calendar.timegm(dt.timetuple())) | none | 1 | 2.318269 | 2 | |
atx/record/monkey.py | jamjven/ATX | 1,132 | 6625732 | <reponame>jamjven/ATX<filename>atx/record/monkey.py
#-*- encoding: utf-8 -*-
# I'm Shakespeare!
import re
import cv2
import time
import warnings
import traceback
from random import randint, choice
from scene_detector import SceneDetector
class Reporter(object):
def prepare(self, device, package=No... | #-*- encoding: utf-8 -*-
# I'm Shakespeare!
import re
import cv2
import time
import warnings
import traceback
from random import randint, choice
from scene_detector import SceneDetector
class Reporter(object):
def prepare(self, device, package=None, pids=None):
'''called before loop. init... | en | 0.730939 | #-*- encoding: utf-8 -*- # I'm Shakespeare! called before loop. initialize device related stuff. called every run. collect logs. called after loop. dump logs. # cache grep condition # there may be dot in package name but that's ok. # print cmd, len(lines), lines[0] # TODO # the last digits should be increased by 1, # o... | 2.326771 | 2 |
Algorithm.Python/RawDataRegressionAlgorithm.py | echoplaza/Lean | 1 | 6625733 | <reponame>echoplaza/Lean
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may o... | # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# 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 Licen... | en | 0.808985 | # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. # # 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 Licen... | 1.930087 | 2 |
python/1 - Intro to Python for Data Science/2- Python Lists/5- Slicing and dicing.py | Gabriela-Santos/datacamp | 0 | 6625734 | # Create the areas list
areas = ["hallway", 11.25, "kitchen", 18.0, "living room", 20.0, "bedroom", 10.75, "bathroom", 9.50]
# Use slicing to create downstairs
downstairs = areas[ :6]
# Use slicing to create upstairs
upstairs = areas[6: ]
# Print out downstairs and upstairs
print(downstairs)
print(upstairs) | # Create the areas list
areas = ["hallway", 11.25, "kitchen", 18.0, "living room", 20.0, "bedroom", 10.75, "bathroom", 9.50]
# Use slicing to create downstairs
downstairs = areas[ :6]
# Use slicing to create upstairs
upstairs = areas[6: ]
# Print out downstairs and upstairs
print(downstairs)
print(upstairs) | en | 0.697555 | # Create the areas list # Use slicing to create downstairs # Use slicing to create upstairs # Print out downstairs and upstairs | 4.058986 | 4 |
changelogs/custom/pypi/djangorestframework.py | chris48s/changelogs | 0 | 6625735 | def get_urls(releases, **kwargs):
return [
'https://raw.githubusercontent.com/tomchristie/django-rest-framework/master/docs/topics/release-notes.md',
'https://raw.githubusercontent.com/tomchristie/django-rest-framework/version-2.4.x/docs/topics/release-notes.md'
], set()
| def get_urls(releases, **kwargs):
return [
'https://raw.githubusercontent.com/tomchristie/django-rest-framework/master/docs/topics/release-notes.md',
'https://raw.githubusercontent.com/tomchristie/django-rest-framework/version-2.4.x/docs/topics/release-notes.md'
], set()
| none | 1 | 1.601292 | 2 | |
k3log/test/stdlog.py | drmingdrmer/gift | 0 | 6625736 | <filename>k3log/test/stdlog.py
import logging
import k3log
logger = k3log.make_logger('/tmp', log_fn='stdlog', level='INFO',
fmt='message')
k3log.add_std_handler(logger, 'stdout', fmt='message', level=logging.ERROR)
logger.debug('debug')
logger.info('stdlog')
logger.error('error')
| <filename>k3log/test/stdlog.py
import logging
import k3log
logger = k3log.make_logger('/tmp', log_fn='stdlog', level='INFO',
fmt='message')
k3log.add_std_handler(logger, 'stdout', fmt='message', level=logging.ERROR)
logger.debug('debug')
logger.info('stdlog')
logger.error('error')
| none | 1 | 2.067764 | 2 | |
tests/core/views.py | MatheusCE/import-export-customized | 1 | 6625737 | from django.views.generic.list import ListView
from import_export import mixins
from . import models
class CategoryExportView(mixins.ExportViewFormMixin, ListView):
model = models.Category
| from django.views.generic.list import ListView
from import_export import mixins
from . import models
class CategoryExportView(mixins.ExportViewFormMixin, ListView):
model = models.Category
| none | 1 | 1.637816 | 2 | |
sepsisSimDiabetes/DataGenerator.py | GuyLor/gumbel_max_causal_gadgets_part2 | 0 | 6625738 | <reponame>GuyLor/gumbel_max_causal_gadgets_part2<gh_stars>0
import numpy as np, random
from .MDP import MDP
from .State import State
from .Action import Action
from tqdm import tqdm_notebook as tqdm
'''
Simulates data generation from an MDP
'''
class DataGenerator(object):
def select_actions(self, state, policy):... | import numpy as np, random
from .MDP import MDP
from .State import State
from .Action import Action
from tqdm import tqdm_notebook as tqdm
'''
Simulates data generation from an MDP
'''
class DataGenerator(object):
def select_actions(self, state, policy):
'''
select action for state from policy
... | en | 0.786317 | Simulates data generation from an MDP select action for state from policy if unspecified, a random action is returned policy is an array of probabilities # Set the default value of states / actions to negative -1, # corresponding to None # Record diabetes, the hidden mixture component # Random initial state # E... | 2.741795 | 3 |
test/test_web_bags.py | tiddlyweb/tiddlyweb | 57 | 6625739 | <filename>test/test_web_bags.py<gh_stars>10-100
from .fixtures import reset_textstore, _teststore, initialize_app, get_http
from tiddlyweb.model.bag import Bag
http = get_http()
def setup_module(module):
initialize_app()
reset_textstore()
module.store = _teststore()
for i in range(5):
bag =... | <filename>test/test_web_bags.py<gh_stars>10-100
from .fixtures import reset_textstore, _teststore, initialize_app, get_http
from tiddlyweb.model.bag import Bag
http = get_http()
def setup_module(module):
initialize_app()
reset_textstore()
module.store = _teststore()
for i in range(5):
bag =... | none | 1 | 2.109043 | 2 | |
hoya_handler.py | glmck13/AlexaHomePi | 0 | 6625740 | <filename>hoya_handler.py
from lxml import html
import requests
import os
def hoya_handler(event, context):
query = {}
speech = ''; audio = ''; stopplay = False
requesttype = event['request']['type']
shouldEndSession = True
if requesttype == "LaunchRequest":
speech = "<NAME>! Ask me for a... | <filename>hoya_handler.py
from lxml import html
import requests
import os
def hoya_handler(event, context):
query = {}
speech = ''; audio = ''; stopplay = False
requesttype = event['request']['type']
shouldEndSession = True
if requesttype == "LaunchRequest":
speech = "<NAME>! Ask me for a... | none | 1 | 2.912781 | 3 | |
src/python/grpcio_tests/tests_aio/health_check/health_servicer_test.py | warlock135/grpc | 36,552 | 6625741 | # Copyright 2020 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | # Copyright 2020 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | en | 0.872704 | # Copyright 2020 The gRPC Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ... | 1.837798 | 2 |
app/main.py | damcio/-Bio-Projekt-semestralny | 0 | 6625742 | <gh_stars>0
import argparse
import app.helpers.inputParser as inputParser
from app import nussinov
parser = argparse.ArgumentParser(description='Provide secondary-structure name')
parser.add_argument('structure_name', metavar='N', type=str, help='structure name from PDB')
parser.add_argument('prediction_mode', metavar... | import argparse
import app.helpers.inputParser as inputParser
from app import nussinov
parser = argparse.ArgumentParser(description='Provide secondary-structure name')
parser.add_argument('structure_name', metavar='N', type=str, help='structure name from PDB')
parser.add_argument('prediction_mode', metavar='M', type=s... | en | 0.743308 | Pretty prints secondary structure :rtype: void :param i: number of model to print :param model: text representation of RNA model to print :param dot_notation: dot_notation representation of RNA model to print Nussinov-algorithm branch of program :rtype: void :param file_path: path to pdb file ... | 2.644173 | 3 |
Dataset/Leetcode/train/55/193.py | kkcookies99/UAST | 0 | 6625743 | class Solution:
def XXX(self, nums: List[int]) -> bool:
l,maxp,end=len(nums),0,0
for i in range(l-1):
if maxp>=i:
maxp=max(maxp,i+nums[i])
if i==end:
end=maxp
if maxp>=l-1:
return True
else:
retur... | class Solution:
def XXX(self, nums: List[int]) -> bool:
l,maxp,end=len(nums),0,0
for i in range(l-1):
if maxp>=i:
maxp=max(maxp,i+nums[i])
if i==end:
end=maxp
if maxp>=l-1:
return True
else:
retur... | none | 1 | 2.821811 | 3 | |
TransCoda/ui/Actions.py | ag-sd/py | 1 | 6625744 | <gh_stars>1-10
from enum import Enum
from PyQt5.QtCore import pyqtSignal, QSize
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QToolBar
import CommonUtils
from TransCoda.core.Encoda import EncoderStatus
class Action(Enum):
ADD_FILE = "Add File"
ADD_DIR = "Add Directory"
ADD_YTD = "ADd YouTube... | from enum import Enum
from PyQt5.QtCore import pyqtSignal, QSize
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QToolBar
import CommonUtils
from TransCoda.core.Encoda import EncoderStatus
class Action(Enum):
ADD_FILE = "Add File"
ADD_DIR = "Add Directory"
ADD_YTD = "ADd YouTube"
DEL_FILE ... | none | 1 | 2.43878 | 2 | |
doc/examples/generate-examples.py | johnnovak/twyg | 9 | 6625745 | <reponame>johnnovak/twyg
#!/usr/bin/env python
import os
from twyg import get_scale_factor, generate_output
DATA_PATH = '../../example-data'
OUT_PATH = '.'
DA = 'google-analytics'
DC = 'cocoa'
DG = 'goals'
DM = 'metrics'
DN = 'animals'
DS = 'six-thinking-hats'
DU = 'guitars'
DW = 'wind-instruments'
DY = 'synthesis... | #!/usr/bin/env python
import os
from twyg import get_scale_factor, generate_output
DATA_PATH = '../../example-data'
OUT_PATH = '.'
DA = 'google-analytics'
DC = 'cocoa'
DG = 'goals'
DM = 'metrics'
DN = 'animals'
DS = 'six-thinking-hats'
DU = 'guitars'
DW = 'wind-instruments'
DY = 'synthesis'
configs = [
{'boxe... | ru | 0.26433 | #!/usr/bin/env python | 2.028402 | 2 |
apps/schools/tests.py | cloudartisan/dojomaster | 1 | 6625746 | <reponame>cloudartisan/dojomaster<filename>apps/schools/tests.py<gh_stars>1-10
from django.test import TestCase, Client
from django.core.urlresolvers import reverse
def redirect_url(url_name, next_url_name=None, *args, **kwargs):
url = reverse(url_name) + "?next=" + reverse(next_url_name, kwargs=kwargs)
retur... | from django.test import TestCase, Client
from django.core.urlresolvers import reverse
def redirect_url(url_name, next_url_name=None, *args, **kwargs):
url = reverse(url_name) + "?next=" + reverse(next_url_name, kwargs=kwargs)
return url
class SchoolsLoginRequiredTests(TestCase):
def setUp(self):
... | none | 1 | 2.538615 | 3 | |
tests/components/honeywell/__init__.py | domwillcode/home-assistant | 30,023 | 6625747 | """Tests for honeywell component."""
| """Tests for honeywell component."""
| en | 0.757158 | Tests for honeywell component. | 1.052034 | 1 |
python/turbodbc/api_constants.py | arikfr/turbodbc | 537 | 6625748 | """
Global constants as required by PEP-249:
https://www.python.org/dev/peps/pep-0249/#globals
"""
apilevel = "2.0"
threadsafety = 1
paramstyle = 'qmark' | """
Global constants as required by PEP-249:
https://www.python.org/dev/peps/pep-0249/#globals
"""
apilevel = "2.0"
threadsafety = 1
paramstyle = 'qmark' | en | 0.877899 | Global constants as required by PEP-249: https://www.python.org/dev/peps/pep-0249/#globals | 1.145437 | 1 |
py/tools/factory_bug.py | arccode/factory | 3 | 6625749 | <reponame>arccode/factory
#!/usr/bin/env python3
#
# Copyright 2012 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.
import argparse
from collections import namedtuple
import contextlib
import fnmatch
from glob import gl... | #!/usr/bin/env python3
#
# Copyright 2012 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.
import argparse
from collections import namedtuple
import contextlib
import fnmatch
from glob import glob
from itertools import c... | en | 0.874809 | #!/usr/bin/env python3 # # Copyright 2012 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. # The candidate of device names which the ChromeOS may mount on rootfs. # Assume that ChromeOS has only one device, and always has... | 1.819746 | 2 |
servizi/veicoli/views.py | l-dfa/django-spese | 0 | 6625750 | <filename>servizi/veicoli/views.py
# veicoli/views.py
''' app veicoli views
- add
- change
- index
- detail
- reports
- calculate_gas_consumption
'''
#{ module history
# ldfa @ 2017.01.12 index: + filtering events by django-filter
# ldfa @ 2017.01.11 index: +... | <filename>servizi/veicoli/views.py
# veicoli/views.py
''' app veicoli views
- add
- change
- index
- detail
- reports
- calculate_gas_consumption
'''
#{ module history
# ldfa @ 2017.01.12 index: + filtering events by django-filter
# ldfa @ 2017.01.11 index: +... | en | 0.64081 | # veicoli/views.py app veicoli views - add - change - index - detail - reports - calculate_gas_consumption #{ module history # ldfa @ 2017.01.12 index: + filtering events by django-filter # ldfa @ 2017.01.11 index: + filtering events by django-filter # ldfa... | 1.840086 | 2 |