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 |
|---|---|---|---|---|---|---|---|---|---|---|
Basic Operations On Images/opencv_basic_operations_on_images.py | christophmellauner/opencv-examples | 0 | 6631351 | import numpy as np
import cv2
image = cv2.imread('../images/messi5.jpg')
logo = cv2.imread('../images/opencv-logo.png')
print(image.shape) # returns s tuple of no. of rows, columns and channels
print(image.size) # returns the no of pixels accessed
print(image.dtype) # returns the datatype obtained
b, g, r = cv2.s... | import numpy as np
import cv2
image = cv2.imread('../images/messi5.jpg')
logo = cv2.imread('../images/opencv-logo.png')
print(image.shape) # returns s tuple of no. of rows, columns and channels
print(image.size) # returns the no of pixels accessed
print(image.dtype) # returns the datatype obtained
b, g, r = cv2.s... | en | 0.736947 | # returns s tuple of no. of rows, columns and channels # returns the no of pixels accessed # returns the datatype obtained # splits the channels of the image # merges the channels of the image Coordinates of the ball: (ROI - Region Of Interest) Upper Left - X: 280 Y: 340 Lower Right - X: 330 Y: 390 # where y... | 3.399984 | 3 |
_2020/d13-bustimetable.py | dcsparkes/adventofcode | 0 | 6631352 | """
https://adventofcode.com/2020/day/13
"""
from base import base
import math
import unittest
class MyTestCase(unittest.TestCase):
fInput1 = "input2020_13a.txt"
fTest1a = "test2020_13a.txt"
fTest1b = "test2020_13b.txt"
fTest1c = "test2020_13c.txt"
fTest1d = "test2020_13d.txt"
fTest1e = "test2... | """
https://adventofcode.com/2020/day/13
"""
from base import base
import math
import unittest
class MyTestCase(unittest.TestCase):
fInput1 = "input2020_13a.txt"
fTest1a = "test2020_13a.txt"
fTest1b = "test2020_13b.txt"
fTest1c = "test2020_13c.txt"
fTest1d = "test2020_13d.txt"
fTest1e = "test2... | en | 0.530562 | https://adventofcode.com/2020/day/13 https://mathworld.wolfram.com/ChineseRemainderTheorem.html https://en.wikipedia.org/wiki/Chinese_remainder_theorem :param modulos: list of tuples :return: | 3.49893 | 3 |
cython_idx/idX.py | RonBeavis/idx | 1 | 6631353 | <filename>cython_idx/idX.py
#
# Copyright © 2019 <NAME>
# Licensed under Apache License, Version 2.0, January 2004
#
# Identifies kernels corresponding to spectra
#
# idX version 2019.08.10.02
#
import ujson
import time
import gzip
import sys
import datetime
# import the method that deals with spectrum file formats
f... | <filename>cython_idx/idX.py
#
# Copyright © 2019 <NAME>
# Licensed under Apache License, Version 2.0, January 2004
#
# Identifies kernels corresponding to spectra
#
# idX version 2019.08.10.02
#
import ujson
import time
import gzip
import sys
import datetime
# import the method that deals with spectrum file formats
f... | en | 0.762278 | # # Copyright © 2019 <NAME> # Licensed under Apache License, Version 2.0, January 2004 # # Identifies kernels corresponding to spectra # # idX version 2019.08.10.02 # # import the method that deals with spectrum file formats # import the method for the output of results to a file # # Coordinate the identification proce... | 2.167983 | 2 |
api_tests/nodes/views/test_node_contributors_detail.py | laurenrevere/osf.io | 0 | 6631354 | <filename>api_tests/nodes/views/test_node_contributors_detail.py
import pytest
from api.base.settings.defaults import API_BASE
from framework.auth.core import Auth
from osf.models import NodeLog
from osf_tests.factories import (
ProjectFactory,
AuthUserFactory,
)
from rest_framework import exceptions
from test... | <filename>api_tests/nodes/views/test_node_contributors_detail.py
import pytest
from api.base.settings.defaults import API_BASE
from framework.auth.core import Auth
from osf.models import NodeLog
from osf_tests.factories import (
ProjectFactory,
AuthUserFactory,
)
from rest_framework import exceptions
from test... | en | 0.458067 | # test_get_public_contributor_detail # regression test # test_get_public_contributor_detail_is_viewable_through_browsable_api # test_get_private_node_contributor_detail_contributor_auth # test_get_private_node_contributor_detail_non_contributor # test_get_private_node_contributor_detail_not_logged_in # te... | 1.858322 | 2 |
template_creator/tests/test_go_strategy.py | VanOvermeire/sam-template-creator | 3 | 6631355 | import unittest
from template_creator.reader.strategies.GoStrategy import GoStrategy
class TestGoStrategy(unittest.TestCase):
def setUp(self):
self.lines = ['package main\n', '\n', 'import (\n', '\t"context"\n', '\t"fmt"\n', '\t"github.com/aws/aws-lambda-go/events"\n', '\t"github.com/aws/aws-lambda-go/la... | import unittest
from template_creator.reader.strategies.GoStrategy import GoStrategy
class TestGoStrategy(unittest.TestCase):
def setUp(self):
self.lines = ['package main\n', '\n', 'import (\n', '\t"context"\n', '\t"fmt"\n', '\t"github.com/aws/aws-lambda-go/events"\n', '\t"github.com/aws/aws-lambda-go/la... | none | 1 | 2.428502 | 2 | |
vkontakte_api/factories.py | mcfoton/django-vkontakte-api | 0 | 6631356 | import factory
class DjangoModelNoCommitFactory(factory.DjangoModelFactory):
ABSTRACT_FACTORY = True
@classmethod
def _create(cls, *args, **kwargs):
kwargs['commit_remote'] = False
return super(DjangoModelNoCommitFactory, cls)._create(*args, **kwargs)
| import factory
class DjangoModelNoCommitFactory(factory.DjangoModelFactory):
ABSTRACT_FACTORY = True
@classmethod
def _create(cls, *args, **kwargs):
kwargs['commit_remote'] = False
return super(DjangoModelNoCommitFactory, cls)._create(*args, **kwargs)
| none | 1 | 1.964536 | 2 | |
cogs/error_handlers/l10n.py | thatoneolib/senko | 0 | 6631357 | # This file contains the localization markers for all permissions.
# It is never imported anywhere and not exposed.
_ = lambda m: m
permissions = [
# NOTE: The "add reactions" permission.
# DEFAULT: add reactions
_("#permission_add_reactions"),
# NOTE: The "administrator" permission.
# DEFAULT: ad... | # This file contains the localization markers for all permissions.
# It is never imported anywhere and not exposed.
_ = lambda m: m
permissions = [
# NOTE: The "add reactions" permission.
# DEFAULT: add reactions
_("#permission_add_reactions"),
# NOTE: The "administrator" permission.
# DEFAULT: ad... | en | 0.699166 | # This file contains the localization markers for all permissions. # It is never imported anywhere and not exposed. # NOTE: The "add reactions" permission. # DEFAULT: add reactions # NOTE: The "administrator" permission. # DEFAULT: administrator # NOTE: The "attach files" permission. # DEFAULT: attach files # NOTE: The... | 1.551798 | 2 |
utils.py | zrimseku/Reproducibility-Challenge | 1 | 6631358 | import os
import numpy as np
import random
def print_file(str_, save_file_path=None):
print(str_)
if save_file_path != None:
f = open(save_file_path, 'a')
print(str_, file=f)
class Metrictor_PPI:
def __init__(self, pre_y, truth_y, is_binary=False):
self.TP = 0
self.FP = 0
... | import os
import numpy as np
import random
def print_file(str_, save_file_path=None):
print(str_)
if save_file_path != None:
f = open(save_file_path, 'a')
print(str_, file=f)
class Metrictor_PPI:
def __init__(self, pre_y, truth_y, is_binary=False):
self.TP = 0
self.FP = 0
... | en | 0.126866 | # m, n = len(grid), len(grid[0]) # print(len(selected_edge_index), len(candidate_node)) # print(len(node_list), len(selected_edge_index)) # print(len(selected_edge_index), len(stack), len(selected_node)) | 2.68957 | 3 |
stacks/XIAOMATECH/1.0/services/HIVE/package/scripts/post_upgrade.py | tvorogme/dataops | 3 | 6631359 | <filename>stacks/XIAOMATECH/1.0/services/HIVE/package/scripts/post_upgrade.py
#!/usr/bin/env python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF li... | <filename>stacks/XIAOMATECH/1.0/services/HIVE/package/scripts/post_upgrade.py
#!/usr/bin/env python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF li... | en | 0.82985 | #!/usr/bin/env python Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you... | 1.609355 | 2 |
ms_deisotope/test/common.py | WEHI-Proteomics/ms_deisotope | 1 | 6631360 | <filename>ms_deisotope/test/common.py
import os
import gzip
import pickle
import sys
try:
import faulthandler
faulthandler.enable()
except ImportError:
pass
data_path = os.path.abspath(
os.path.join(os.path.dirname(__file__), "test_data"))
def datafile(name):
return os.path.join(data_path, name)... | <filename>ms_deisotope/test/common.py
import os
import gzip
import pickle
import sys
try:
import faulthandler
faulthandler.enable()
except ImportError:
pass
data_path = os.path.abspath(
os.path.join(os.path.dirname(__file__), "test_data"))
def datafile(name):
return os.path.join(data_path, name)... | none | 1 | 2.103162 | 2 | |
simple_french/guide/urls.py | ericgroom/simplefrench | 0 | 6631361 | from django.urls import path
from . import views
app_name = 'guide'
urlpatterns = [
path('', views.article_table_of_contents, name='list'),
path('<slug>', views.ArticleDetailView.as_view(), name='detail'),
] | from django.urls import path
from . import views
app_name = 'guide'
urlpatterns = [
path('', views.article_table_of_contents, name='list'),
path('<slug>', views.ArticleDetailView.as_view(), name='detail'),
] | none | 1 | 1.825041 | 2 | |
src/infrastructure/errors/unable_to_equalize_exception.py | OzielFilho/ProjetoFinalPdi | 0 | 6631362 | <filename>src/infrastructure/errors/unable_to_equalize_exception.py<gh_stars>0
from infrastructure.errors.image_exception import ImageException
class UnableToEqualizeImageException(ImageException):
pass
| <filename>src/infrastructure/errors/unable_to_equalize_exception.py<gh_stars>0
from infrastructure.errors.image_exception import ImageException
class UnableToEqualizeImageException(ImageException):
pass
| none | 1 | 1.475112 | 1 | |
stix_shifter_utils/stix_transmission/utils/RestApiClient.py | remkohdev/stix-shifter | 1 | 6631363 | import requests
from requests_toolbelt.adapters import host_header_ssl
import sys
import collections
import urllib.parse
import os
import errno
import uuid
# This is a simple HTTP client that can be used to access the REST API
class RestApiClient:
#cert_verify can be True -- do proper signed cert check, False -- ... | import requests
from requests_toolbelt.adapters import host_header_ssl
import sys
import collections
import urllib.parse
import os
import errno
import uuid
# This is a simple HTTP client that can be used to access the REST API
class RestApiClient:
#cert_verify can be True -- do proper signed cert check, False -- ... | en | 0.828274 | # This is a simple HTTP client that can be used to access the REST API #cert_verify can be True -- do proper signed cert check, False -- skip all cert checks, or a Cert -- use the proper cleint side cert #mutual_auth is in the case the gateway is being used #sni is none unless we are using a server cert #Gateway Case -... | 3.053075 | 3 |
action.py | XiaoPigYao/Aoto--CloudMusic-LevelUp | 0 | 6631364 | # -*- encoding: utf-8 -*-
"""
@FILE : action.py
@DSEC : 网易云音乐签到刷歌脚本
@AUTHOR : Secriy
@DATE : 2020/08/25
@VERSION : 2.4
"""
import os
import requests
import base64
import sys
import binascii
import argparse
import random
import hashlib
from Crypto.Cipher import AES
import json
# Get the arguments ... | # -*- encoding: utf-8 -*-
"""
@FILE : action.py
@DSEC : 网易云音乐签到刷歌脚本
@AUTHOR : Secriy
@DATE : 2020/08/25
@VERSION : 2.4
"""
import os
import requests
import base64
import sys
import binascii
import argparse
import random
import hashlib
from Crypto.Cipher import AES
import json
# Get the arguments ... | en | 0.233219 | # -*- encoding: utf-8 -*- @FILE : action.py @DSEC : 网易云音乐签到刷歌脚本 @AUTHOR : Secriy @DATE : 2020/08/25 @VERSION : 2.4 # Get the arguments input. # Get custom playlist.txt # Error # Calculate the MD5 value of text # Random String Generator # AES Encrypt # RSA Encrypt # Server Chan Turbo Push # Telegram ... | 2.359507 | 2 |
src/utils/dataset.py | MZSHAN/pytorch_yolov3 | 0 | 6631365 | from pathlib import Path
import warnings
import numpy as np
from PIL import Image
import torch
from torch.utils.data import Dataset
from skimage.transform import resize
from errors import ImageReadError, LabelFileReadError
#Basic Implementation - read image, convert to numpy array, exchange axes,
# make the imag... | from pathlib import Path
import warnings
import numpy as np
from PIL import Image
import torch
from torch.utils.data import Dataset
from skimage.transform import resize
from errors import ImageReadError, LabelFileReadError
#Basic Implementation - read image, convert to numpy array, exchange axes,
# make the imag... | en | 0.780672 | #Basic Implementation - read image, convert to numpy array, exchange axes, # make the image a square by padding with zeros, shift labels according # to make congruent with padded image #TODO: Add augmentations using Albumentations, imgaug and pytorch transforms Map style dataset to load COCO dataset from a file hav... | 2.608342 | 3 |
play/tests/test_handsorter.py | edelgm6/montecarlo-holdem | 0 | 6631366 | from django.test import TestCase
from play.models import Game, Deck, Card, Stage, Suit, Hand
from play.handsorter import HandSorter
class HandSorterTestCase(TestCase):
"""
TODO
Test that the corect Hand enum is returned in each test
"""
def test_sort_cards_sorts_high_to_low(self):
... | from django.test import TestCase
from play.models import Game, Deck, Card, Stage, Suit, Hand
from play.handsorter import HandSorter
class HandSorterTestCase(TestCase):
"""
TODO
Test that the corect Hand enum is returned in each test
"""
def test_sort_cards_sorts_high_to_low(self):
... | en | 0.915709 | TODO Test that the corect Hand enum is returned in each test | 2.752774 | 3 |
Lib/site-packages/django_mysql/models/__init__.py | pavanmaganti9/djangoapp | 0 | 6631367 | <reponame>pavanmaganti9/djangoapp
"""
isort:skip_file
"""
from django_mysql.models.base import Model # noqa
from django_mysql.models.aggregates import ( # noqa
BitAnd, BitOr, BitXor, GroupConcat,
)
from django_mysql.models.expressions import ListF, SetF # noqa
from django_mysql.models.query import ( # noqa
... | """
isort:skip_file
"""
from django_mysql.models.base import Model # noqa
from django_mysql.models.aggregates import ( # noqa
BitAnd, BitOr, BitXor, GroupConcat,
)
from django_mysql.models.expressions import ListF, SetF # noqa
from django_mysql.models.query import ( # noqa
add_QuerySetMixin, ApproximateInt,... | uz | 0.299772 | isort:skip_file # noqa # noqa # noqa # noqa # noqa | 1.829551 | 2 |
tools/data/window_file_select_vid_classes.py | myfavouritekk/TPN | 74 | 6631368 | <reponame>myfavouritekk/TPN
#!/usr/bin/env python
import argparse
import scipy.io as sio
import os
import os.path as osp
import numpy as np
from vdetlib.vdet.dataset import index_det_to_vdet
if __name__ == '__main__':
parser = argparse.ArgumentParser('Convert a window file for DET for VID.')
parser.add_argumen... | #!/usr/bin/env python
import argparse
import scipy.io as sio
import os
import os.path as osp
import numpy as np
from vdetlib.vdet.dataset import index_det_to_vdet
if __name__ == '__main__':
parser = argparse.ArgumentParser('Convert a window file for DET for VID.')
parser.add_argument('window_file')
parser.... | en | 0.648691 | #!/usr/bin/env python # read number line # end of the file # read image line # skip background or other non-vid classes # map DET index to VID | 2.300232 | 2 |
pyleecan/GUI/Dialog/DMachineSetup/SWSlot/PWSlot12/Ui_PWSlot12.py | EmileDvs/pyleecan | 5 | 6631369 | # -*- coding: utf-8 -*-
# File generated according to PWSlot12.ui
# WARNING! All changes made in this file will be lost!
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
from PySide2.QtCore import *
from P... | # -*- coding: utf-8 -*-
# File generated according to PWSlot12.ui
# WARNING! All changes made in this file will be lost!
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
from PySide2.QtCore import *
from P... | en | 0.418602 | # -*- coding: utf-8 -*- # File generated according to PWSlot12.ui # WARNING! All changes made in this file will be lost! ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ # setupUi # retranslateUi | 1.944157 | 2 |
conda/common/disk.py | jack-pappas/conda | 4,825 | 6631370 | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import absolute_import, division, print_function, unicode_literals
from contextlib import contextmanager
from os import unlink
from .._vendor.auxlib.compat import Utf8NamedTemporaryFile
@contextmanager
d... | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import absolute_import, division, print_function, unicode_literals
from contextlib import contextmanager
from os import unlink
from .._vendor.auxlib.compat import Utf8NamedTemporaryFile
@contextmanager
d... | en | 0.544649 | # -*- coding: utf-8 -*- # Copyright (C) 2012 Anaconda, Inc # SPDX-License-Identifier: BSD-3-Clause # content returns temporary file path with contents | 2.37829 | 2 |
classes/users.py | ravermeister/xmpp-chatbot | 1 | 6631371 | <filename>classes/users.py
# coding=utf-8
import asyncio
import logging
from common.strings import StaticAnswers
class UserInfo:
"""
queries, user info on the Server
such as online users and registered users
"""
def __init__(self, static_answers: StaticAnswers):
# init all necessary vari... | <filename>classes/users.py
# coding=utf-8
import asyncio
import logging
from common.strings import StaticAnswers
class UserInfo:
"""
queries, user info on the Server
such as online users and registered users
"""
def __init__(self, static_answers: StaticAnswers):
# init all necessary vari... | en | 0.618752 | # coding=utf-8 queries, user info on the Server such as online users and registered users # init all necessary variables # noinspection PyUnusedLocal # doesn't work with my ejabberd 21.12 # 'get-online-users-list', 'get-online-users', 'get-active-users', 'get-registered-users-list' Process the initial command resul... | 2.541959 | 3 |
integration-tests/integration_tests/integration_tests/end_to_end_tests/int_asynchronous_express_messaging_pattern_tests.py | tomzo/integration-adaptors | 0 | 6631372 | <filename>integration-tests/integration_tests/integration_tests/end_to_end_tests/int_asynchronous_express_messaging_pattern_tests.py
"""
Provides tests around the Asynchronous Express workflow, including sync-async wrapping
"""
from unittest import TestCase
from integration_tests.amq.amq import MHS_INBOUND_QUEUE
from ... | <filename>integration-tests/integration_tests/integration_tests/end_to_end_tests/int_asynchronous_express_messaging_pattern_tests.py
"""
Provides tests around the Asynchronous Express workflow, including sync-async wrapping
"""
from unittest import TestCase
from integration_tests.amq.amq import MHS_INBOUND_QUEUE
from ... | en | 0.729136 | Provides tests around the Asynchronous Express workflow, including sync-async wrapping These tests show an asynchronous express response from Spine via the MHS for the example message interaction of PSIS (Personal Spine Information Service). Asynchronous message interaction: - Message sent: PSIS Document L... | 2.059957 | 2 |
detectron2/src/classification/model.py | roaldi/ImageStore | 590 | 6631373 | <gh_stars>100-1000
import numpy as np
from PIL import Image
import sys
import os
import torch
import detectron2.utils.comm as comm
from detectron2.checkpoint import DetectionCheckpointer
from detectron2.data import build_detection_test_loader, build_detection_train_loader
from detectron2.config import get_cfg
from det... | import numpy as np
from PIL import Image
import sys
import os
import torch
import detectron2.utils.comm as comm
from detectron2.checkpoint import DetectionCheckpointer
from detectron2.data import build_detection_test_loader, build_detection_train_loader
from detectron2.config import get_cfg
from detectron2.engine impo... | en | 0.428997 | # convert image to opencv format # if attr_conf[i] > attr_thresh: # cls = attributes[attr[i]+1] + " " + cls | 2.133401 | 2 |
spotfinder/servers/adsc_client.py | dperl-sol/cctbx_project | 155 | 6631374 | from __future__ import absolute_import, division, print_function
from six.moves import range
import os
from spotfinder.diffraction.imagefiles import quick_image
from spotfinder.servers.multipart_encoder import post_multipart
def get_spotfinder_url(file_object,host,port):
testurl = "%s:%d"%(host,port)
selector = "/... | from __future__ import absolute_import, division, print_function
from six.moves import range
import os
from spotfinder.diffraction.imagefiles import quick_image
from spotfinder.servers.multipart_encoder import post_multipart
def get_spotfinder_url(file_object,host,port):
testurl = "%s:%d"%(host,port)
selector = "/... | en | 0.683086 | Usage: libtbx.python adsc_client.py <filepath> <force_binning> <convention> <host> <port> Four mandatory arguments: filepath: absolute or relative path name of the ADSC test image to be analyzed force_binning: True (client-side 2x2-pixel software binning; sometimes the best choice if raw data... | 1.96144 | 2 |
flask/hello.py | Sunsetboy/learning_python | 0 | 6631375 | <filename>flask/hello.py
from flask import Flask
from markupsafe import escape
app = Flask(__name__)
@app.route("/")
def hello_world():
return "<p>Hello world 2!!"
@app.route("/user/<username>")
def show_profile(username):
return f"Hello {escape(username)}"
| <filename>flask/hello.py
from flask import Flask
from markupsafe import escape
app = Flask(__name__)
@app.route("/")
def hello_world():
return "<p>Hello world 2!!"
@app.route("/user/<username>")
def show_profile(username):
return f"Hello {escape(username)}"
| none | 1 | 2.750374 | 3 | |
oarepo_model_builder/invenio/invenio_sample_app_poetry.py | Alzpeta/oarepo-model-builder | 0 | 6631376 | <reponame>Alzpeta/oarepo-model-builder<filename>oarepo_model_builder/invenio/invenio_sample_app_poetry.py
from ..builders import OutputBuilder
from ..outputs.toml import TOMLOutput
from ..utils.verbose import log
class InvenioSampleAppPoetryBuilder(OutputBuilder):
TYPE = 'invenio_sample_app_poetry'
def finis... | from ..builders import OutputBuilder
from ..outputs.toml import TOMLOutput
from ..utils.verbose import log
class InvenioSampleAppPoetryBuilder(OutputBuilder):
TYPE = 'invenio_sample_app_poetry'
def finish(self):
super().finish()
output: TOMLOutput = self.builder.get_output(
'toml... | en | 0.800973 | To install the sample app, run poetry install -E sample-app | 2.083683 | 2 |
test/common.py | jcrd/python-pkgbuilder | 0 | 6631377 | <gh_stars>0
from pathlib import Path
test1_pkg = 'test1-1-1-any.pkg.tar.xz'
test1_dep1_pkg = 'test1-dep1-1-1-any.pkg.tar.xz'
test1_makedep1_pkg = 'test1-makedep1-1-1-any.pkg.tar.xz'
localdir = str(Path(__file__).parent) + '/pkgbuilds'
chrootdir = '/var/lib/pkgbuilder'
def pkgnames(pkgs):
return [str(Path(p).nam... | from pathlib import Path
test1_pkg = 'test1-1-1-any.pkg.tar.xz'
test1_dep1_pkg = 'test1-dep1-1-1-any.pkg.tar.xz'
test1_makedep1_pkg = 'test1-makedep1-1-1-any.pkg.tar.xz'
localdir = str(Path(__file__).parent) + '/pkgbuilds'
chrootdir = '/var/lib/pkgbuilder'
def pkgnames(pkgs):
return [str(Path(p).name) for p in ... | none | 1 | 2.339042 | 2 | |
issues/migrations/0013_auto_20201012_1440.py | Floyd-Droid/jf-issue-tracker | 0 | 6631378 | <reponame>Floyd-Droid/jf-issue-tracker
# Generated by Django 3.1.1 on 2020-10-12 14:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('issues', '0012_auto_20201012_1437'),
]
operations = [
migrations.AlterField(
model_name='... | # Generated by Django 3.1.1 on 2020-10-12 14:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('issues', '0012_auto_20201012_1437'),
]
operations = [
migrations.AlterField(
model_name='project',
name='slug',
... | en | 0.784515 | # Generated by Django 3.1.1 on 2020-10-12 14:40 | 1.444915 | 1 |
answers/Khushi/Day 24/Question 2.py | vishaljha2121/30-DaysOfCode-March-2021 | 22 | 6631379 | <gh_stars>10-100
def countMinOperations(k,n):
r=0
while (True):
countZero=0
i=0
while(i<n):
if((k[i] & 1)>0):
break
elif(k[i]==0):
countZero+=1
i+=1
if(countZero==n):
return r
if(i==n):
... | def countMinOperations(k,n):
r=0
while (True):
countZero=0
i=0
while(i<n):
if((k[i] & 1)>0):
break
elif(k[i]==0):
countZero+=1
i+=1
if(countZero==n):
return r
if(i==n):
for j in ra... | none | 1 | 3.485106 | 3 | |
vizdoomaze/envs/vizdoomazeone11.py | fanyuzeng/Vizdoomaze | 3 | 6631380 | <reponame>fanyuzeng/Vizdoomaze
from vizdoomaze.envs.vizdoomenv import VizdoomEnv
class vizdoomazeOne11(VizdoomEnv):
def __init__(self):
super(vizdoomazeOne11, self).__init__(24) | from vizdoomaze.envs.vizdoomenv import VizdoomEnv
class vizdoomazeOne11(VizdoomEnv):
def __init__(self):
super(vizdoomazeOne11, self).__init__(24) | none | 1 | 1.584204 | 2 | |
src/pyglui/pyfontstash/setup.py | pupil-labs/pyglui | 24 | 6631381 | import platform
from Cython.Build import cythonize
from setuptools import Extension, setup
if platform.system() == "Darwin":
includes = ["/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers/"]
f = "-framework"
link_args = [f, "OpenGL"]
libs = []
compile_args = ["-D FONTSTASH_IMPLE... | import platform
from Cython.Build import cythonize
from setuptools import Extension, setup
if platform.system() == "Darwin":
includes = ["/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers/"]
f = "-framework"
link_args = [f, "OpenGL"]
libs = []
compile_args = ["-D FONTSTASH_IMPLE... | en | 0.536564 | # http://msdn.microsoft.com/de-de/library/hhzbb5c8.aspx # this package will be compiled into a single.so file. | 2.034631 | 2 |
see/__init__.py | ljcooke/see | 42 | 6631382 | <reponame>ljcooke/see
"""
see: dir for humans.
Documentation is available at https://ljcooke.github.io/see/
"""
from .inspector import see
from .output import SeeResult
__all__ = ['see', 'SeeResult']
__author__ = '<NAME>'
__contributors__ = 'See AUTHORS.rst'
__version__ = '1.4.1'
__copyright__ = 'Copyright (c) 200... | """
see: dir for humans.
Documentation is available at https://ljcooke.github.io/see/
"""
from .inspector import see
from .output import SeeResult
__all__ = ['see', 'SeeResult']
__author__ = '<NAME>'
__contributors__ = 'See AUTHORS.rst'
__version__ = '1.4.1'
__copyright__ = 'Copyright (c) 2009-2018 <NAME>'
__licen... | en | 0.800202 | see: dir for humans. Documentation is available at https://ljcooke.github.io/see/ | 1.25967 | 1 |
neo/io/nwbio.py | yger/python-neo | 199 | 6631383 | <gh_stars>100-1000
"""
NWBIO
=====
IO class for reading data from a Neurodata Without Borders (NWB) dataset
Documentation : https://www.nwb.org/
Depends on: h5py, nwb, dateutil
Supported: Read, Write
Python API - https://pynwb.readthedocs.io
Sample datasets from CRCNS - https://crcns.org/NWB
Sample datasets from All... | """
NWBIO
=====
IO class for reading data from a Neurodata Without Borders (NWB) dataset
Documentation : https://www.nwb.org/
Depends on: h5py, nwb, dateutil
Supported: Read, Write
Python API - https://pynwb.readthedocs.io
Sample datasets from CRCNS - https://crcns.org/NWB
Sample datasets from Allen Institute
- http... | en | 0.766314 | NWBIO ===== IO class for reading data from a Neurodata Without Borders (NWB) dataset Documentation : https://www.nwb.org/ Depends on: h5py, nwb, dateutil Supported: Read, Write Python API - https://pynwb.readthedocs.io Sample datasets from CRCNS - https://crcns.org/NWB Sample datasets from Allen Institute - http://a... | 2.136032 | 2 |
alpyro_msgs/actionlib_tutorials/averagingresult.py | rho2/alpyro_msgs | 1 | 6631384 | <filename>alpyro_msgs/actionlib_tutorials/averagingresult.py<gh_stars>1-10
from alpyro_msgs import RosMessage, float32
class AveragingResult(RosMessage):
__msg_typ__ = "actionlib_tutorials/AveragingResult"
__msg_def__ = "ZmxvYXQzMiBtZWFuCmZsb2F0MzIgc3RkX2RldgoK"
__md5_sum__ = "d5c7decf6df75ffb4367a05c1bcc7612"
... | <filename>alpyro_msgs/actionlib_tutorials/averagingresult.py<gh_stars>1-10
from alpyro_msgs import RosMessage, float32
class AveragingResult(RosMessage):
__msg_typ__ = "actionlib_tutorials/AveragingResult"
__msg_def__ = "ZmxvYXQzMiBtZWFuCmZsb2F0MzIgc3RkX2RldgoK"
__md5_sum__ = "d5c7decf6df75ffb4367a05c1bcc7612"
... | none | 1 | 2.166134 | 2 | |
hexun/hexun/spiders/pvcSpider.py | judypol/pytonStudy | 0 | 6631385 | <filename>hexun/hexun/spiders/pvcSpider.py
#!/usr/bin/python
# -*- coding: UTF-8 -*-
from scrapy.spiders import Spider
from scrapy.spiders import Request
import json
from items import HexunItem
from utils.urlUtils import UrlUtils
from utils.dateTimeUtils import DateTimeUtils
class PVCSpider(Spider):
name = 'pvc'
... | <filename>hexun/hexun/spiders/pvcSpider.py
#!/usr/bin/python
# -*- coding: UTF-8 -*-
from scrapy.spiders import Spider
from scrapy.spiders import Request
import json
from items import HexunItem
from utils.urlUtils import UrlUtils
from utils.dateTimeUtils import DateTimeUtils
class PVCSpider(Spider):
name = 'pvc'
... | fr | 0.208008 | #!/usr/bin/python # -*- coding: UTF-8 -*- | 2.398872 | 2 |
tests/util/kaldi-io-test.py | mxmpl/pykaldi | 916 | 6631386 | <reponame>mxmpl/pykaldi
from __future__ import print_function
import os
import unittest
from kaldi.util.io import *
class TestKaldiIO(unittest.TestCase):
def testClassifyRxfilename(self):
self.assertEqual(InputType.STANDARD_INPUT, classify_rxfilename(""))
self.assertEqual(InputType.NO_INPUT, cl... | from __future__ import print_function
import os
import unittest
from kaldi.util.io import *
class TestKaldiIO(unittest.TestCase):
def testClassifyRxfilename(self):
self.assertEqual(InputType.STANDARD_INPUT, classify_rxfilename(""))
self.assertEqual(InputType.NO_INPUT, classify_rxfilename(" "))
... | none | 1 | 2.367018 | 2 | |
orders/permissions.py | City-of-Turku/munpalvelut_backend | 0 | 6631387 | #!/usr/bin/env python
# coding=utf-8
from rest_framework import permissions
# Owner
class IsOwner(permissions.BasePermission):
def has_permission(self, request, view):
try:
return request.user and \
str(request.user.pk) == str(request.parser_context['kwargs']['user_pk'])
... | #!/usr/bin/env python
# coding=utf-8
from rest_framework import permissions
# Owner
class IsOwner(permissions.BasePermission):
def has_permission(self, request, view):
try:
return request.user and \
str(request.user.pk) == str(request.parser_context['kwargs']['user_pk'])
... | en | 0.549133 | #!/usr/bin/env python # coding=utf-8 # Owner # Company User # Rating | 2.281704 | 2 |
doc/integrating.py | The-Compiler/crashbin | 0 | 6631388 | import sys
import requests
import traceback
CRASHBIN_URL = 'http://crashbin.example.org/api/report/new/'
def handle_exception(exc_type, exc_value, exc_traceback):
title = traceback.format_exception_only(exc_type, exc_value)[0]
text = ''.join(traceback.format_exception(exc_type, exc_value, exc_traceback))
... | import sys
import requests
import traceback
CRASHBIN_URL = 'http://crashbin.example.org/api/report/new/'
def handle_exception(exc_type, exc_value, exc_traceback):
title = traceback.format_exception_only(exc_type, exc_value)[0]
text = ''.join(traceback.format_exception(exc_type, exc_value, exc_traceback))
... | none | 1 | 2.559735 | 3 | |
pythonFiles/printEnvVariablesToFile.py | ihnorton/vscode-python | 0 | 6631389 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import os
import json
import sys
# Last argument is the target file into which we'll write the env variables as json.
json_file = sys.argv[-1]
with open(json_file, 'w') as outfile:
json.dump(dict(os.environ), outfile)
| # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import os
import json
import sys
# Last argument is the target file into which we'll write the env variables as json.
json_file = sys.argv[-1]
with open(json_file, 'w') as outfile:
json.dump(dict(os.environ), outfile)
| en | 0.91062 | # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # Last argument is the target file into which we'll write the env variables as json. | 2.584117 | 3 |
datumaro/plugins/openvino_plugin/samples/ssd_vehicle_detection_interp.py | IRDonch/datumaro | 237 | 6631390 | <reponame>IRDonch/datumaro
# Copyright (C) 2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
from datumaro.components.annotation import AnnotationType, Bbox, LabelCategories
conf_thresh = 0.02
def _match_confs(confs, detections):
matches = [-1] * len(detections)
queries = {}
for i, det in enumera... | # Copyright (C) 2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
from datumaro.components.annotation import AnnotationType, Bbox, LabelCategories
conf_thresh = 0.02
def _match_confs(confs, detections):
matches = [-1] * len(detections)
queries = {}
for i, det in enumerate(detections):
que... | en | 0.360342 | # Copyright (C) 2021 Intel Corporation # # SPDX-License-Identifier: MIT # inputs = model input; array or images; shape = (B, H, W, C) # outputs = model output; shape = (1, 1, N, 7); N is the number of detected bounding boxes. # det = [image_id, label(class id), conf, x_min, y_min, x_max, y_max] # results = conversion r... | 1.866618 | 2 |
cloudnet-package/trainer/task.py | Windact/cloud_detection | 0 | 6631391 | <filename>cloudnet-package/trainer/task.py
from pathlib import Path
import argparse
import sys
import logging
from datetime import datetime
import tensorflow as tf
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.callbacks import ModelCheckpoint, ReduceLROnPlateau, CSVLogger, EarlyStopping,TensorBoa... | <filename>cloudnet-package/trainer/task.py
from pathlib import Path
import argparse
import sys
import logging
from datetime import datetime
import tensorflow as tf
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.callbacks import ModelCheckpoint, ReduceLROnPlateau, CSVLogger, EarlyStopping,TensorBoa... | en | 0.500677 | # logger Parses command-line arguments. # Get the arguments #BATCH_SIZE = args.batch_size # SHUFFLE_BUFFER = 10 * BATCH_SIZE # RANDOM_STATE = args.random_state # AUTOTUNE = tf.data.experimental.AUTOTUNE #quick_test = args.quick_test # not implemented # hparams # starting_learning_rate = args.starting_learning_rate # en... | 2.056655 | 2 |
james-2.3.1/bin/sendmail.py | ViktorKovalenko/java_pft | 1 | 6631392 | <gh_stars>1-10
#!/usr/bin/python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Lic... | #!/usr/bin/python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2... | en | 0.770958 | #!/usr/bin/python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2... | 2.101563 | 2 |
openregistry/lots/core/includeme.py | oleksiyVeretiuk/openregistry.lots.core | 0 | 6631393 | # -*- coding: utf-8 -*-
import logging
from pyramid.interfaces import IRequest
from openregistry.lots.core.utils import (
extract_lot, isLot, register_lotType,
lot_from_data, SubscribersPicker
)
from openprocurement.api.app import get_evenly_plugins
from openprocurement.api.interfaces import IContentConfigurato... | # -*- coding: utf-8 -*-
import logging
from pyramid.interfaces import IRequest
from openregistry.lots.core.utils import (
extract_lot, isLot, register_lotType,
lot_from_data, SubscribersPicker
)
from openprocurement.api.app import get_evenly_plugins
from openprocurement.api.interfaces import IContentConfigurato... | en | 0.735043 | # -*- coding: utf-8 -*- # lotType plugins support # search for plugins | 1.919345 | 2 |
conf/__init__.py | detorr/brook-web | 253 | 6631394 | #coding=utf-8
#。——————————————————————————————————————————
#。
#。 __init__.py.py
#。
#。 @Time : 2019-03-31 08:02
#。 @Author : capton
#。 @Software: PyCharm ... | #coding=utf-8
#。——————————————————————————————————————————
#。
#。 __init__.py.py
#。
#。 @Time : 2019-03-31 08:02
#。 @Author : capton
#。 @Software: PyCharm ... | zh | 0.58204 | #coding=utf-8 #。—————————————————————————————————————————— #。 #。 __init__.py.py #。 #。 @Time : 2019-03-31 08:02 #。 @Author : capton #。 @Software: PyCharm #。 @Blog : http://ccapton.cn #。 @Github : https://github.com/ccapton #。 @Email : <EMAIL> #。__________________________________________ | 1.398106 | 1 |
chatbot/utils3.py | innaiivanova/chatbot | 0 | 6631395 | # Codecademy Looping Coffee Chatbot
# <NAME>
# utils3.py works with chatbot3.py
def print_message():
print('I\'m sorry, I did not understand your selection. Please enter the corresponding letter for your response.')
def get_size():
res = input('What size drink can I get for you? \n[a] Small \n[b] Medium \n[c]... | # Codecademy Looping Coffee Chatbot
# <NAME>
# utils3.py works with chatbot3.py
def print_message():
print('I\'m sorry, I did not understand your selection. Please enter the corresponding letter for your response.')
def get_size():
res = input('What size drink can I get for you? \n[a] Small \n[b] Medium \n[c]... | en | 0.57119 | # Codecademy Looping Coffee Chatbot # <NAME> # utils3.py works with chatbot3.py | 4.063318 | 4 |
python/runtime/pai/tensorflow/evaluate.py | lhw362950217/sqlflow | 0 | 6631396 | # Copyright 2020 The SQLFlow 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 applicable law o... | # Copyright 2020 The SQLFlow 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 applicable law o... | en | 0.808378 | # Copyright 2020 The SQLFlow 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 applicable law o... | 1.986266 | 2 |
Codewars/7kyu/friendOrFoe.py | Ry4nW/python-wars | 1 | 6631397 | def friend(x):
friendList = []
for i in x:
friendList.append(i) if len(i) == 4 else None
return friendList
# "Tenary" without {else} in list declaration needs to come
# after loop, e.g.
def friend2(x):
return [f for f in x if len(f) == 4] | def friend(x):
friendList = []
for i in x:
friendList.append(i) if len(i) == 4 else None
return friendList
# "Tenary" without {else} in list declaration needs to come
# after loop, e.g.
def friend2(x):
return [f for f in x if len(f) == 4] | en | 0.88231 | # "Tenary" without {else} in list declaration needs to come # after loop, e.g. | 3.568487 | 4 |
examples/testes_tcc/teste_velocidade_de_movimento.py | filereno/dronekit-python | 0 | 6631398 | <reponame>filereno/dronekit-python
##########DEPENDENCIES#############
from dronekit import connect, VehicleMode,LocationGlobalRelative,APIException
import time
import socket
#import exceptions
import math
import argparse
from pymavlink import mavutil
#########FUNCTIONS#################
def connectMyCopter():
parse... | ##########DEPENDENCIES#############
from dronekit import connect, VehicleMode,LocationGlobalRelative,APIException
import time
import socket
#import exceptions
import math
import argparse
from pymavlink import mavutil
#########FUNCTIONS#################
def connectMyCopter():
parser = argparse.ArgumentParser(descrip... | en | 0.594413 | ##########DEPENDENCIES############# #import exceptions #########FUNCTIONS################# ##meters Move vehicle in direction based on specified velocity vectors. # time_boot_ms (not used) # target system, target component # frame # type_mask (only speeds enabled) # x, y, z positions (not used) # x, y, z velocity in m/... | 2.832681 | 3 |
examples/docs_snippets/docs_snippets/legacy/dagster_pandas_guide/shape_constrained_trip.py | makotonium/dagster | 1 | 6631399 | <reponame>makotonium/dagster
from datetime import datetime
from dagster import Out, job, op
from dagster.utils import script_relative_path
from dagster_pandas import RowCountConstraint, create_dagster_pandas_dataframe_type
from pandas import DataFrame, read_csv
# start_create_type
ShapeConstrainedTripDataFrame = crea... | from datetime import datetime
from dagster import Out, job, op
from dagster.utils import script_relative_path
from dagster_pandas import RowCountConstraint, create_dagster_pandas_dataframe_type
from pandas import DataFrame, read_csv
# start_create_type
ShapeConstrainedTripDataFrame = create_dagster_pandas_dataframe_t... | en | 0.108884 | # start_create_type # end_create_type | 2.470645 | 2 |
sample02_always_alive.py | CMA2401PT/Phoenix-Transfer | 3 | 6631400 | <filename>sample02_always_alive.py
from proxy import forward
from proxy import utils
from threading import Thread
from queue import Queue
import time
# 有两个子线程,一个负责停的解析数据,并通过 Queue 将解析结果在线程之间传递
# 另一个子线程的目仅仅负责发送指令
# 当任意子线程死亡时,主线程尝试重连
class Config(object):
def __init__(self) -> None:
self.recv_thread_alive=... | <filename>sample02_always_alive.py
from proxy import forward
from proxy import utils
from threading import Thread
from queue import Queue
import time
# 有两个子线程,一个负责停的解析数据,并通过 Queue 将解析结果在线程之间传递
# 另一个子线程的目仅仅负责发送指令
# 当任意子线程死亡时,主线程尝试重连
class Config(object):
def __init__(self) -> None:
self.recv_thread_alive=... | zh | 0.905708 | # 有两个子线程,一个负责停的解析数据,并通过 Queue 将解析结果在线程之间传递 # 另一个子线程的目仅仅负责发送指令 # 当任意子线程死亡时,主线程尝试重连 # 还未实现该类型数据的解析(会有很多很多的数据包!) # print(f'unkown decode packet ({packet_id}): ',bytes_msg) # 已经实现类型数据的解析 | 2.827014 | 3 |
nautobot_device_onboarding/netdev_keeper.py | tim-fiola/nautobot-plugin-device-onboarding | 0 | 6631401 | <reponame>tim-fiola/nautobot-plugin-device-onboarding
"""NetDev Keeper.
(c) 2020-2021 Network To Code
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
Unl... | """NetDev Keeper.
(c) 2020-2021 Network To Code
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... | en | 0.781307 | NetDev Keeper. (c) 2020-2021 Network To Code 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, s... | 1.771995 | 2 |
call_variants.py | CGL-Deeplearning/FRIDAY | 6 | 6631402 | import argparse
import sys
import torch
import torch.nn as nn
import numpy as np
from torch.utils.data import DataLoader
from torchvision import transforms
import multiprocessing
from torch.autograd import Variable
from modules.models.Seq2Seq_atn import EncoderCRNN, AttnDecoderRNN
from modules.core.dataloader_test impo... | import argparse
import sys
import torch
import torch.nn as nn
import numpy as np
from torch.utils.data import DataLoader
from torchvision import transforms
import multiprocessing
from torch.autograd import Variable
from modules.models.Seq2Seq_atn import EncoderCRNN, AttnDecoderRNN
from modules.core.dataloader_test impo... | en | 0.695669 | This script uses a trained model to call variants on a given set of images generated from the genome. The process is: - Create a prediction table/dictionary using a trained neural network - Convert those predictions to a VCF file INPUT: - A trained model - Set of images for prediction Output: - A VCF file containing ... | 2.561951 | 3 |
utils/az_zone.py | dcalacci/labbox | 1 | 6631403 | import datetime
import numpy as np
import boto3
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
#import aws_spot_bot.config.default as uconf
from .. import configs
from configs import default as uconf
class AZZone():
def __init__(self, region, name):
self.region = regio... | import datetime
import numpy as np
import boto3
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
#import aws_spot_bot.config.default as uconf
from .. import configs
from configs import default as uconf
class AZZone():
def __init__(self, region, name):
self.region = regio... | en | 0.893165 | #import aws_spot_bot.config.default as uconf Returns the spot price history given a specified AZ and region. # TODO: This should be removed but I am lazy and this is easier than catching exceptions # @jgre can you fix? # We are not interested in this AZ if its more than the bid, so lets just return # Here we multiply e... | 2.38317 | 2 |
util/dataset.py | chunbolang/HPA | 3 | 6631404 | import os
import os.path
import cv2
import numpy as np
import copy
from torch.utils.data import Dataset
import torch.nn.functional as F
import torch
import random
import time
from tqdm import tqdm
from .get_weak_anns import transform_anns
IMG_EXTENSIONS = ['.jpg', '.jpeg', '.png', '.ppm', '.bmp', '.pgm']
def is_i... | import os
import os.path
import cv2
import numpy as np
import copy
from torch.utils.data import Dataset
import torch.nn.functional as F
import torch
import random
import time
from tqdm import tqdm
from .get_weak_anns import transform_anns
IMG_EXTENSIONS = ['.jpg', '.jpeg', '.png', '.ppm', '.bmp', '.pgm']
def is_i... | en | 0.523007 | # Shaban uses these lines to remove small objects: # if util.change_coordinates(mask, 32.0, 0.0).sum() > 2: # filtered_item.append(item) # which means the mask will be downsampled to 1/32 of the original size and the valid area should be larger than 2, # therefore the area in original size should be accordingly larg... | 2.70684 | 3 |
setup_competition.py | JakeRoggenbuck/server-public | 1 | 6631405 | #!/usr/bin/env python3
# Copyright (c) 2019 FRC Team 1678: Citrus Circuits
"""Sets up the MongoDB document for a competition, should be run before every competition."""
# External imports
import re
from pymongo import MongoClient
# Internal imports
import cloud_database_communicator
import local_database_communicator
i... | #!/usr/bin/env python3
# Copyright (c) 2019 FRC Team 1678: Citrus Circuits
"""Sets up the MongoDB document for a competition, should be run before every competition."""
# External imports
import re
from pymongo import MongoClient
# Internal imports
import cloud_database_communicator
import local_database_communicator
i... | en | 0.818235 | #!/usr/bin/env python3 # Copyright (c) 2019 FRC Team 1678: Citrus Circuits Sets up the MongoDB document for a competition, should be run before every competition. # External imports # Internal imports # Makes connection with local database through port 27017, the default listening port of MongoDB # Use a regular expres... | 3.044832 | 3 |
helpmeplease/helpme.py | Max1993Liu/ask_for_help | 0 | 6631406 | import smtplib
import ssl
import json
import os
import socket
import functools
from pathlib import Path
from email.message import EmailMessage
from .trackerror import get_code
__all__ = ['ask_for_help', 'show_recipients', 'add_recipient', 'reset_my_email', 'init_setting']
_CONFIG_PATH = Path(__file__).absolute().... | import smtplib
import ssl
import json
import os
import socket
import functools
from pathlib import Path
from email.message import EmailMessage
from .trackerror import get_code
__all__ = ['ask_for_help', 'show_recipients', 'add_recipient', 'reset_my_email', 'init_setting']
_CONFIG_PATH = Path(__file__).absolute().... | en | 0.486614 | Send msg Create an error report # replace tab with spaces for better formatting # generate an error report | 2.700957 | 3 |
examples/rec_sys.py | getumen/oml | 1 | 6631407 | <gh_stars>1-10
from __future__ import absolute_import
from __future__ import division
from __future__ import generators
from __future__ import print_function
from __future__ import unicode_literals
import os
import numpy as np
from matplotlib import pyplot as plt
from oml.datasouces.iterator import DictIterator
from... | from __future__ import absolute_import
from __future__ import division
from __future__ import generators
from __future__ import print_function
from __future__ import unicode_literals
import os
import numpy as np
from matplotlib import pyplot as plt
from oml.datasouces.iterator import DictIterator
from oml.models.fm ... | none | 1 | 2.099518 | 2 | |
Chapter 2/ch2_challenge3.py | MattSumrall/python-projects | 0 | 6631408 | <filename>Chapter 2/ch2_challenge3.py
# <NAME>
# ITEC 1250
# Chapter 2 Challenge 3
# Tipper Program
print("\nWhat is your bill total?")
total = float(input("\nEnter your food charge: "))
a = total * .15
b = total * .20
print("\n15% tip: $" + format(a, ",.2f"), "\n20% tip: $" + format(b, ",.2f"), sep =... | <filename>Chapter 2/ch2_challenge3.py
# <NAME>
# ITEC 1250
# Chapter 2 Challenge 3
# Tipper Program
print("\nWhat is your bill total?")
total = float(input("\nEnter your food charge: "))
a = total * .15
b = total * .20
print("\n15% tip: $" + format(a, ",.2f"), "\n20% tip: $" + format(b, ",.2f"), sep =... | en | 0.569313 | # <NAME> # ITEC 1250 # Chapter 2 Challenge 3 # Tipper Program | 3.921039 | 4 |
Platforms/Osu/main_osu.py | The-CJ/Phaazebot | 2 | 6631409 | <gh_stars>1-10
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from phaazebot import Phaazebot
import osu_irc
class PhaazebotOsu(osu_irc.Client):
def __init__(self, BASE:"Phaazebot", *args, **kwargs):
super().__init__(*args, **kwargs)
self.BASE:"Phaazebot" = BASE
def __bool__(self):
return self.BASE.IsRe... | from typing import TYPE_CHECKING
if TYPE_CHECKING:
from phaazebot import Phaazebot
import osu_irc
class PhaazebotOsu(osu_irc.Client):
def __init__(self, BASE:"Phaazebot", *args, **kwargs):
super().__init__(*args, **kwargs)
self.BASE:"Phaazebot" = BASE
def __bool__(self):
return self.BASE.IsReady.osu
async... | none | 1 | 2.836995 | 3 | |
test/test_packet.py | beckjake/pyssh | 0 | 6631410 | <filename>test/test_packet.py
import unittest
import pytest
import io
from pyssh import packet
from pyssh.crypto import hashers, symmetric
from pyssh import compression
from builtins import int, bytes
class DummyCipher(object):
def __init__(self, block_size):
self.block_size = block_size
class Object(o... | <filename>test/test_packet.py
import unittest
import pytest
import io
from pyssh import packet
from pyssh.crypto import hashers, symmetric
from pyssh import compression
from builtins import int, bytes
class DummyCipher(object):
def __init__(self, block_size):
self.block_size = block_size
class Object(o... | en | 0.506551 | Test padding messages to some length. # secondary goal # secondary goal # return b''.join((bytes[(c+128 % 256)] for c in bytes(data))) # TODO: fix this test. #@pytest.<EMAIL>.xfail | 2.903814 | 3 |
testscripts/RDKB/component/HAL_Ethsw/TS_ethsw_stub_hal_Set_Port_Admin_Status_True_Disabled_Port.py | cablelabs/tools-tdkb | 0 | 6631411 | <reponame>cablelabs/tools-tdkb
##########################################################################
# Copyright 2016-2017 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 ... | ##########################################################################
# Copyright 2016-2017 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/li... | en | 0.486629 | ########################################################################## # Copyright 2016-2017 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/li... | 1.123058 | 1 |
API/src/main/resources/Lib/robot/errors.py | TagExpress/SikuliX1 | 0 | 6631412 | # Copyright (c) 2010-2020, sikuli.org, sikulix.com - MIT license
#
# 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 b... | # Copyright (c) 2010-2020, sikuli.org, sikulix.com - MIT license
#
# 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 b... | en | 0.816489 | # Copyright (c) 2010-2020, sikuli.org, sikulix.com - MIT license # # 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 b... | 2.442519 | 2 |
dbReports/iondb/rundb/data/archive_report.py | sequencer2014/TS | 0 | 6631413 | <gh_stars>0
#!/usr/bin/env python
# Copyright (C) 2014 Ion Torrent Systems, Inc. All Rights Reserved
#
# List all Reports and status of file categories, showing archive location
#
import sys
from iondb.bin import djangoinit
from iondb.rundb.models import Results
from iondb.rundb.data import dmactions_types
# Write the... | #!/usr/bin/env python
# Copyright (C) 2014 Ion Torrent Systems, Inc. All Rights Reserved
#
# List all Reports and status of file categories, showing archive location
#
import sys
from iondb.bin import djangoinit
from iondb.rundb.models import Results
from iondb.rundb.data import dmactions_types
# Write the column head... | en | 0.696278 | #!/usr/bin/env python # Copyright (C) 2014 Ion Torrent Systems, Inc. All Rights Reserved # # List all Reports and status of file categories, showing archive location # # Write the column headers # Get list of Result objects from database # Get DMFileStat objects for this Report | 1.969358 | 2 |
tests/clients/test_alerts.py | ryanvanasse/py42 | 0 | 6631414 | <gh_stars>0
import pytest
from py42.clients.alerts import AlertsClient
from py42.sdk.queries.alerts.alert_query import AlertQuery
from py42.services.alertrules import AlertRulesService
from py42.services.alerts import AlertService
@pytest.fixture
def mock_alerts_service(mocker):
return mocker.MagicMock(spec=Aler... | import pytest
from py42.clients.alerts import AlertsClient
from py42.sdk.queries.alerts.alert_query import AlertQuery
from py42.services.alertrules import AlertRulesService
from py42.services.alerts import AlertService
@pytest.fixture
def mock_alerts_service(mocker):
return mocker.MagicMock(spec=AlertService)
... | none | 1 | 2.145568 | 2 | |
will/plugins/friendly/random_topic.py | Ashex/will | 349 | 6631415 | <reponame>Ashex/will
from will.plugin import WillPlugin
from will.decorators import respond_to, periodic, hear, randomly, route, rendered_template, require_settings
import requests
class RandomTopicPlugin(WillPlugin):
@respond_to("new topic")
def give_us_somethin_to_talk_about(self, message):
"""new... | from will.plugin import WillPlugin
from will.decorators import respond_to, periodic, hear, randomly, route, rendered_template, require_settings
import requests
class RandomTopicPlugin(WillPlugin):
@respond_to("new topic")
def give_us_somethin_to_talk_about(self, message):
"""new topic: set the room ... | en | 0.833777 | new topic: set the room topic to a random conversation starter. | 2.787349 | 3 |
chemprop/data/vocab.py | wengong-jin/chemprop | 77 | 6631416 | <reponame>wengong-jin/chemprop
from argparse import Namespace
from copy import deepcopy
from functools import partial
from multiprocessing import Pool
import random
from typing import Callable, List, FrozenSet, Set, Tuple, Union
from collections import Counter
from rdkit import Chem
import torch
from chemprop.feature... | from argparse import Namespace
from copy import deepcopy
from functools import partial
from multiprocessing import Pool
import random
from typing import Callable, List, FrozenSet, Set, Tuple, Union
from collections import Counter
from rdkit import Chem
import torch
from chemprop.features import atom_features, bond_fe... | en | 0.878891 | # don't need a real vocab list here # in this case, we didn't map to a vocab at all; we're just predicting the original features Recursively gets all substructures up to a maximum size starting from an atom in a substructure. :param atom: The atom to start at. :param max_size: The maximum size of the substruct... | 2.105777 | 2 |
demo/app01/models.py | General-ITer/Django-Introduction | 0 | 6631417 | from django.db import models
# Create your models here.
class ap1(models.Model):
username = models.CharField(max_length=30)
class Meta:
app_label = 'app02' #如果指定将在app02对应的数据库下创建数据表
class ap2(models.Model):
first_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50... | from django.db import models
# Create your models here.
class ap1(models.Model):
username = models.CharField(max_length=30)
class Meta:
app_label = 'app02' #如果指定将在app02对应的数据库下创建数据表
class ap2(models.Model):
first_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50... | zh | 0.592169 | # Create your models here. #如果指定将在app02对应的数据库下创建数据表 | 2.408643 | 2 |
terroroftinytown/tracker/bootstrap.py | Flashfire42/terroroftinytown | 59 | 6631418 | <gh_stars>10-100
# encoding=utf-8
import argparse
import configparser
import logging
import signal
import redis
import tornado.httpserver
import tornado.ioloop
from terroroftinytown.tracker.app import Application
from terroroftinytown.tracker.database import Database
from terroroftinytown.tracker.logs import GzipTime... | # encoding=utf-8
import argparse
import configparser
import logging
import signal
import redis
import tornado.httpserver
import tornado.ioloop
from terroroftinytown.tracker.app import Application
from terroroftinytown.tracker.database import Database
from terroroftinytown.tracker.logs import GzipTimedRotatingFileHand... | en | 0.70014 | # encoding=utf-8 | 1.932263 | 2 |
addons/mod.py | Ha1vorsen/Kurisu | 0 | 6631419 | import datetime
import discord
import json
import re
import time
from discord.ext import commands
from subprocess import call
class Mod:
"""
Staff commands.
"""
def __init__(self, bot):
self.bot = bot
print('Addon "{}" loaded'.format(self.__class__.__name__))
async def add_restrict... | import datetime
import discord
import json
import re
import time
from discord.ext import commands
from subprocess import call
class Mod:
"""
Staff commands.
"""
def __init__(self, bot):
self.bot = bot
print('Addon "{}" loaded'.format(self.__class__.__name__))
async def add_restrict... | en | 0.714654 | Staff commands. Stops the bot. Pull new changes from GitHub and restart. Gets user info. Staff and Helpers only. Match users by regex. #{}\n".format(m.id, m.name, m.discriminator) Multi-ban users. #{}\n".format(m.id, m.name, m.discriminator) Multi-ban users by regex. # because "dictionary changed size during iteration"... | 2.452453 | 2 |
PhysicsTools/PatExamples/test/analyzePatBTag_cfg.py | ckamtsikis/cmssw | 852 | 6631420 | import FWCore.ParameterSet.Config as cms
from PhysicsTools.PatUtils.bJetOperatingPointsParameters_cfi import *
process = cms.Process("PatBTagAnalyzer")
process.source = cms.Source("PoolSource",
#fileNames = cms.untracked.vstring('file:PATLayer1_Output.fromAOD_full_ttbar.root')
fileNames = cms.untracked.vstri... | import FWCore.ParameterSet.Config as cms
from PhysicsTools.PatUtils.bJetOperatingPointsParameters_cfi import *
process = cms.Process("PatBTagAnalyzer")
process.source = cms.Source("PoolSource",
#fileNames = cms.untracked.vstring('file:PATLayer1_Output.fromAOD_full_ttbar.root')
fileNames = cms.untracked.vstri... | en | 0.540353 | #fileNames = cms.untracked.vstring('file:PATLayer1_Output.fromAOD_full_ttbar.root') # PAT Layer 1 # need to load this # even if we run only layer 1 # request a summary at the end of the file | 1.668577 | 2 |
soccer/gameplay/fsm.py | Alex-Gurung/robocup-software | 1 | 6631421 | <gh_stars>1-10
import logging
from enum import Enum
import graphviz as gv
from typing import Union, Callable
## @brief generic hierarchial state machine class.
#
# states can have substates. If the machine is in a state, then it is also implicitly in that state's parent state
# this basically provides for polymorphis... | import logging
from enum import Enum
import graphviz as gv
from typing import Union, Callable
## @brief generic hierarchial state machine class.
#
# states can have substates. If the machine is in a state, then it is also implicitly in that state's parent state
# this basically provides for polymorphism/subclassing o... | en | 0.815515 | ## @brief generic hierarchial state machine class. # # states can have substates. If the machine is in a state, then it is also implicitly in that state's parent state # this basically provides for polymorphism/subclassing of state machines # # There are three methods corresponding to each state: # * on_enter_STATE # ... | 2.805237 | 3 |
gmpm.py | eyalbetzalel/pytorch-generative-v6 | 0 | 6631422 | import h5py
import numpy as np
import os
def load_h5_dataset(directory):
print(" --------------------------------- ")
print("Start loading Datasat from H5DF files...")
data = []
flagOneFile = 0
for filename in os.listdir(directory):
if flagOneFile:
break
if filename.end... | import h5py
import numpy as np
import os
def load_h5_dataset(directory):
print(" --------------------------------- ")
print("Start loading Datasat from H5DF files...")
data = []
flagOneFile = 0
for filename in os.listdir(directory):
if flagOneFile:
break
if filename.end... | en | 0.33085 | # Get the data | 2.466875 | 2 |
XML_parser.py | arkasarius/python-IMDB-TFG | 1 | 6631423 | import xml.etree.ElementTree as ET
import os
import json
import functions as fun
tree = ET.parse('The_Matrix.xml')
root = tree.getroot()
a=0
for face in root.iter('Face'):
name=int(face.attrib.get('person_id'))
f=open("thematrix/"+str(name)+".txt","a+")
n=face.attrib.get('face_embedding').replace("[","").re... | import xml.etree.ElementTree as ET
import os
import json
import functions as fun
tree = ET.parse('The_Matrix.xml')
root = tree.getroot()
a=0
for face in root.iter('Face'):
name=int(face.attrib.get('person_id'))
f=open("thematrix/"+str(name)+".txt","a+")
n=face.attrib.get('face_embedding').replace("[","").re... | none | 1 | 2.687968 | 3 | |
plenum/test/pool_transactions/test_nodes_ha_change_back.py | steptan/indy-plenum | 0 | 6631424 | from plenum.common.constants import ALIAS, NODE_IP, NODE_PORT, CLIENT_IP, CLIENT_PORT
from plenum.test.pool_transactions.helper import updateNodeData
from plenum.test.test_node import TestNode, checkNodesConnected
from stp_core.network.port_dispenser import genHa
from plenum.common.config_helper import PNodeConfigHelpe... | from plenum.common.constants import ALIAS, NODE_IP, NODE_PORT, CLIENT_IP, CLIENT_PORT
from plenum.test.pool_transactions.helper import updateNodeData
from plenum.test.test_node import TestNode, checkNodesConnected
from stp_core.network.port_dispenser import genHa
from plenum.common.config_helper import PNodeConfigHelpe... | en | 0.781484 | The case: The Node HA is updated with some HA (let's name it 'correct' HA). Then the Steward makes a mistake and sends the NODE txn with other HA ('wrong' HA). The Steward replaces back 'wrong' HA by 'correct' HA sending yet another one NODE txn. # use the same client HA # do all exercis... | 1.883327 | 2 |
Analyze_other_models.py | panda0881/Selectional_Preference | 0 | 6631425 | <reponame>panda0881/Selectional_Preference
import os
import json
from scipy.stats import spearmanr
def analyze_model(model_name):
print('We are working on model:', model_name)
tmp_dobj_scores = list()
with open('Other_model_result/' + model_name + '_verb_dobj_result', 'r') as f:
for line in f:
... | import os
import json
from scipy.stats import spearmanr
def analyze_model(model_name):
print('We are working on model:', model_name)
tmp_dobj_scores = list()
with open('Other_model_result/' + model_name + '_verb_dobj_result', 'r') as f:
for line in f:
words = line[:-1].split('\t')
... | en | 0.26733 | # if tmp_nsubj_scores[i] == 0: # continue # analyze_model('depemb') # analyze_model('word2vec') # analyze_model('glove') # analyze_model('depcontext') # # print('') # analyze_model('wiki_pp') # analyze_model('yelp_pp') # analyze_model('nyt_pp') # print('') # analyze_model('wiki_ds') # analyze_model('yelp_ds') # ana... | 2.733311 | 3 |
diddiparser/lib/__init__.py | DiddiLeija/diddiparser | 1 | 6631426 | <filename>diddiparser/lib/__init__.py<gh_stars>1-10
"Standard lib for DiddiScript."
from diddiparser.lib import lang_runners
from diddiparser.lib import diddi_stdfuncs
from diddiparser.lib.lang_runners import __all__ as lang_runners_all
from diddiparser.lib.diddi_stdfuncs import __all__ as diddi_stdfuncs_all
__all__... | <filename>diddiparser/lib/__init__.py<gh_stars>1-10
"Standard lib for DiddiScript."
from diddiparser.lib import lang_runners
from diddiparser.lib import diddi_stdfuncs
from diddiparser.lib.lang_runners import __all__ as lang_runners_all
from diddiparser.lib.diddi_stdfuncs import __all__ as diddi_stdfuncs_all
__all__... | en | 0.924323 | # add here the known functions | 1.915649 | 2 |
PlanIt/notebooks/cost_handling.py | awoodwa/PlanIt | 0 | 6631427 | def cost_of_wind(turbines):
'''
This function takes the number of turbines to be installed and
calculates the cost of installation.
Inputs
turbines : integer value of turbines (1.3M USD per turbine)
Outputs
cost : float value of dollars
'''
# 1 turbine costs approximately 1... | def cost_of_wind(turbines):
'''
This function takes the number of turbines to be installed and
calculates the cost of installation.
Inputs
turbines : integer value of turbines (1.3M USD per turbine)
Outputs
cost : float value of dollars
'''
# 1 turbine costs approximately 1... | en | 0.817378 | This function takes the number of turbines to be installed and calculates the cost of installation. Inputs turbines : integer value of turbines (1.3M USD per turbine) Outputs cost : float value of dollars # 1 turbine costs approximately 1.3 M USD This function calculates the cost of a sola... | 4.018326 | 4 |
jetpack/functional.py | vasudevanv/jetpack | 0 | 6631428 | <filename>jetpack/functional.py
import functools
def first(x):
return x[0]
def last(x):
return x[-1]
def compose(*functions):
return functools.reduce(lambda f, g: lambda x: f(g(x)), functions, lambda x: x)
def _polyval(coeffs, x):
p = coeffs[0]
for c in coeffs[1:]:
p = c + x*p
re... | <filename>jetpack/functional.py
import functools
def first(x):
return x[0]
def last(x):
return x[-1]
def compose(*functions):
return functools.reduce(lambda f, g: lambda x: f(g(x)), functions, lambda x: x)
def _polyval(coeffs, x):
p = coeffs[0]
for c in coeffs[1:]:
p = c + x*p
re... | none | 1 | 2.884258 | 3 | |
plugins/ghetto.py | Arna-Maity/corobo | 81 | 6631429 | import re
import requests
from errbot import BotPlugin, re_botcmd
class Ghetto(BotPlugin):
"""
Real talk yo
"""
@re_botcmd(pattern=r'ghetto\s+(.+)',
re_cmd_name_help='ghetto <sentence>',
flags=re.IGNORECASE)
def ghetto(self, msg, match):
"""
Real ta... | import re
import requests
from errbot import BotPlugin, re_botcmd
class Ghetto(BotPlugin):
"""
Real talk yo
"""
@re_botcmd(pattern=r'ghetto\s+(.+)',
re_cmd_name_help='ghetto <sentence>',
flags=re.IGNORECASE)
def ghetto(self, msg, match):
"""
Real ta... | en | 0.895787 | Real talk yo Real talk yo | 2.680181 | 3 |
pyro/distributions/transforms/polynomial.py | akern40/pyro | 1 | 6631430 | <filename>pyro/distributions/transforms/polynomial.py<gh_stars>1-10
# Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import math
import torch
import torch.nn as nn
from torch.distributions import constraints
from pyro.distributions.torch_transform import TransformModule
from py... | <filename>pyro/distributions/transforms/polynomial.py<gh_stars>1-10
# Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import math
import torch
import torch.nn as nn
from torch.distributions import constraints
from pyro.distributions.torch_transform import TransformModule
from py... | en | 0.767842 | # Copyright (c) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 An autoregressive bijective transform as described in Jaini et al. (2019) applying following equation element-wise, :math:`y_n = c_n + \\int^{x_n}_0\\sum^K_{k=1}\\left(\\sum^R_{r=0}a^{(n)}_{r,k}u^r\\right)du` where... | 2.270287 | 2 |
astor_real_estate/astor_housing.py | deanchristakos/astor_real_estate | 0 | 6631431 | <gh_stars>0
import logging
logging.basicConfig(format='%(asctime)s %(funcName)s %(message)s', filename='/var/log/astor_square/astor_housing.log',level=logging.DEBUG)
from astor_schemas import *
import math
from astor_square_utils import *
class UnitTaxInfo(object):
def __init__(self, bbl=None, connection_pool=None... | import logging
logging.basicConfig(format='%(asctime)s %(funcName)s %(message)s', filename='/var/log/astor_square/astor_housing.log',level=logging.DEBUG)
from astor_schemas import *
import math
from astor_square_utils import *
class UnitTaxInfo(object):
def __init__(self, bbl=None, connection_pool=None):
s... | en | 0.606753 | #getzipcode(self.address, city, state) SELECT * FROM building_tax_analysis b LEFT JOIN bbl_locations l ON b.borough_block_lot = l.borough_block_lot WHERE b.borough_block_lot = %s AND fiscal_year IS NOT NULL ORDER BY fiscal... | 2.319651 | 2 |
dask_geomodeling/raster/misc.py | wietzesuijker/dask-geomodeling | 0 | 6631432 | <reponame>wietzesuijker/dask-geomodeling
"""
Module containing miscellaneous raster blocks.
"""
from osgeo import ogr
import numpy as np
import random
from geopandas import GeoSeries
from shapely.geometry import box
from shapely.errors import WKTReadingError
from shapely.wkt import loads as load_wkt
from dask import ... | """
Module containing miscellaneous raster blocks.
"""
from osgeo import ogr
import numpy as np
import random
from geopandas import GeoSeries
from shapely.geometry import box
from shapely.errors import WKTReadingError
from shapely.wkt import loads as load_wkt
from dask import config
from dask_geomodeling.geometry imp... | en | 0.742685 | Module containing miscellaneous raster blocks. Clip one raster to the extent of another raster. Takes two raster inputs, one raster ('store') whose values are returned in the output and one raster ('source') that is used as the extent. Cells of the 'store' raster are replaced with 'no data' if there is... | 2.584952 | 3 |
Model1.py | WalterJohnson0/DeepSpeech-KerasRebuild | 0 | 6631433 | # -*- coding: utf-8 -*-
"""
Created on Thu Feb 20 19:21:25 2020
@author: <NAME>
DeepSpeech model
"""
import keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, Bidirectional, LSTM, Softmax, TimeDistributed, Masking
from keras.utils import to_categorical
import tensorflow.compat.v1 ... | # -*- coding: utf-8 -*-
"""
Created on Thu Feb 20 19:21:25 2020
@author: <NAME>
DeepSpeech model
"""
import keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, Bidirectional, LSTM, Softmax, TimeDistributed, Masking
from keras.utils import to_categorical
import tensorflow.compat.v1 ... | en | 0.539468 | # -*- coding: utf-8 -*- Created on Thu Feb 20 19:21:25 2020 @author: <NAME> DeepSpeech model ############ # print(y_true) # print(y_pred) # network parameters # build model # predict the null label of ctc loss | 2.486022 | 2 |
compare.py | MarkEEaton/open-journal-matcher | 15 | 6631434 | """ run the comparisons using asyncio """
import asyncio
import asks
import regex
import settingsmay2021 as settings
import aiohttp
import langdetect
import os
import schedule
from time import sleep
from flask_bootstrap import Bootstrap
from collections import OrderedDict
from flask_wtf import FlaskForm
from wtforms i... | """ run the comparisons using asyncio """
import asyncio
import asks
import regex
import settingsmay2021 as settings
import aiohttp
import langdetect
import os
import schedule
from time import sleep
from flask_bootstrap import Bootstrap
from collections import OrderedDict
from flask_wtf import FlaskForm
from wtforms i... | en | 0.76576 | run the comparisons using asyncio for validation display index page # check to ensure not over rate limit # lay the groundwork # do the work # sort the results # calculate running time manage the async calls to GCP interact with google cloud function # print(type(e), e, str(count)) manage the async calls to the DOAJ ap... | 2.374335 | 2 |
ht3_solver_run_script.py | hjabird/XFEM_Boundary_Cooling_Solver | 0 | 6631435 | <filename>ht3_solver_run_script.py
# -*- coding: utf-8 -*-
"""
@author: <NAME>
@copyright Copyright 2017, <NAME>
@lisence: MIT
@status: alpha
"""
import ht3_solver as ht3s
import ElemMesh as em
import Elements as Elements
import numpy as np
import pickle
from ScriptTools import *
# Convenience...
... | <filename>ht3_solver_run_script.py
# -*- coding: utf-8 -*-
"""
@author: <NAME>
@copyright Copyright 2017, <NAME>
@lisence: MIT
@status: alpha
"""
import ht3_solver as ht3s
import ElemMesh as em
import Elements as Elements
import numpy as np
import pickle
from ScriptTools import *
# Convenience...
... | en | 0.629703 | # -*- coding: utf-8 -*- @author: <NAME>
@copyright Copyright 2017, <NAME>
@lisence: MIT
@status: alpha # Convenience... ## MESH INPUTS # WE CAN BUILD A MESH FROM SCRATCH: # 1x3 Mesh: # --------------- # | | | | # | | | | # --------------- #mesh.nodes[0] = np.array([0.0, 0.0, 0.0]) #mesh.nodes[1] = np... | 2.398488 | 2 |
web_scraper/__init__.py | vvaezian/Web-Scraper | 0 | 6631436 | <gh_stars>0
from .get_links_directly import get_links_directly
from .get_links_using_Google_search import get_links_using_Google_search
from .find_links_by_extension import find_links_by_extension
| from .get_links_directly import get_links_directly
from .get_links_using_Google_search import get_links_using_Google_search
from .find_links_by_extension import find_links_by_extension | none | 1 | 1.096196 | 1 | |
ipb_homework_checker/tools.py | PRBonn/ipb_homework_checker | 11 | 6631437 | <filename>ipb_homework_checker/tools.py
"""Handle various utility tasks."""
from os import path
from os import makedirs
from os import environ
import tempfile
import subprocess
import logging
import datetime
from .schema_tags import OutputTags
PKG_NAME = "ipb_homework_checker"
PROJECT_ROOT_FOLDER = path.abspath(path.... | <filename>ipb_homework_checker/tools.py
"""Handle various utility tasks."""
from os import path
from os import makedirs
from os import environ
import tempfile
import subprocess
import logging
import datetime
from .schema_tags import OutputTags
PKG_NAME = "ipb_homework_checker"
PROJECT_ROOT_FOLDER = path.abspath(path.... | en | 0.826131 | Handle various utility tasks. Create a temporary folder if needed and return it. Create a folder if it does not exist. Expand the path if it is not absolute. # This path needed user expansion. Now that the user home directory is # expanded this is a full absolute path. # The user could not be expanded, so we assume it ... | 3.070629 | 3 |
test/test_web.py | asnramos/asv | 0 | 6631438 | <filename>test/test_web.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import re
import shutil
import time
import urllib.parse
from os.path import join, abspath, dirname
import pytest
from asv import config, util
try:
from selenium.webdriver.support.ui import WebDriverWait
from ... | <filename>test/test_web.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import re
import shutil
import time
import urllib.parse
from os.path import join, abspath, dirname
import pytest
from asv import config, util
try:
from selenium.webdriver.support.ui import WebDriverWait
from ... | en | 0.894816 | # Licensed under a 3-clause BSD style license - see LICENSE.rst # Tell conda to not use hardlinks: on Windows it's not possible # to delete hard links to files in use, which causes problem when # trying to cleanup environments during this test (since the # same cache directory may get reused). # Swap CPU info and obtai... | 1.818514 | 2 |
alerts_deduplication.py | andtheWings/alerts | 0 | 6631439 | <filename>alerts_deduplication.py
import pandas as pd
import pandas_dedupe as dd
import sqlalchemy as sa
import os
os.chdir('/home/riggins/mrc_analyses/mrc_data')
engine = sa.create_engine("mysql+pymysql://root@127.0.0.1:3306/mrc_data")
people = pd.read_sql(
'''
SELECT * FROM people
WHERE... | <filename>alerts_deduplication.py
import pandas as pd
import pandas_dedupe as dd
import sqlalchemy as sa
import os
os.chdir('/home/riggins/mrc_analyses/mrc_data')
engine = sa.create_engine("mysql+pymysql://root@127.0.0.1:3306/mrc_data")
people = pd.read_sql(
'''
SELECT * FROM people
WHERE... | en | 0.706988 | SELECT * FROM people WHERE possible_dupe = 1 | 2.71698 | 3 |
setup.py | sergioabadarca/python-amazon-paapi | 0 | 6631440 | <reponame>sergioabadarca/python-amazon-paapi
import setuptools
with open('README.md', 'r') as fh:
long_description = fh.read()
setuptools.setup(
name='python-amazon-paapi',
version='3.3.4',
author='<NAME>',
author_email='<EMAIL>',
description='Amazon Product Advertising API 5.0 wrapper for Pyt... | import setuptools
with open('README.md', 'r') as fh:
long_description = fh.read()
setuptools.setup(
name='python-amazon-paapi',
version='3.3.4',
author='<NAME>',
author_email='<EMAIL>',
description='Amazon Product Advertising API 5.0 wrapper for Python',
long_description=long_description,
... | none | 1 | 1.449608 | 1 | |
bibliography_plugins/traditionalBibliography.py | MPvHarmelen/MarkdownCiteCompletions | 0 | 6631441 | <reponame>MPvHarmelen/MarkdownCiteCompletions
from ..external import latex_chars
from ..latextools_utils import bibcache
import codecs
import re
import sublime
import traceback
kp = re.compile(r'@[^\{]+\{\s*(.+)\s*,', re.UNICODE)
# new and improved regex
# we must have "title" then "=", possibly with spaces
# then ei... | from ..external import latex_chars
from ..latextools_utils import bibcache
import codecs
import re
import sublime
import traceback
kp = re.compile(r'@[^\{]+\{\s*(.+)\s*,', re.UNICODE)
# new and improved regex
# we must have "title" then "=", possibly with spaces
# then either {, maybe repeated twice, or "
# then spac... | en | 0.767156 | # new and improved regex # we must have "title" then "=", possibly with spaces # then either {, maybe repeated twice, or " # then spaces and finally the title # # We capture till the end of the line as maybe entry is broken over several lines # # and in the end we MAY but need not have }'s and "s # tp = re.compile(r'\b... | 2.584172 | 3 |
python/cuml/test/test_kmeans.py | kkraus14/cuml | 2 | 6631442 | <gh_stars>1-10
# Copyright (c) 2018, NVIDIA 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 l... | # Copyright (c) 2018, NVIDIA 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... | en | 0.900382 | # Copyright (c) 2018, NVIDIA 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... | 2.0768 | 2 |
ddi_search_engine/Bio/expressions/swissprot/sprot40.py | dbmi-pitt/DIKB-Evidence-analytics | 3 | 6631443 | <gh_stars>1-10
import warnings
warnings.warn("Bio.expressions was deprecated, as it does not work with recent versions of mxTextTools. If you want to continue to use this module, please get in contact with the Biopython developers at <EMAIL> to avoid permanent removal of this module from Biopython", DeprecationWarning)... | import warnings
warnings.warn("Bio.expressions was deprecated, as it does not work with recent versions of mxTextTools. If you want to continue to use this module, please get in contact with the Biopython developers at <EMAIL> to avoid permanent removal of this module from Biopython", DeprecationWarning)
import Marte... | en | 0.641903 | # HAS2_CHICK has a DT line like this # DT 30-MAY-2000 (REL. 39, Created) # ^^^ Note the upper-case "REL" instead of "Rel" ! # 0 or 1 # in 40 the line changed to look like this # RX MEDLINE=93305731; PubMed=7916637; # RX PubMed=11001938; # Here's the neq SQ line format -- uses a CRC64 # SQ SE... | 2.080144 | 2 |
main.py | studewan/01-Interactive-Fiction | 0 | 6631444 | {
"uuid": "A095F919-661C-4B7F-9467-4368B345AFD9",
"name": "The Mystery",
"creator": "Twine",
"creatorVersion": "2.3.14",
"schemaName": "Harlowe 3 to JSON",
"schemaVersion": "0.0.6",
"createdAtMs": 1631371628710,
"passages": [
{
"name": "Starting ",
"tags": "",
"id": "1",
"tex... | {
"uuid": "A095F919-661C-4B7F-9467-4368B345AFD9",
"name": "The Mystery",
"creator": "Twine",
"creatorVersion": "2.3.14",
"schemaName": "Harlowe 3 to JSON",
"schemaVersion": "0.0.6",
"createdAtMs": 1631371628710,
"passages": [
{
"name": "Starting ",
"tags": "",
"id": "1",
"tex... | none | 1 | 1.803473 | 2 | |
nnunet/dataset_conversion/Task_253_make_splits_pickle.py | hasukmin12/nnUNet_MDD_UNet_with_Semi_Supervised | 3 | 6631445 | <filename>nnunet/dataset_conversion/Task_253_make_splits_pickle.py<gh_stars>1-10
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance w... | <filename>nnunet/dataset_conversion/Task_253_make_splits_pickle.py<gh_stars>1-10
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance w... | en | 0.716194 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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://w... | 2.260432 | 2 |
source/beamer/Display.py | mkroehn/gesina | 0 | 6631446 | import numpy as np
import cv2
class Display:
# internal
view_reduction = 0
border_thickness = 5
border_color = (200, 0, 0)
padding = 5
fullscreen = False
def __init__(self, conf):
self.vid_h = conf.vid_h
self.vid_w = conf.vid_w
self.img_h = conf.img_h
self.i... | import numpy as np
import cv2
class Display:
# internal
view_reduction = 0
border_thickness = 5
border_color = (200, 0, 0)
padding = 5
fullscreen = False
def __init__(self, conf):
self.vid_h = conf.vid_h
self.vid_w = conf.vid_w
self.img_h = conf.img_h
self.i... | en | 0.501499 | # internal | 2.631163 | 3 |
detection/core/anchor/anchor_generator.py | pskurochkin/tf-eager-fasterrcnn | 106 | 6631447 | <reponame>pskurochkin/tf-eager-fasterrcnn
import tensorflow as tf
from detection.utils.misc import *
class AnchorGenerator(object):
def __init__(self,
scales=(32, 64, 128, 256, 512),
ratios=(0.5, 1, 2),
feature_strides=(4, 8, 16, 32, 64)):
'''Anchor Ge... | import tensorflow as tf
from detection.utils.misc import *
class AnchorGenerator(object):
def __init__(self,
scales=(32, 64, 128, 256, 512),
ratios=(0.5, 1, 2),
feature_strides=(4, 8, 16, 32, 64)):
'''Anchor Generator
Attributes
... | en | 0.728956 | Anchor Generator Attributes --- scales: 1D array of anchor sizes in pixels. ratios: 1D array of anchor ratios of width/height. feature_strides: Stride of the feature map relative to the image in pixels. Generate the multi-level anchors for Region Proposal Net... | 2.286622 | 2 |
server/auvsi_suas/views/teams_test.py | RMMichael/interop | 175 | 6631448 | """Tests for the teams module."""
import dateutil.parser
import functools
import json
from auvsi_suas.models.aerial_position import AerialPosition
from auvsi_suas.models.gps_position import GpsPosition
from auvsi_suas.models.mission_config import MissionConfig
from auvsi_suas.models.takeoff_or_landing_event import Tak... | """Tests for the teams module."""
import dateutil.parser
import functools
import json
from auvsi_suas.models.aerial_position import AerialPosition
from auvsi_suas.models.gps_position import GpsPosition
from auvsi_suas.models.mission_config import MissionConfig
from auvsi_suas.models.takeoff_or_landing_event import Tak... | en | 0.89597 | Tests for the teams module. Tests requests that have not yet been authenticated. Tests the teams view. Create a basic sample dataset. # Mission # user1 is flying # user2 has landed # user2 is active Normal users allowed access. No users results in empty list, no superusers. POST not allowed Response JSON is properly fo... | 2.318065 | 2 |
exercises/migrations/0005_auto_20200512_0840.py | rattletat/homework-server | 1 | 6631449 | # Generated by Django 3.0.5 on 2020-05-12 06:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('exercises', '0004_auto_20200512_0501'),
]
operations = [
migrations.AlterField(
model_name='testresult',
name='first... | # Generated by Django 3.0.5 on 2020-05-12 06:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('exercises', '0004_auto_20200512_0501'),
]
operations = [
migrations.AlterField(
model_name='testresult',
name='first... | en | 0.782814 | # Generated by Django 3.0.5 on 2020-05-12 06:40 | 1.472727 | 1 |
uploader/uploader.py | KfirBernstein/technion-iem-ds_lab | 0 | 6631450 | <reponame>KfirBernstein/technion-iem-ds_lab
"""
Upload homework TAR.GZ file from zip file created by Moodle to the Automatic Checker
Student's homework submissions can be downloaded from Moodle in one zip file.
We assume here that ALL the submissions are in a TAR.gz format (one file for each submission)
This script w... | """
Upload homework TAR.GZ file from zip file created by Moodle to the Automatic Checker
Student's homework submissions can be downloaded from Moodle in one zip file.
We assume here that ALL the submissions are in a TAR.gz format (one file for each submission)
This script will open the ZIP file, and upload all the fi... | en | 0.893058 | Upload homework TAR.GZ file from zip file created by Moodle to the Automatic Checker Student's homework submissions can be downloaded from Moodle in one zip file. We assume here that ALL the submissions are in a TAR.gz format (one file for each submission) This script will open the ZIP file, and upload all the files ... | 3.525169 | 4 |