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 |
|---|---|---|---|---|---|---|---|---|---|---|
Beheer/tests.py | RamonvdW/nhb-apps | 1 | 7400 | # -*- coding: utf-8 -*-
# Copyright (c) 2020-2021 <NAME>.
# All rights reserved.
# Licensed under BSD-3-Clause-Clear. See LICENSE file for details.
from django.conf import settings
from django.test import TestCase
from django.urls import reverse
from TestHelpers.e2ehelpers import E2EHelpers
# updaten met dit com... | # -*- coding: utf-8 -*-
# Copyright (c) 2020-2021 <NAME>.
# All rights reserved.
# Licensed under BSD-3-Clause-Clear. See LICENSE file for details.
from django.conf import settings
from django.test import TestCase
from django.urls import reverse
from TestHelpers.e2ehelpers import E2EHelpers
# updaten met dit com... | nl | 0.717875 | # -*- coding: utf-8 -*- # Copyright (c) 2020-2021 <NAME>. # All rights reserved. # Licensed under BSD-3-Clause-Clear. See LICENSE file for details. # updaten met dit commando: # for x in `./manage.py show_urls --settings=nhbapps.settings_dev | rev | cut -d'/' -f2- | rev | grep '/beheer/'`; do echo "'$x/',"; done | ... | 1.634699 | 2 |
L1Trigger/TrackFindingTracklet/python/ProducerKF_cff.py | Jingyan95/cmssw | 5 | 7401 | import FWCore.ParameterSet.Config as cms
from L1Trigger.TrackTrigger.ProducerSetup_cff import TrackTriggerSetup
from L1Trigger.TrackerTFP.Producer_cfi import TrackerTFPProducer_params
from L1Trigger.TrackerTFP.ProducerES_cff import TrackTriggerDataFormats
from L1Trigger.TrackerTFP.ProducerLayerEncoding_cff import Trac... | import FWCore.ParameterSet.Config as cms
from L1Trigger.TrackTrigger.ProducerSetup_cff import TrackTriggerSetup
from L1Trigger.TrackerTFP.Producer_cfi import TrackerTFPProducer_params
from L1Trigger.TrackerTFP.ProducerES_cff import TrackTriggerDataFormats
from L1Trigger.TrackerTFP.ProducerLayerEncoding_cff import Trac... | none | 1 | 1.271053 | 1 | |
py_cui/__init__.py | ne-msft/py_cui | 0 | 7402 | """A python library for intuitively creating CUI/TUI interfaces with pre-built widgets.
"""
#
# Author: <NAME>
# Created: 12-Aug-2019
# Docs: https://jwlodek.github.io/py_cui-docs
# License: BSD-3-Clause (New/Revised)
#
# Some python core library imports
import sys
import os
import time
import copy
import shu... | """A python library for intuitively creating CUI/TUI interfaces with pre-built widgets.
"""
#
# Author: <NAME>
# Created: 12-Aug-2019
# Docs: https://jwlodek.github.io/py_cui-docs
# License: BSD-3-Clause (New/Revised)
#
# Some python core library imports
import sys
import os
import time
import copy
import shu... | en | 0.641862 | A python library for intuitively creating CUI/TUI interfaces with pre-built widgets. # # Author: <NAME> # Created: 12-Aug-2019 # Docs: https://jwlodek.github.io/py_cui-docs # License: BSD-3-Clause (New/Revised) # # Some python core library imports # We use shutil for getting the terminal dimensions # Threading ... | 2.478815 | 2 |
isi_sdk_8_0/isi_sdk_8_0/models/auth_access_access_item_file.py | mohitjain97/isilon_sdk_python | 24 | 7403 | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 3
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class AuthAccessAccessItemFile(object):... | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 3
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class AuthAccessAccessItemFile(object):... | en | 0.658575 | # coding: utf-8 Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 3 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen.git # noqa: F401 NOTE: This class is auto generated by the swagger code generator program. Do not edit th... | 1.740562 | 2 |
dataconnector.py | iamthinkking/COMP4217_FinalProject | 0 | 7404 | <reponame>iamthinkking/COMP4217_FinalProject<gh_stars>0
#!/usr/bin/python3
import pymysql
class Connection:
SQL_HOST = 'localhost'
SQL_USR = ''
SQL_PWD = ''
SQL_DB = 'HOSPITAL'
# initialize database object
def __init__(self, usr, pwd):
self.USR = usr
self.PWD = <P... | #!/usr/bin/python3
import pymysql
class Connection:
SQL_HOST = 'localhost'
SQL_USR = ''
SQL_PWD = ''
SQL_DB = 'HOSPITAL'
# initialize database object
def __init__(self, usr, pwd):
self.USR = usr
self.PWD = <PASSWORD>
# return an database connection
def... | en | 0.601329 | #!/usr/bin/python3 # initialize database object # return an database connection # Open database connection # make sure the database connection gets closed # prepare a cursor object using cursor() method # execute SQL query using execute() method. # Fetch all the tuples in a list of lists. # prepare a cursor object usin... | 3.231074 | 3 |
flow/visualize/plot_custom_callables.py | AHammoudeh/Flow_AH | 0 | 7405 | <reponame>AHammoudeh/Flow_AH
"""Generate charts from with .npy files containing custom callables through replay."""
import argparse
from datetime import datetime
import errno
import numpy as np
import matplotlib.pyplot as plt
import os
import pytz
import sys
def make_bar_plot(vals, title):
print(len(vals))
fi... | """Generate charts from with .npy files containing custom callables through replay."""
import argparse
from datetime import datetime
import errno
import numpy as np
import matplotlib.pyplot as plt
import os
import pytz
import sys
def make_bar_plot(vals, title):
print(len(vals))
fig = plt.figure()
plt.hist... | en | 0.483398 | Generate charts from with .npy files containing custom callables through replay. Parse training options user can specify in command line. Returns ------- argparse.Namespace the output parser object | 2.777647 | 3 |
deployer/src/config_manager.py | yugabyte/docsearch-scraper | 0 | 7406 | <filename>deployer/src/config_manager.py
import algoliasearch
from os import environ
from . import algolia_helper
from . import snippeter
from . import emails
from . import helpers
from . import fetchers
from .helpdesk_helper import add_note, get_conversation, \
get_emails_from_conversation, get_conversation_url_... | <filename>deployer/src/config_manager.py
import algoliasearch
from os import environ
from . import algolia_helper
from . import snippeter
from . import emails
from . import helpers
from . import fetchers
from .helpdesk_helper import add_note, get_conversation, \
get_emails_from_conversation, get_conversation_url_... | en | 0.681699 | # Add email(s) to the private config & grant access | 1.967979 | 2 |
Source/budgie/__init__.py | pylover/budgie | 3 | 7407 |
import sys
from sqlalchemy.exc import DatabaseError
from . import cli
from .configuration import settings, init as init_config
from .observer import HelpdeskObserver, MaximumClientsReached
from .models import init as init_models, metadata, engine, check_db
from .smtp import SMTPConfigurationError
__version__ = '0.... |
import sys
from sqlalchemy.exc import DatabaseError
from . import cli
from .configuration import settings, init as init_config
from .observer import HelpdeskObserver, MaximumClientsReached
from .models import init as init_models, metadata, engine, check_db
from .smtp import SMTPConfigurationError
__version__ = '0.... | pt | 0.233784 | # Checking database | 2.183913 | 2 |
locations/spiders/shopnsave.py | thismakessand/alltheplaces | 1 | 7408 | <reponame>thismakessand/alltheplaces<filename>locations/spiders/shopnsave.py
# -*- coding: utf-8 -*-
import scrapy
import re
from locations.items import GeojsonPointItem
DAY_DICT = {
'Mon': 'Mo',
'Tue': 'Tu',
'Wed': 'We',
'Thu': 'Th',
'Fri': 'Fr',
'Sat': 'Sa',
'Sun': 'Su',
'Monday': 'M... | # -*- coding: utf-8 -*-
import scrapy
import re
from locations.items import GeojsonPointItem
DAY_DICT = {
'Mon': 'Mo',
'Tue': 'Tu',
'Wed': 'We',
'Thu': 'Th',
'Fri': 'Fr',
'Sat': 'Sa',
'Sun': 'Su',
'Monday': 'Mo',
'Tuesday': 'Tu',
'Wednesday': 'We',
'Thursday': 'Th',
'Th... | en | 0.769321 | # -*- coding: utf-8 -*- | 2.652677 | 3 |
run.py | TovarischSuhov/QR_quest | 0 | 7409 | #!/usr/bin/env python
from app import app
app.run(debug = True)
| #!/usr/bin/env python
from app import app
app.run(debug = True)
| ru | 0.26433 | #!/usr/bin/env python | 1.112753 | 1 |
tests/twitter_learning_journal/dao/test_os_env.py | DEV3L/twitter-learning-journal | 1 | 7410 | <reponame>DEV3L/twitter-learning-journal<filename>tests/twitter_learning_journal/dao/test_os_env.py<gh_stars>1-10
from unittest.mock import patch
from app.twitter_learning_journal.dao.os_env import os_environ
@patch('app.twitter_learning_journal.dao.os_env.os')
def test_os_environ(mock_os):
expected_value = 'env... | from unittest.mock import patch
from app.twitter_learning_journal.dao.os_env import os_environ
@patch('app.twitter_learning_journal.dao.os_env.os')
def test_os_environ(mock_os):
expected_value = 'environment_value'
mock_os.environ.__contains__.return_value = True # patch in statement
mock_os.environ.__... | en | 0.912117 | # patch in statement | 2.722477 | 3 |
web-scraper/mongoscraper/populate.py | naveenr414/hack-umbc | 0 | 7411 | <filename>web-scraper/mongoscraper/populate.py
import pymongo
myclient = pymongo.MongoClient()
mydb = myclient["mydb"]
hor = mydb["HoR"]
sen = mydb["Senator"]
gov = mydb["Governor"]
def write(fileJSON):
myDoc = fileJSON
if( "hor" in myDoc.values()):
hor.insert_one(myDoc)
elif( "senate" in myDoc.va... | <filename>web-scraper/mongoscraper/populate.py
import pymongo
myclient = pymongo.MongoClient()
mydb = myclient["mydb"]
hor = mydb["HoR"]
sen = mydb["Senator"]
gov = mydb["Governor"]
def write(fileJSON):
myDoc = fileJSON
if( "hor" in myDoc.values()):
hor.insert_one(myDoc)
elif( "senate" in myDoc.va... | none | 1 | 2.980343 | 3 | |
tests/test_utils_obj_value.py | ZSD-tim/dayu_widgets | 157 | 7412 | <reponame>ZSD-tim/dayu_widgets
"""
Test get_obj_value set_obj_value has_obj_value
"""
import pytest
from dayu_widgets import utils
class _HasNameAgeObject(object):
def __init__(self, name, age):
super(_HasNameAgeObject, self).__init__()
self.name = name
self.age = age
@pytest.mark.parame... | """
Test get_obj_value set_obj_value has_obj_value
"""
import pytest
from dayu_widgets import utils
class _HasNameAgeObject(object):
def __init__(self, name, age):
super(_HasNameAgeObject, self).__init__()
self.name = name
self.age = age
@pytest.mark.parametrize('obj', (
{'name': 'xi... | en | 0.419129 | Test get_obj_value set_obj_value has_obj_value Test get_obj_value has_obj_value set_obj_value collection. Test get_obj_value with dict/object as arg. Test has_obj_value with dict/object as arg. Test set_obj_value with dict/object as arg. | 2.852573 | 3 |
desktop/core/ext-py/PyYAML-3.12/tests/lib3/test_all.py | kokosing/hue | 5,079 | 7413 |
import sys, yaml, test_appliance
def main(args=None):
collections = []
import test_yaml
collections.append(test_yaml)
if yaml.__with_libyaml__:
import test_yaml_ext
collections.append(test_yaml_ext)
return test_appliance.run(collections, args)
if __name__ == '__main__':
main()... |
import sys, yaml, test_appliance
def main(args=None):
collections = []
import test_yaml
collections.append(test_yaml)
if yaml.__with_libyaml__:
import test_yaml_ext
collections.append(test_yaml_ext)
return test_appliance.run(collections, args)
if __name__ == '__main__':
main()... | none | 1 | 1.912644 | 2 | |
tim_camera/oop_detection_webcam.py | Tim-orius/aidem | 0 | 7414 | <reponame>Tim-orius/aidem
""" Webcam Detection with Tensorflow calssifier and object distance calculation """
__version__ = "0.1.0"
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__credits__ = "Special thanks to The Anh Vuong who came up with the original idea." \
"This code is also based off of the code fr... | """ Webcam Detection with Tensorflow calssifier and object distance calculation """
__version__ = "0.1.0"
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__credits__ = "Special thanks to The Anh Vuong who came up with the original idea." \
"This code is also based off of the code from Evan Juras (see below)"... | en | 0.749012 | Webcam Detection with Tensorflow calssifier and object distance calculation # This script is based off of a script by <NAME> (see below). # I rewrote this script to be object oriented and added the tkinter-ui (removed command # line functionalities) as well as several functionalities to calculate the distance # between... | 2.767316 | 3 |
modules/zabbix_smart.py | yakumo-saki/smart_to_zabbix | 0 | 7415 | <filename>modules/zabbix_smart.py
import json
import logging
import config as cfg
from modules.const import Keys, AttrKey
from modules.zabbix_sender import send_to_zabbix
logger = logging.getLogger(__name__)
SMART_ATTR_KEY = "ata_smart_attributes"
NVME_ATTR_KEY = "nvme_smart_health_information_log"
def send_attrib... | <filename>modules/zabbix_smart.py
import json
import logging
import config as cfg
from modules.const import Keys, AttrKey
from modules.zabbix_sender import send_to_zabbix
logger = logging.getLogger(__name__)
SMART_ATTR_KEY = "ata_smart_attributes"
NVME_ATTR_KEY = "nvme_smart_health_information_log"
def send_attrib... | ja | 0.942692 | zabbixにS.M.A.R.T Attribute LLDデータを送信します。 Attribute LLDとは要するにSMART値すべて # non NVMeの場合、 Unknown Attributeがあり得るので、SMART ID を名前の先頭につけておく # temperature_sensorsの名前の通り、複数の温度センサーがあると値が複数入るので # temperature_sensors1,2 のような名前に展開する # /dev/sda #valueStr = json.dumps({"data": discovery_result}) # print(json.dumps(sender_data, inden... | 2.237193 | 2 |
data.py | kpister/biaxial-rnn-music-composition | 0 | 7416 | import itertools
from midi_to_statematrix import UPPER_BOUND, LOWER_BOUND
def startSentinel():
def noteSentinel(note):
position = note
part_position = [position]
pitchclass = (note + LOWER_BOUND) % 12
part_pitchclass = [int(i == pitchclass) for i in range(12)]
return part... | import itertools
from midi_to_statematrix import UPPER_BOUND, LOWER_BOUND
def startSentinel():
def noteSentinel(note):
position = note
part_position = [position]
pitchclass = (note + LOWER_BOUND) % 12
part_pitchclass = [int(i == pitchclass) for i in range(12)]
return part... | en | 0.879382 | # Concatenate the note states for the previous vicinity # NOTE: May have to transpose this or transform it in some way to make Theano like it # [startSentinel()] + | 2.608891 | 3 |
ocdb/ws/controllers/datasets.py | eocdb/ocdb-server | 0 | 7417 | # The MIT License (MIT)
# Copyright (c) 2018 by EUMETSAT
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify,... | # The MIT License (MIT)
# Copyright (c) 2018 by EUMETSAT
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify,... | en | 0.672034 | # The MIT License (MIT) # Copyright (c) 2018 by EUMETSAT # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without limitation the rights to # use, copy, modify,... | 1.402753 | 1 |
libAnt/node.py | ayanezcasal/AntLibAYC | 19 | 7418 | import threading
from queue import Queue, Empty
from time import sleep
from libAnt.drivers.driver import Driver
from libAnt.message import *
class Network:
def __init__(self, key: bytes = b'\x00' * 8, name: str = None):
self.key = key
self.name = name
self.number = 0
def __str__(self... | import threading
from queue import Queue, Empty
from time import sleep
from libAnt.drivers.driver import Driver
from libAnt.message import *
class Network:
def __init__(self, key: bytes = b'\x00' * 8, name: str = None):
self.key = key
self.name = name
self.number = 0
def __str__(self... | en | 0.736767 | # Startup # Write # Read # This is a response to our outgoing message # ACK # TODO: Call waiter callback from tuple (waiter, callback) | 2.60336 | 3 |
tests/test_seasonality.py | OliPerkins1987/Wildfire_Human_Agency_Model | 1 | 7419 | # -*- coding: utf-8 -*-
"""
Created on Thu Sep 30 12:17:04 2021
@author: Oli
"""
import pytest
import pandas as pd
import numpy as np
import netCDF4 as nc
import os
from copy import deepcopy
os.chdir(os.path.dirname(os.path.realpath(__file__)))
wd = os.getcwd().replace('\\', '/')
exec(open("test_set... | # -*- coding: utf-8 -*-
"""
Created on Thu Sep 30 12:17:04 2021
@author: Oli
"""
import pytest
import pandas as pd
import numpy as np
import netCDF4 as nc
import os
from copy import deepcopy
os.chdir(os.path.dirname(os.path.realpath(__file__)))
wd = os.getcwd().replace('\\', '/')
exec(open("test_set... | de | 0.711066 | # -*- coding: utf-8 -*- Created on Thu Sep 30 12:17:04 2021
@author: Oli ##################################################################### ### Run model year then reproduce outputs ##################################################################### ### Run model for 1 year ### setup ### go ####################... | 1.591988 | 2 |
bookalo/funciones_report.py | unizar-30226-2019-08/Backend | 3 | 7420 | <gh_stars>1-10
from django.shortcuts import render, redirect
from bookalo.pyrebase_settings import db, auth
from bookalo.models import *
from bookalo.serializers import *
#from bookalo.functions import *
from rest_framework import status, permissions
from rest_framework.decorators import api_view, permission_clas... | from django.shortcuts import render, redirect
from bookalo.pyrebase_settings import db, auth
from bookalo.models import *
from bookalo.serializers import *
#from bookalo.functions import *
from rest_framework import status, permissions
from rest_framework.decorators import api_view, permission_classes
from rest_... | en | 0.160162 | #from bookalo.functions import * | 1.967354 | 2 |
tests/test_client.py | patvdleer/nefit-client-python | 11 | 7421 | <filename>tests/test_client.py
import os
import unittest
from nefit import NefitClient, NefitResponseException
class ClientTest(unittest.TestCase):
def test_exceptions(self):
client = NefitClient(
os.environ.get("NEFIT_SERIAL", 123456789),
os.environ.get("NEFIT_ACCESS_KEY", "<KEY>"... | <filename>tests/test_client.py
import os
import unittest
from nefit import NefitClient, NefitResponseException
class ClientTest(unittest.TestCase):
def test_exceptions(self):
client = NefitClient(
os.environ.get("NEFIT_SERIAL", 123456789),
os.environ.get("NEFIT_ACCESS_KEY", "<KEY>"... | none | 1 | 2.750546 | 3 | |
opencivicdata/merge.py | GovHawkDC/python-opencivicdata | 0 | 7422 | import datetime
from django.db import transaction
def compute_diff(obj1, obj2):
"""
Given two objects compute a list of differences.
Each diff dict has the following keys:
field - name of the field
new - the new value for the field
one - value of the field in o... | import datetime
from django.db import transaction
def compute_diff(obj1, obj2):
"""
Given two objects compute a list of differences.
Each diff dict has the following keys:
field - name of the field
new - the new value for the field
one - value of the field in o... | en | 0.94117 | Given two objects compute a list of differences. Each diff dict has the following keys: field - name of the field new - the new value for the field one - value of the field in obj1 two - value of the field in obj2 diff - none|one|two|new l... | 2.842014 | 3 |
src/python/pants/core/project_info/filedeps.py | silverguo/pants | 0 | 7423 | <reponame>silverguo/pants<filename>src/python/pants/core/project_info/filedeps.py
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import itertools
from pathlib import PurePath
from typing import Iterable
from pants.base.build_root impo... | # Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import itertools
from pathlib import PurePath
from typing import Iterable
from pants.base.build_root import BuildRoot
from pants.engine.addresses import Address, Addresses, BuildFileAddre... | en | 0.604549 | # Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). List all source and BUILD files a target depends on. | 2.039389 | 2 |
perfkitbenchmarker/providers/rackspace/rackspace_network.py | dq922/CloudControlVM | 0 | 7424 | <reponame>dq922/CloudControlVM
# Copyright 2014 PerfKitBenchmarker 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... | # Copyright 2014 PerfKitBenchmarker 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 appli... | en | 0.807899 | # Copyright 2014 PerfKitBenchmarker 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 appli... | 2.192738 | 2 |
auth0_client/menu/datafiles/scripts/get_active_user_count.py | rubelw/auth0_client | 2 | 7425 | #!/usr/bin/env python
import json
from auth0_client.Auth0Client import Auth0Client
from auth0_client.menu.menu_helper.common import *
from auth0_client.menu.menu_helper.pretty import *
try:
users = {}
client = Auth0Client(auth_config())
results = client.active_users()
print(pretty(results))
except... | #!/usr/bin/env python
import json
from auth0_client.Auth0Client import Auth0Client
from auth0_client.menu.menu_helper.common import *
from auth0_client.menu.menu_helper.pretty import *
try:
users = {}
client = Auth0Client(auth_config())
results = client.active_users()
print(pretty(results))
except... | ru | 0.26433 | #!/usr/bin/env python | 1.939291 | 2 |
encryptfinance/transactions/admin.py | dark-codr/encryptfinance | 0 | 7426 | from __future__ import absolute_import
from django.contrib import admin
from .models import Deposit, Withdrawal, Support
from .forms import DepositForm, WithdrawalForm
# Register your models here.
@admin.register(Deposit)
class DepositAdmin(admin.ModelAdmin):
# form = DepositForm
list_display = ["__str__", "... | from __future__ import absolute_import
from django.contrib import admin
from .models import Deposit, Withdrawal, Support
from .forms import DepositForm, WithdrawalForm
# Register your models here.
@admin.register(Deposit)
class DepositAdmin(admin.ModelAdmin):
# form = DepositForm
list_display = ["__str__", "... | en | 0.9289 | # Register your models here. # form = DepositForm | 1.906369 | 2 |
vendor-local/src/django-piston/tests/test_project/settings.py | jlin/inventory | 22 | 7427 | import os
DEBUG = True
DATABASES = {
'default':
{
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '/tmp/piston.db'
}
}
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = '/tmp/piston.db'
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessi... | import os
DEBUG = True
DATABASES = {
'default':
{
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '/tmp/piston.db'
}
}
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = '/tmp/piston.db'
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessi... | none | 1 | 1.645625 | 2 | |
src/sage/combinat/combinatorial_map.py | UCD4IDS/sage | 0 | 7428 | <gh_stars>0
"""
Combinatorial maps
This module provides a decorator that can be used to add semantic to a
Python method by marking it as implementing a *combinatorial map*,
that is a map between two :class:`enumerated sets <EnumeratedSets>`::
sage: from sage.combinat.combinatorial_map import combinatorial_map
... | """
Combinatorial maps
This module provides a decorator that can be used to add semantic to a
Python method by marking it as implementing a *combinatorial map*,
that is a map between two :class:`enumerated sets <EnumeratedSets>`::
sage: from sage.combinat.combinatorial_map import combinatorial_map
sage: class... | en | 0.516141 | Combinatorial maps This module provides a decorator that can be used to add semantic to a Python method by marking it as implementing a *combinatorial map*, that is a map between two :class:`enumerated sets <EnumeratedSets>`:: sage: from sage.combinat.combinatorial_map import combinatorial_map sage: class MyP... | 3.468513 | 3 |
tests/cppproj/xdressrc.py | xdress/xdress | 88 | 7429 | <reponame>xdress/xdress<filename>tests/cppproj/xdressrc.py
import os
from xdress.utils import apiname
package = 'cppproj'
packagedir = 'cppproj'
includes = ['src']
plugins = ('xdress.autoall', 'xdress.pep8names', 'xdress.cythongen',
'xdress.stlwrap', )
extra_types = 'cppproj_extra_types' # non-default v... | import os
from xdress.utils import apiname
package = 'cppproj'
packagedir = 'cppproj'
includes = ['src']
plugins = ('xdress.autoall', 'xdress.pep8names', 'xdress.cythongen',
'xdress.stlwrap', )
extra_types = 'cppproj_extra_types' # non-default value
dtypes = [
('map', 'str', 'int'),
('set', 'in... | en | 0.458194 | # non-default value # trick to get around cython generating *.h #apiname('struct0', 'basics', 'pybasics', 'My_Struct_0'), FIXME This needs more work # apiname('SomeCrazyPairValue', **_inbasics), | 1.615094 | 2 |
routines/server.py | henryshunt/c-aws | 0 | 7430 | <gh_stars>0
import os
import subprocess
import routines.config as config
import routines.helpers as helpers
def get_static_info():
""" Outputs data concerning the computer in the C-AWS station
"""
startup_time = None
data_drive_space = None
camera_drive_space = None
# Get sys... | import os
import subprocess
import routines.config as config
import routines.helpers as helpers
def get_static_info():
""" Outputs data concerning the computer in the C-AWS station
"""
startup_time = None
data_drive_space = None
camera_drive_space = None
# Get system startup ... | en | 0.835937 | Outputs data concerning the computer in the C-AWS station # Get system startup time # Get data and camera drive space | 2.554212 | 3 |
DQM/DTMonitorModule/python/dtChamberEfficiencyHI_cfi.py | pasmuss/cmssw | 0 | 7431 | <gh_stars>0
import FWCore.ParameterSet.Config as cms
from RecoMuon.TrackingTools.MuonServiceProxy_cff import MuonServiceProxy
dtEfficiencyMonitor = cms.EDAnalyzer("DTChamberEfficiency",
MuonServiceProxy,
debug = cms.untracked.bool(True),
TrackCollection = cms.InputTag("standAloneMuons"),
theMaxC... | import FWCore.ParameterSet.Config as cms
from RecoMuon.TrackingTools.MuonServiceProxy_cff import MuonServiceProxy
dtEfficiencyMonitor = cms.EDAnalyzer("DTChamberEfficiency",
MuonServiceProxy,
debug = cms.untracked.bool(True),
TrackCollection = cms.InputTag("standAloneMuons"),
theMaxChi2 = cms.do... | none | 1 | 1.244699 | 1 | |
gym_reinmav/envs/mujoco/__init__.py | peterminh227/reinmav-gym | 60 | 7432 | from gym_reinmav.envs.mujoco.mujoco_quad import MujocoQuadEnv
from gym_reinmav.envs.mujoco.mujoco_quad_hovering import MujocoQuadHoveringEnv
from gym_reinmav.envs.mujoco.mujoco_quad_quat import MujocoQuadQuaternionEnv | from gym_reinmav.envs.mujoco.mujoco_quad import MujocoQuadEnv
from gym_reinmav.envs.mujoco.mujoco_quad_hovering import MujocoQuadHoveringEnv
from gym_reinmav.envs.mujoco.mujoco_quad_quat import MujocoQuadQuaternionEnv | none | 1 | 1.143716 | 1 | |
test.py | jasonivey/scripts | 0 | 7433 | <reponame>jasonivey/scripts
#!/usr/bin/env python3
# vim:softtabstop=4:ts=4:sw=4:expandtab:tw=120
from ansimarkup import AnsiMarkup, parse
import csv
import datetime
import operator
import os
from pathlib import Path
import re
import sys
import traceback
_VERBOSE = False
user_tags = {
'error' : par... | #!/usr/bin/env python3
# vim:softtabstop=4:ts=4:sw=4:expandtab:tw=120
from ansimarkup import AnsiMarkup, parse
import csv
import datetime
import operator
import os
from pathlib import Path
import re
import sys
import traceback
_VERBOSE = False
user_tags = {
'error' : parse('<bold><red>'),
'nam... | ru | 0.137217 | #!/usr/bin/env python3 # vim:softtabstop=4:ts=4:sw=4:expandtab:tw=120 # Example '11/08/2011 03:00 PM' | 2.418618 | 2 |
RDyn-master/rdyn/test/rdyn_test.py | nogrady/dynamo | 12 | 7434 | import unittest
import shutil
from rdyn.alg.RDyn_v2 import RDynV2
class RDynTestCase(unittest.TestCase):
def test_rdyn_simplified(self):
print("1")
rdb = RDynV2(size=500, iterations=100)
rdb.execute(simplified=True)
print("2")
rdb = RDynV2(size=500, iterations=100, max_ev... | import unittest
import shutil
from rdyn.alg.RDyn_v2 import RDynV2
class RDynTestCase(unittest.TestCase):
def test_rdyn_simplified(self):
print("1")
rdb = RDynV2(size=500, iterations=100)
rdb.execute(simplified=True)
print("2")
rdb = RDynV2(size=500, iterations=100, max_ev... | none | 1 | 2.500959 | 3 | |
recognition/datasets/build.py | Jung-Jun-Uk/UNPG | 7 | 7435 | <reponame>Jung-Jun-Uk/UNPG
import os
from .kface import KFace
from .ms1m import MS1M
from .bin_datasets import BIN
from .ijb import IJB
def build_datasets(data_cfg, batch_size, cuda, workers, mode, rank=-1):
assert mode in ['train', 'test']
cfg = data_cfg[mode]
if cfg['dataset'] == 'kface': ... | import os
from .kface import KFace
from .ms1m import MS1M
from .bin_datasets import BIN
from .ijb import IJB
def build_datasets(data_cfg, batch_size, cuda, workers, mode, rank=-1):
assert mode in ['train', 'test']
cfg = data_cfg[mode]
if cfg['dataset'] == 'kface':
dataset =... | none | 1 | 1.856429 | 2 | |
django_cd/notifications.py | ppinard/django-cd | 1 | 7436 | """"""
# Standard library modules.
import abc
# Third party modules.
from django.core.mail import send_mail
from django.template import Engine, Context
# Local modules.
from .models import RunState
# Globals and constants variables.
class Notification(metaclass=abc.ABCMeta):
@classmethod
def notify(self, ... | """"""
# Standard library modules.
import abc
# Third party modules.
from django.core.mail import send_mail
from django.template import Engine, Context
# Local modules.
from .models import RunState
# Globals and constants variables.
class Notification(metaclass=abc.ABCMeta):
@classmethod
def notify(self, ... | en | 0.495252 | # Standard library modules. # Third party modules. # Local modules. # Globals and constants variables. | 2.288557 | 2 |
Experiment/ltpFR3_MTurk/ListGen/ltpFR3_listgen.py | jpazdera/PazdKaha22 | 0 | 7437 | <reponame>jpazdera/PazdKaha22<filename>Experiment/ltpFR3_MTurk/ListGen/ltpFR3_listgen.py<gh_stars>0
#!/usr/bin/env python2
import random
import itertools
import numpy
import sys
import json
import copy
def make_bins_ltpFR3(semArray):
"""
Creates four equal-width bins of WAS scores, identical to those used in ... | #!/usr/bin/env python2
import random
import itertools
import numpy
import sys
import json
import copy
def make_bins_ltpFR3(semArray):
"""
Creates four equal-width bins of WAS scores, identical to those used in ltpFR2. Then combine the middle two to give
three bins: low similarity, medium similarity, and h... | en | 0.792145 | #!/usr/bin/env python2 Creates four equal-width bins of WAS scores, identical to those used in ltpFR2. Then combine the middle two to give three bins: low similarity, medium similarity, and high similarity. A coordinate in semRows[i][j] and semCols[i][j] is the index of the jth word pair in semArray that falls... | 2.924316 | 3 |
fastestimator/dataset/data/cifar10.py | DwijayDS/fastestimator | 57 | 7438 | # Copyright 2019 The FastEstimator Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | # Copyright 2019 The FastEstimator Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | en | 0.781444 | # Copyright 2019 The FastEstimator Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl... | 2.641201 | 3 |
examples/single_message.py | Inrixia/pyais | 51 | 7439 | <filename>examples/single_message.py
from pyais.messages import NMEAMessage
message = NMEAMessage(b"!AIVDM,1,1,,B,15M67FC000G?ufbE`FepT@3n00Sa,0*5C")
print(message.decode())
# or
message = NMEAMessage.from_string("!AIVDM,1,1,,B,15M67FC000G?ufbE`FepT@3n00Sa,0*5C")
print(message.decode())
| <filename>examples/single_message.py
from pyais.messages import NMEAMessage
message = NMEAMessage(b"!AIVDM,1,1,,B,15M67FC000G?ufbE`FepT@3n00Sa,0*5C")
print(message.decode())
# or
message = NMEAMessage.from_string("!AIVDM,1,1,,B,15M67FC000G?ufbE`FepT@3n00Sa,0*5C")
print(message.decode())
| none | 1 | 2.131441 | 2 | |
30_days_of_code_10.py | sercangul/HackerRank | 0 | 7440 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 3 19:02:33 2019
@author: sercangul
"""
def maxConsecutiveOnes(x):
# Initialize result
count = 0
# Count the number of iterations to
# reach x = 0.
while (x!=0):
# This operation reduces length
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 3 19:02:33 2019
@author: sercangul
"""
def maxConsecutiveOnes(x):
# Initialize result
count = 0
# Count the number of iterations to
# reach x = 0.
while (x!=0):
# This operation reduces length
... | en | 0.832054 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Mon Jun 3 19:02:33 2019 @author: sercangul # Initialize result # Count the number of iterations to # reach x = 0. # This operation reduces length # of every sequence of 1s by one. | 3.716677 | 4 |
artap/algorithm_cmaes.py | artap-framework/artap | 5 | 7441 | <gh_stars>1-10
import numpy as np
from .problem import Problem
from .algorithm_genetic import GeneralEvolutionaryAlgorithm
from .individual import Individual
from .operators import CustomGenerator, nondominated_truncate, RandomGenerator, UniformGenerator
import time
class CMA_ES(GeneralEvolutionaryAlgorithm):
"""... | import numpy as np
from .problem import Problem
from .algorithm_genetic import GeneralEvolutionaryAlgorithm
from .individual import Individual
from .operators import CustomGenerator, nondominated_truncate, RandomGenerator, UniformGenerator
import time
class CMA_ES(GeneralEvolutionaryAlgorithm):
"""
Implementa... | en | 0.690525 | Implementation of CMA_ES, Covariance Matrix Adaptation Evolutionary strategy (CMA_ES). The Covariance Matrix Adaptation Evolution Strategy (CMA-ES) [1] is one of the most effective approaches for black-box optimization, in which objective functions cannot be specified explicitly in general. CMA-ES outperfor... | 2.624194 | 3 |
apns_proxy_client/core.py | hagino3000/apns-proxy-client-py | 0 | 7442 | <reponame>hagino3000/apns-proxy-client-py
# -*- coding: utf-8 -*-
"""
APNS Proxy Serverのクライアント
"""
import time
import zmq
import simplejson as json
READ_TIMEOUT = 1500 # msec
FLUSH_TIMEOUT = 5000 # msec
COMMAND_ASK_ADDRESS = b'\1'
COMMAND_SEND = b'\2'
COMMAND_FEEDBACK = b'\3'
DEVICE_TOKEN_LENGTH = 64
JSON_ALERT... | # -*- coding: utf-8 -*-
"""
APNS Proxy Serverのクライアント
"""
import time
import zmq
import simplejson as json
READ_TIMEOUT = 1500 # msec
FLUSH_TIMEOUT = 5000 # msec
COMMAND_ASK_ADDRESS = b'\1'
COMMAND_SEND = b'\2'
COMMAND_FEEDBACK = b'\3'
DEVICE_TOKEN_LENGTH = 64
JSON_ALERT_KEY_SET = set(['body', 'action_loc_key', ... | ja | 0.998825 | # -*- coding: utf-8 -*- APNS Proxy Serverのクライアント # msec # msec ZMQコンテキストとソケットの初期化 リモートサーバーへ接続 PUSH-PULL接続用のポートを取得する デバイストークンの送信 送信データのフォーマット | 2.424574 | 2 |
003_joint_probabilities.py | svetlanama/snowball | 0 | 7443 | import sys
sys.path.insert(0, '..')
import numpy
import time
import ConfigParser
import topicmodel
def main():
# read configuration file
config = ConfigParser.ConfigParser()
config.readfp(open('config.ini'))
dataDir = config.get('main', 'dataDir')
io = topicmodel.io(dataDir)
model ... | import sys
sys.path.insert(0, '..')
import numpy
import time
import ConfigParser
import topicmodel
def main():
# read configuration file
config = ConfigParser.ConfigParser()
config.readfp(open('config.ini'))
dataDir = config.get('main', 'dataDir')
io = topicmodel.io(dataDir)
model ... | en | 0.580016 | # read configuration file # print wordDictionary # return | 2.149346 | 2 |
tests/bugs/core_4318_test.py | FirebirdSQL/firebird-qa | 1 | 7444 | <reponame>FirebirdSQL/firebird-qa
#coding:utf-8
#
# id: bugs.core_4318
# title: Regression: Predicates involving PSQL variables/parameters are not pushed inside the aggregation
# decription:
# tracker_id: CORE-4318
# min_versions: ['3.0']
# versions: 3.0
# qmid: None
import pytest
fro... | #coding:utf-8
#
# id: bugs.core_4318
# title: Regression: Predicates involving PSQL variables/parameters are not pushed inside the aggregation
# decription:
# tracker_id: CORE-4318
# min_versions: ['3.0']
# versions: 3.0
# qmid: None
import pytest
from firebird.qa import db_factory, i... | en | 0.696103 | #coding:utf-8 # # id: bugs.core_4318 # title: Regression: Predicates involving PSQL variables/parameters are not pushed inside the aggregation # decription: # tracker_id: CORE-4318 # min_versions: ['3.0'] # versions: 3.0 # qmid: None # version: 3.0 # resources: None recreate table t2 ( ... | 1.259938 | 1 |
dictionary.py | WilliamHackspeare/profanity-percentage | 0 | 7445 | <gh_stars>0
#Import the json library to parse JSON file to Python
import json
#Import list of punctuation characters from the string library
from string import punctuation as p
#This method checks if the given word is a profanity
def is_profanity(word):
#Open the JSON file
words_file = open('data.json')
#Pars... | #Import the json library to parse JSON file to Python
import json
#Import list of punctuation characters from the string library
from string import punctuation as p
#This method checks if the given word is a profanity
def is_profanity(word):
#Open the JSON file
words_file = open('data.json')
#Parse the JSON f... | en | 0.7816 | #Import the json library to parse JSON file to Python #Import list of punctuation characters from the string library #This method checks if the given word is a profanity #Open the JSON file #Parse the JSON file as a dictionary and extract the values #Check and return if the word is a bad work #This method calculates th... | 4.065308 | 4 |
setup.py | cyfrmedia/cerridwen | 25 | 7446 | from setuptools import setup
import os
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
#NEWS = open(os.path.join(here, 'NEWS.txt')).read()
rootdir = os.path.dirname(os.path.abspath(__file__))
exec(open(rootdir + '/cerridwen/version.py').read())
version = __VERS... | from setuptools import setup
import os
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
#NEWS = open(os.path.join(here, 'NEWS.txt')).read()
rootdir = os.path.dirname(os.path.abspath(__file__))
exec(open(rootdir + '/cerridwen/version.py').read())
version = __VERS... | en | 0.480315 | #NEWS = open(os.path.join(here, 'NEWS.txt')).read() # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers | 1.418959 | 1 |
pajbot/apiwrappers/authentication/access_token.py | JoachimFlottorp/pajbot | 128 | 7447 | <gh_stars>100-1000
import datetime
from abc import ABC, abstractmethod
import pajbot
class AccessToken(ABC):
SHOULD_REFRESH_THRESHOLD = 0.9
"""Fraction between 0 and 1 indicating what fraction/percentage of the specified full validity period
should actually be utilized. E.g. if this is set to 0.9, the i... | import datetime
from abc import ABC, abstractmethod
import pajbot
class AccessToken(ABC):
SHOULD_REFRESH_THRESHOLD = 0.9
"""Fraction between 0 and 1 indicating what fraction/percentage of the specified full validity period
should actually be utilized. E.g. if this is set to 0.9, the implementation will ... | en | 0.898983 | Fraction between 0 and 1 indicating what fraction/percentage of the specified full validity period should actually be utilized. E.g. if this is set to 0.9, the implementation will refresh the token once at least 90% of the full validity period (expires_in) is over. # can both be None # can be None # always a li... | 3.268646 | 3 |
GHOST.py | RadicalAjay/Ghost_data | 1 | 7448 | #! /usr/bin/python3
# Description: Data_Ghost, concealing data into spaces and tabs making it imperceptable to human eyes.
# Author: <NAME>
# Github: Radical Ajay
class Ghost():
def __init__(self, file_name, output_format='txt'):
''' Converts ascii text to spaces and tabs '''
self.file_name = file... | #! /usr/bin/python3
# Description: Data_Ghost, concealing data into spaces and tabs making it imperceptable to human eyes.
# Author: <NAME>
# Github: Radical Ajay
class Ghost():
def __init__(self, file_name, output_format='txt'):
''' Converts ascii text to spaces and tabs '''
self.file_name = file... | en | 0.57006 | #! /usr/bin/python3 # Description: Data_Ghost, concealing data into spaces and tabs making it imperceptable to human eyes. # Author: <NAME> # Github: Radical Ajay Converts ascii text to spaces and tabs Converting ascii to bianry Converting binary to ascii Ghosting data converting it to spaces and tabs Unghosting data c... | 3.476714 | 3 |
scan_predict.py | ychu196/chicago_scan | 0 | 7449 | <reponame>ychu196/chicago_scan
# Image classification using AWS Sagemaker and Linear Learner
# Program set up and import libraries
import numpy as np
import pandas as pd
import os
from sagemaker import get_execution_role
role = get_execution_role()
bucket = 'chi-hackathon-skin-images'
# Import Data
import boto3
from... | # Image classification using AWS Sagemaker and Linear Learner
# Program set up and import libraries
import numpy as np
import pandas as pd
import os
from sagemaker import get_execution_role
role = get_execution_role()
bucket = 'chi-hackathon-skin-images'
# Import Data
import boto3
from sagemaker import get_execution... | en | 0.745929 | # Image classification using AWS Sagemaker and Linear Learner # Program set up and import libraries # Import Data # need a way to go through entire library # TBD - transform json data to array # TBD - transform image data to dataframe # Split Data into Train and Validate # Train Model # Deploy Model # Validate | 2.50494 | 3 |
gerber/am_statements.py | FixturFab/pcb-tools | 0 | 7450 | <reponame>FixturFab/pcb-tools<filename>gerber/am_statements.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# copyright 2015 <NAME> <<EMAIL>> and <NAME>
# <<EMAIL>>
# 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 ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# copyright 2015 <NAME> <<EMAIL>> and <NAME>
# <<EMAIL>>
# 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/LI... | en | 0.599759 | #!/usr/bin/env python # -*- coding: utf-8 -*- # copyright 2015 <NAME> <<EMAIL>> and <NAME> # <<EMAIL>> # 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/LICEN... | 2.432302 | 2 |
heroquest/migrations/0002_auto_20160819_1747.py | DeividVM/heroquest | 0 | 7451 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-08-19 17:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('heroquest', '0001_initial'),
]
operations = [
migrations.RemoveField(
... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-08-19 17:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('heroquest', '0001_initial'),
]
operations = [
migrations.RemoveField(
... | en | 0.829543 | # -*- coding: utf-8 -*- # Generated by Django 1.9.9 on 2016-08-19 17:47 | 1.606497 | 2 |
dask/array/utils.py | epervago/dask | 0 | 7452 | <filename>dask/array/utils.py
from distutils.version import LooseVersion
import difflib
import os
import numpy as np
from .core import Array
from ..async import get_sync
if LooseVersion(np.__version__) >= '1.10.0':
allclose = np.allclose
else:
def allclose(a, b, **kwargs):
if kwargs.pop('equal_nan', F... | <filename>dask/array/utils.py
from distutils.version import LooseVersion
import difflib
import os
import numpy as np
from .core import Array
from ..async import get_sync
if LooseVersion(np.__version__) >= '1.10.0':
allclose = np.allclose
else:
def allclose(a, b, **kwargs):
if kwargs.pop('equal_nan', F... | en | 0.666705 | # Only check dtype matches for non-empty # Treat all empty arrays as equivalent | 2.149642 | 2 |
launchpad_py/__init__.py | inniyah/launchpad-py | 1 | 7453 | <reponame>inniyah/launchpad-py<gh_stars>1-10
# more specific selections for Python 3 (ASkr, 2/2018)
from launchpad_py.launchpad import Launchpad
from launchpad_py.launchpad import LaunchpadMk2
from launchpad_py.launchpad import LaunchpadPro
from launchpad_py.launchpad import LaunchControlXL
from launchpad_py.launchpad ... | # more specific selections for Python 3 (ASkr, 2/2018)
from launchpad_py.launchpad import Launchpad
from launchpad_py.launchpad import LaunchpadMk2
from launchpad_py.launchpad import LaunchpadPro
from launchpad_py.launchpad import LaunchControlXL
from launchpad_py.launchpad import LaunchKeyMini
from launchpad_py.launch... | en | 0.65638 | # more specific selections for Python 3 (ASkr, 2/2018) | 1.251906 | 1 |
networks/adabins/utils.py | EvoCargo/mono_depth | 0 | 7454 | <reponame>EvoCargo/mono_depth
import base64
import math
import re
from io import BytesIO
import matplotlib.cm
import numpy as np
import torch
import torch.nn
from PIL import Image
# Compute edge magnitudes
from scipy import ndimage
class RunningAverage:
def __init__(self):
self.avg = 0
... | import base64
import math
import re
from io import BytesIO
import matplotlib.cm
import numpy as np
import torch
import torch.nn
from PIL import Image
# Compute edge magnitudes
from scipy import ndimage
class RunningAverage:
def __init__(self):
self.avg = 0
self.count = 0
... | en | 0.328984 | # Compute edge magnitudes # normalize # vmin..vmax # Avoid 0-division # squeeze last dim if it exists # value = value.squeeze(axis=0) # (nxmx4) # return img.transpose((2, 0, 1)) # Demo Utilities # image = Image.open(cStringIO.StringIO(image_data)) # horizontal derivative # vertical derivative # Hide depth edges # d... | 2.101586 | 2 |
gdsfactory/types.py | simbilod/gdsfactory | 0 | 7455 | <gh_stars>0
"""In programming, a factory is a function that returns an object.
Functions are easy to understand because they have clear inputs and outputs.
Most gdsfactory functions take some inputs and return a Component object.
Some of these inputs parameters are also functions.
- Component: Object with.
- name... | """In programming, a factory is a function that returns an object.
Functions are easy to understand because they have clear inputs and outputs.
Most gdsfactory functions take some inputs and return a Component object.
Some of these inputs parameters are also functions.
- Component: Object with.
- name.
- refe... | en | 0.67182 | In programming, a factory is a function that returns an object. Functions are easy to understand because they have clear inputs and outputs. Most gdsfactory functions take some inputs and return a Component object. Some of these inputs parameters are also functions. - Component: Object with. - name. - referen... | 3.805895 | 4 |
tests/_site/myauth/models.py | ahmetdaglarbas/e-commerce | 2 | 7456 | # -*- coding: utf-8 -*-
# Code will only work with Django >= 1.5. See tests/config.py
import re
from django.utils.translation import ugettext_lazy as _
from django.db import models
from django.core import validators
from django.contrib.auth.models import BaseUserManager
from oscar.apps.customer.abstract_models impor... | # -*- coding: utf-8 -*-
# Code will only work with Django >= 1.5. See tests/config.py
import re
from django.utils.translation import ugettext_lazy as _
from django.db import models
from django.core import validators
from django.contrib.auth.models import BaseUserManager
from oscar.apps.customer.abstract_models impor... | en | 0.859163 | # -*- coding: utf-8 -*- # Code will only work with Django >= 1.5. See tests/config.py Creates and saves a User with the given email and password. Custom user based on Oscar's AbstractUser | 2.390666 | 2 |
5 - FC layers retraining/4 - FC weights to C++ code/weights_pck_to_cpp_unrolled_loop.py | brouwa/CNNs-on-FPSPs | 1 | 7457 | import pickle
import numpy as np
INPUT_FILENAME = 'NP_WEIGHTS.pck'
PRECISION = 100
# Open weights
fc1_k, fc1_b, fc2_k, fc2_b = pickle.load(
open(INPUT_FILENAME, 'rb'))
# Round them
fc1_k, fc1_b, fc2_k, fc2_b = fc1_k*PRECISION//1, fc1_b*PRECISION//1, fc2_k*PRECISION//1, fc2_b*PRECISION*PRECISION//1
fc1_k, fc1_b, f... | import pickle
import numpy as np
INPUT_FILENAME = 'NP_WEIGHTS.pck'
PRECISION = 100
# Open weights
fc1_k, fc1_b, fc2_k, fc2_b = pickle.load(
open(INPUT_FILENAME, 'rb'))
# Round them
fc1_k, fc1_b, fc2_k, fc2_b = fc1_k*PRECISION//1, fc1_b*PRECISION//1, fc2_k*PRECISION//1, fc2_b*PRECISION*PRECISION//1
fc1_k, fc1_b, f... | en | 0.625473 | # Open weights # Round them 0: GENERATE C++ ARRAYS, TO BE USED IN A STANDARD LOOP # Generate .cpp text # Output it 1: GENERATE C++ LOOP, USING THE ABOVE ARRAY Generates C++ code for computing a fully connected layer of int values, applying weights k and bias b, with hardcoded values in the source code. The function... | 2.48808 | 2 |
python/Canny_EdgeDetection.py | yubaoliu/Computer-Vision | 0 | 7458 | <gh_stars>0
import cv2
import numpy as np
import random
img = cv2.imread('../../Assets/Images/flower-white.jpeg', 1)
imgInfo = img.shape
height = imgInfo[0]
width = imgInfo[1]
cv2.imshow('img', img)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
imgG = cv2.GaussianBlur(gray, (3, 3), 0)
dst = cv2.Canny(img, 50, 50)
... | import cv2
import numpy as np
import random
img = cv2.imread('../../Assets/Images/flower-white.jpeg', 1)
imgInfo = img.shape
height = imgInfo[0]
width = imgInfo[1]
cv2.imshow('img', img)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
imgG = cv2.GaussianBlur(gray, (3, 3), 0)
dst = cv2.Canny(img, 50, 50)
cv2.imshow('... | none | 1 | 2.652159 | 3 | |
avod/core/trainer_stride.py | Guoxs/DODT | 1 | 7459 | <reponame>Guoxs/DODT<filename>avod/core/trainer_stride.py
"""Detection model trainer.
This file provides a generic training method to train a
DetectionModel.
"""
import datetime
import os
import tensorflow as tf
import time
from avod.builders import optimizer_builder
from avod.core import trainer_utils
from avod.core... | """Detection model trainer.
This file provides a generic training method to train a
DetectionModel.
"""
import datetime
import os
import tensorflow as tf
import time
from avod.builders import optimizer_builder
from avod.core import trainer_utils
from avod.core import summary_utils
slim = tf.contrib.slim
def train(m... | en | 0.563569 | Detection model trainer. This file provides a generic training method to train a DetectionModel. Training function for detection models. Args: model: The detection model object. train_config: a train_*pb2 protobuf. training i.e. loading RPN weights onto AVOD model. # Get model configur... | 2.583208 | 3 |
rest_framework_hmac/hmac_key/models.py | nickc92/django-rest-framework-hmac | 0 | 7460 | <gh_stars>0
import binascii
import os
from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
class HMACKey(models.Model):
"""
The default HMACKey model that can auto generate a
key/secret for HMAC Auth via a signal
"""
def generate_ke... | import binascii
import os
from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
class HMACKey(models.Model):
"""
The default HMACKey model that can auto generate a
key/secret for HMAC Auth via a signal
"""
def generate_key():
... | en | 0.735595 | The default HMACKey model that can auto generate a key/secret for HMAC Auth via a signal Returns a 40 character hex string based on binary random data # Only create a DB table for this Model if this app is registered | 2.263792 | 2 |
test/conftest.py | Geoiv/river | 0 | 7461 | <gh_stars>0
import os
from tempfile import NamedTemporaryFile
import boto3
from moto import mock_s3
import pandas as pd
import pandavro as pdx
import pickle
import pytest
@pytest.fixture(autouse=True, scope='session')
def aws_credentials():
"""
Sets AWS credentials to invalid values. Applied to all test func... | import os
from tempfile import NamedTemporaryFile
import boto3
from moto import mock_s3
import pandas as pd
import pandavro as pdx
import pickle
import pytest
@pytest.fixture(autouse=True, scope='session')
def aws_credentials():
"""
Sets AWS credentials to invalid values. Applied to all test functions and
... | en | 0.891997 | Sets AWS credentials to invalid values. Applied to all test functions and scoped to the entire testing session, so there's no chance of interfering with production buckets. Universal bucket name for use throughout testing List of keys to be used for populating a bucket with empty objects List of keys to be used... | 2.109292 | 2 |
company/migrations/0021_auto_20161208_1113.py | uktrade/directory-api | 2 | 7462 | <filename>company/migrations/0021_auto_20161208_1113.py
# -*- coding: utf-8 -*-
# Generated by Django 1.9.10 on 2016-12-08 11:13
from __future__ import unicode_literals
from django.db import migrations
from company import helpers
def ensure_verification_code(apps, schema_editor):
Company = apps.get_model("compa... | <filename>company/migrations/0021_auto_20161208_1113.py
# -*- coding: utf-8 -*-
# Generated by Django 1.9.10 on 2016-12-08 11:13
from __future__ import unicode_literals
from django.db import migrations
from company import helpers
def ensure_verification_code(apps, schema_editor):
Company = apps.get_model("compa... | en | 0.821157 | # -*- coding: utf-8 -*- # Generated by Django 1.9.10 on 2016-12-08 11:13 | 1.731173 | 2 |
system/indy-node-tests/TestAuthMapSuite.py | Toktar/indy-test-automation | 0 | 7463 | import pytest
import asyncio
from system.utils import *
from random import randrange as rr
import hashlib
import time
from datetime import datetime, timedelta, timezone
from indy import payment
import logging
logger = logging.getLogger(__name__)
@pytest.mark.usefixtures('docker_setup_and_teardown')
class TestAuthMa... | import pytest
import asyncio
from system.utils import *
from random import randrange as rr
import hashlib
import time
from datetime import datetime, timedelta, timezone
from indy import payment
import logging
logger = logging.getLogger(__name__)
@pytest.mark.usefixtures('docker_setup_and_teardown')
class TestAuthMa... | en | 0.883766 | # add adder to add nym # add editor to edit nym # add nym with verkey by adder # push adder vk # edit verkey by editor # push editor vk # negative cases # try to add another nym with editor did - should be rejected # try to edit initial nym one more time with adder did - should be rejected # add target nym # add adder ... | 1.898396 | 2 |
test/integration/test_reindex.py | jgough/opensearch-curator | 8 | 7464 | <reponame>jgough/opensearch-curator<filename>test/integration/test_reindex.py
import opensearchpy
import curator
import os
import json
import string
import random
import tempfile
import click
from click import testing as clicktest
import time
from . import CuratorTestCase
from unittest.case import SkipTest
from . impo... | import opensearchpy
import curator
import os
import json
import string
import random
import tempfile
import click
from click import testing as clicktest
import time
from . import CuratorTestCase
from unittest.case import SkipTest
from . import testvars as testvars
import logging
logger = logging.getLogger(__name__)
... | en | 0.822869 | # Decorators make this pylint exception necessary # pylint: disable=E1123 # Decorators make this pylint exception necessary # pylint: disable=E1123 # Decorators make this pylint exception necessary # pylint: disable=E1123 # Build remote client # Build indices remotely. # Decorators make this pylint exception necessary ... | 2.20989 | 2 |
libhustpass/login.py | naivekun/libhustpass | 26 | 7465 | import libhustpass.sbDes as sbDes
import libhustpass.captcha as captcha
import requests
import re
import random
def toWideChar(data):
data_bytes = bytes(data, encoding="utf-8")
ret = []
for i in data_bytes:
ret.extend([0, i])
while len(ret) % 8 != 0:
ret.append(0)
return ret
def En... | import libhustpass.sbDes as sbDes
import libhustpass.captcha as captcha
import requests
import re
import random
def toWideChar(data):
data_bytes = bytes(data, encoding="utf-8")
ret = []
for i in data_bytes:
ret.extend([0, i])
while len(ret) % 8 != 0:
ret.append(0)
return ret
def En... | none | 1 | 2.755907 | 3 | |
code/contours_sorting_by_area.py | Asadullah-Dal17/contours-detection-advance | 1 | 7466 | import cv2 as cv
import numpy as np
def areaFinder(contours):
areas = []
for c in contours:
a =cv.contourArea(c)
areas.append(a)
return areas
def sortedContoursByArea(img, larger_to_smaller=True):
edges_img = cv.Canny(img, 100, 150)
contours , h = cv.findContours(edges_img, cv.RETR_... | import cv2 as cv
import numpy as np
def areaFinder(contours):
areas = []
for c in contours:
a =cv.contourArea(c)
areas.append(a)
return areas
def sortedContoursByArea(img, larger_to_smaller=True):
edges_img = cv.Canny(img, 100, 150)
contours , h = cv.findContours(edges_img, cv.RETR_... | en | 0.115267 | # print(areaFinder(contours)) | 3.091959 | 3 |
matchzoo/metrics/precision.py | ChrisRBXiong/MatchZoo-py | 468 | 7467 | <filename>matchzoo/metrics/precision.py
"""Precision for ranking."""
import numpy as np
from matchzoo.engine.base_metric import (
BaseMetric, sort_and_couple, RankingMetric
)
class Precision(RankingMetric):
"""Precision metric."""
ALIAS = 'precision'
def __init__(self, k: int = 1, threshold: float ... | <filename>matchzoo/metrics/precision.py
"""Precision for ranking."""
import numpy as np
from matchzoo.engine.base_metric import (
BaseMetric, sort_and_couple, RankingMetric
)
class Precision(RankingMetric):
"""Precision metric."""
ALIAS = 'precision'
def __init__(self, k: int = 1, threshold: float ... | en | 0.605053 | Precision for ranking. Precision metric. :class:`PrecisionMetric` constructor. :param k: Number of results to consider. :param threshold: the label threshold of relevance degree. :return: Formated string representation of the metric. Calculate precision@k. Example: >>> y_true = [0,... | 2.627677 | 3 |
src/main/py/ltprg/config/seq.py | forkunited/ltprg | 11 | 7468 | from mung.torch_ext.eval import Loss
from ltprg.model.seq import DataParameter, SequenceModelNoInput, SequenceModelInputToHidden, SequenceModelAttendedInput
from ltprg.model.seq import VariableLengthNLLLoss
# Expects config of the form:
# {
# data_parameter : {
# seq : [SEQUENCE PARAMETER NAME]
# inp... | from mung.torch_ext.eval import Loss
from ltprg.model.seq import DataParameter, SequenceModelNoInput, SequenceModelInputToHidden, SequenceModelAttendedInput
from ltprg.model.seq import VariableLengthNLLLoss
# Expects config of the form:
# {
# data_parameter : {
# seq : [SEQUENCE PARAMETER NAME]
# inp... | en | 0.348839 | # Expects config of the form: # { # data_parameter : { # seq : [SEQUENCE PARAMETER NAME] # input : [INPUT PARAMETER NAME] # } # name : [ID FOR MODEL] # arch_type : [SequenceModelNoInput|SequenceModelInputToHidden] # dropout : [DROPOUT] # rnn_layers : [RNN_LAYERS] # rnn_size : [SIZE OF RNN HIDDEN L... | 2.213829 | 2 |
src/Utilities/metadata_worker.py | sigseg5/nometa-tg | 3 | 7469 | from shutil import move
import piexif
from PIL import Image
def delete_metadata(full_path_to_img):
"""
This function used for remove metadata only from documents, if you send image 'as image' Telegram automatically
removes all metadata at sending. This function removes all metadata via 'piexif' lib, save... | from shutil import move
import piexif
from PIL import Image
def delete_metadata(full_path_to_img):
"""
This function used for remove metadata only from documents, if you send image 'as image' Telegram automatically
removes all metadata at sending. This function removes all metadata via 'piexif' lib, save... | en | 0.709679 | This function used for remove metadata only from documents, if you send image 'as image' Telegram automatically removes all metadata at sending. This function removes all metadata via 'piexif' lib, saved image in '/app' folder, and after that move it to 'documents' folder. :param full_path_to_img: path to f... | 3.128879 | 3 |
dkr-py310/docker-student-portal-310/course_files/begin_advanced/py_unit_2.py | pbarton666/virtual_classroom | 0 | 7470 | #py_unit_2.py
import unittest
class FirstTest(unittest.TestCase):
def setUp(self):
"setUp() runs before every test"
self.msg="Sorry, Charlie, but {} is not the same as {}."
def tearDown(self):
"tearDown runs after every test"
pass
def test_me(self):
"this test should pass"
first=1
second=2
self.asse... | #py_unit_2.py
import unittest
class FirstTest(unittest.TestCase):
def setUp(self):
"setUp() runs before every test"
self.msg="Sorry, Charlie, but {} is not the same as {}."
def tearDown(self):
"tearDown runs after every test"
pass
def test_me(self):
"this test should pass"
first=1
second=2
self.asse... | ru | 0.430017 | #py_unit_2.py | 3.469018 | 3 |
src/scheduled_task/__init__.py | Sciocatti/python_scheduler_and_clean_forced_exit | 0 | 7471 | from .scheduled_task import ScheduledTask | from .scheduled_task import ScheduledTask | none | 1 | 1.026928 | 1 | |
scripts/game.py | davidnegrazis/PyPlayText-Workshop | 0 | 7472 | from sys import exit
# ------------------------------------------------------------------------------
global dev_name
global game_title
dev_name = "" # enter your name in the quotes!
game_title = "" # enter the game title in the quotes!
# ------------------------------------------------------------------------------
... | from sys import exit
# ------------------------------------------------------------------------------
global dev_name
global game_title
dev_name = "" # enter your name in the quotes!
game_title = "" # enter the game title in the quotes!
# ------------------------------------------------------------------------------
... | en | 0.571419 | # ------------------------------------------------------------------------------ # enter your name in the quotes! # enter the game title in the quotes! # ------------------------------------------------------------------------------ # ---------- initial values ---------- # these are used to define the starting values o... | 3.986287 | 4 |
lc1108_defangip.py | moheed/algo | 0 | 7473 | <reponame>moheed/algo<gh_stars>0
class Solution:
def defangIPaddr(self, address: str) -> str:
i=0
j=0
strlist=list(address)
defang=[]
while i< len(strlist):
if strlist[i] == '.':
defang.append('[')
defang.append('.')
... | class Solution:
def defangIPaddr(self, address: str) -> str:
i=0
j=0
strlist=list(address)
defang=[]
while i< len(strlist):
if strlist[i] == '.':
defang.append('[')
defang.append('.')
defang.append(']')
... | fi | 0.050455 | # return string | 3.385378 | 3 |
src/elections_address_files/commands/zip_files.py | gregbunce/assign_vista_pcts_to_sgid_addrpnts | 0 | 7474 | <filename>src/elections_address_files/commands/zip_files.py<gh_stars>0
import os, zipfile
# Zip files.
def zipfiles(directory):
# File extension to zip.
#ext = ('.gdb', '.csv')
ext = ('.gdb')
# Iterate over all files and check for desired extentions for zipping.
for file in os.listdir(direc... | <filename>src/elections_address_files/commands/zip_files.py<gh_stars>0
import os, zipfile
# Zip files.
def zipfiles(directory):
# File extension to zip.
#ext = ('.gdb', '.csv')
ext = ('.gdb')
# Iterate over all files and check for desired extentions for zipping.
for file in os.listdir(direc... | en | 0.869773 | # Zip files. # File extension to zip. #ext = ('.gdb', '.csv') # Iterate over all files and check for desired extentions for zipping. #: Zip it. | 3.061276 | 3 |
tartiflette/parser/nodes/node.py | erezsh/tartiflette | 0 | 7475 | <filename>tartiflette/parser/nodes/node.py<gh_stars>0
class Node:
def __init__(self, path, libgraphql_type, location, name):
self.path = path
self.parent = None
self.children = []
self.libgraphql_type = libgraphql_type
self.location = location
self.name = name
de... | <filename>tartiflette/parser/nodes/node.py<gh_stars>0
class Node:
def __init__(self, path, libgraphql_type, location, name):
self.path = path
self.parent = None
self.children = []
self.libgraphql_type = libgraphql_type
self.location = location
self.name = name
de... | none | 1 | 2.285786 | 2 | |
mars/services/web/tests/test_core.py | yuyiming/mars | 1 | 7476 | # Copyright 1999-2021 Alibaba Group Holding 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 a... | # Copyright 1999-2021 Alibaba Group Holding 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 a... | en | 0.839836 | # Copyright 1999-2021 Alibaba Group Holding 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 a... | 1.891118 | 2 |
test/test.py | caizhanjin/deepseg | 0 | 7477 | """
例子为MNIST,对手写图片进行分类。
神经网络hello world。
"""
import tensorflow as tf
import numpy as np
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
# 封装网络用到的API
def weight_variable(shape):
initial = tf.truncated_normal(shape, stddev=0.1)
return tf.... | """
例子为MNIST,对手写图片进行分类。
神经网络hello world。
"""
import tensorflow as tf
import numpy as np
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
# 封装网络用到的API
def weight_variable(shape):
initial = tf.truncated_normal(shape, stddev=0.1)
return tf.... | en | 0.35113 | 例子为MNIST,对手写图片进行分类。 神经网络hello world。 # 封装网络用到的API MNIST进阶 # [batch_size, 784] 第一层卷积 # [batch_size, 28, 28, 1] # [batch_size, 28, 28, 32] # [batch_size, 14, 14, 32] 第二层卷积 # [batch_size, 14, 14, 64] # [batch_size, 7, 7, 64] 全连接层 # [batch_size, 7*7*64] # [batch_size, 1024] dropout 输出层 # [batch_size, 10] # 计算损失和添加优化器 # 评估模... | 3.779173 | 4 |
game/content/ghplots/lancemates.py | jwvhewitt/gearhead-caramel | 74 | 7478 | import pbge
from game.content.plotutility import LMSkillsSelfIntro
from game.content import backstory
from pbge.plots import Plot
from pbge.dialogue import Offer, ContextTag
from game.ghdialogue import context
import gears
import game.content.gharchitecture
import game.content.ghterrain
import random
from game import m... | import pbge
from game.content.plotutility import LMSkillsSelfIntro
from game.content import backstory
from pbge.plots import Plot
from pbge.dialogue import Offer, ContextTag
from game.ghdialogue import context
import gears
import game.content.gharchitecture
import game.content.ghterrain
import random
from game import m... | en | 0.87001 | # ******************* # *** UTILITIES *** # ******************* # ************************** # *** RANDOM_LANCEMATE *** # ************************** # Amazing stats, amazingly crap skills. Returns True if this plot matches the current plot state. Returns True if this plot matches the current plot state.... | 2.221493 | 2 |
projects/detr/scripts/dd.py | zzzzzz0407/detectron2 | 1 | 7479 | import json
if __name__ == '__main__':
jsonFile = '/data00/home/zhangrufeng1/projects/detectron2/projects/detr/datasets/mot/mot17/annotations/mot17_train_half.json'
with open(jsonFile, 'r') as f:
infos = json.load(f)
count_dict = dict()
for info in infos["images"]:
if info["file_name"]... | import json
if __name__ == '__main__':
jsonFile = '/data00/home/zhangrufeng1/projects/detectron2/projects/detr/datasets/mot/mot17/annotations/mot17_train_half.json'
with open(jsonFile, 'r') as f:
infos = json.load(f)
count_dict = dict()
for info in infos["images"]:
if info["file_name"]... | none | 1 | 2.621495 | 3 | |
app/app.py | wesleibarboza/natasha-virtual | 23 | 7480 | <reponame>wesleibarboza/natasha-virtual
# -*- coding: utf-8 -*-
"""Archivo principal para el echobot. Main File for the echobot"""
from fbmq import Page
from flask import Flask, request
# Token generado por la página web. Generated token in the facebook web page
PAGE_ACCESS_TOKEN = "COPY_HERE_YOUR_PAGE_ACCES_TOKEN"
# ... | # -*- coding: utf-8 -*-
"""Archivo principal para el echobot. Main File for the echobot"""
from fbmq import Page
from flask import Flask, request
# Token generado por la página web. Generated token in the facebook web page
PAGE_ACCESS_TOKEN = "COPY_HERE_YOUR_PAGE_ACCES_TOKEN"
# Token generado por nosotros. Token gener... | es | 0.706969 | # -*- coding: utf-8 -*- Archivo principal para el echobot. Main File for the echobot # Token generado por la página web. Generated token in the facebook web page # Token generado por nosotros. Token generated by us # Si cambias este token, asegúrate de cambiarlo también en la página de configuración del webhook. If you... | 2.826879 | 3 |
Camvid/CamVid_utlis.py | Water2style/FCN-pytorch-CanRun | 7 | 7481 | <filename>Camvid/CamVid_utlis.py
# -*- coding: utf-8 -*-
from __future__ import print_function
from matplotlib import pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import scipy.misc
import random
import os
import imageio
#############################
# global variables #
#####################... | <filename>Camvid/CamVid_utlis.py
# -*- coding: utf-8 -*-
from __future__ import print_function
from matplotlib import pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import scipy.misc
import random
import os
import imageio
#############################
# global variables #
#####################... | zh | 0.895137 | # -*- coding: utf-8 -*- ############################# # global variables # ############################# # train data # train label # color to label # validation file # train file # create dir for label index #返回这个目录里,所有内容,‘图1’‘,图2’...... #702个图片 #注意这里是训练集 #训练集700张,分10%的数量给验证集 #设置随机种子 #看看后面哪里用 #sample(seq, n) 从序列seq中选... | 2.61704 | 3 |
stream-reasoner/ws_client.py | patrik999/AdaptiveStreamReasoningMonitoring | 1 | 7482 | #!/usr/bin/env python
import websocket
import time
try:
import thread
except ImportError:
import _thread as thread
runs = 100
def on_message(ws, message):
print(message)
def on_error(ws, error):
print(error)
def on_close(ws):
print("### closed ###")
def on_open(ws):
... | #!/usr/bin/env python
import websocket
import time
try:
import thread
except ImportError:
import _thread as thread
runs = 100
def on_message(ws, message):
print(message)
def on_error(ws, error):
print(error)
def on_close(ws):
print("### closed ###")
def on_open(ws):
... | en | 0.452143 | #!/usr/bin/env python ## closed ###") | 2.724776 | 3 |
Main.py | samuelterra22/Data-Mining | 0 | 7483 | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
import seaborn as sns
from matplotlib import rcParams
import statsmodels.api as sm
from statsmodels.formula.api import ols
df = pd.read_csv('kc_house_data.csv')
# print(df.head())
# print(df.isnull().any())
# print(df.d... | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
import seaborn as sns
from matplotlib import rcParams
import statsmodels.api as sm
from statsmodels.formula.api import ols
df = pd.read_csv('kc_house_data.csv')
# print(df.head())
# print(df.isnull().any())
# print(df.d... | en | 0.24939 | # print(df.head()) # print(df.isnull().any()) # print(df.describe()) # fig = plt.figure(figsize=(12, 6)) # sqft = fig.add_subplot(121) # cost = fig.add_subplot(122) # # sqft.hist(df.sqft_living, bins=80) # sqft.set_xlabel('Ft^2') # sqft.set_title("Histogram of House Square Footage") # # cost.hist(df.price, bins=80) # c... | 3.028525 | 3 |
whole_cell_patch/filterDialog.py | 11uc/whole_cell_patch | 2 | 7484 | <reponame>11uc/whole_cell_patch<filename>whole_cell_patch/filterDialog.py
# Dialogs for setting filter parameters.
from PyQt5.QtWidgets import QLabel, QGridLayout, QPushButton, \
QLineEdit, QVBoxLayout, QHBoxLayout, QDialog, QComboBox, QWidget
from PyQt5.QtCore import pyqtSignal
class FilterDialog(QDialog):
'''
D... | # Dialogs for setting filter parameters.
from PyQt5.QtWidgets import QLabel, QGridLayout, QPushButton, \
QLineEdit, QVBoxLayout, QHBoxLayout, QDialog, QComboBox, QWidget
from PyQt5.QtCore import pyqtSignal
class FilterDialog(QDialog):
'''
Dialog for choosing filter types.
'''
def __init__(self, default, parent ... | en | 0.474487 | # Dialogs for setting filter parameters. Dialog for choosing filter types. Build ui and set up parameter setting Parameters ---------- default: list List of filters, which are dictionaries with names under key "name" and parameter elements. parent: QWidget, optional Parent widget. Attributes ---... | 2.61449 | 3 |
projects/controllable_dialogue/tasks/agents.py | zl930216/ParlAI | 41 | 7485 | <filename>projects/controllable_dialogue/tasks/agents.py
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
from .build import build, make_path
from parlai.uti... | <filename>projects/controllable_dialogue/tasks/agents.py
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
from .build import build, make_path
from parlai.uti... | en | 0.896436 | #!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. | 2.13632 | 2 |
problems/p009.py | davisschenk/project-euler-python | 0 | 7486 | <gh_stars>0
from math import ceil, sqrt
from problem import Problem
from utils.math import gcd
class PythagoreanTriplet(Problem, name="Special Pythagorean triplet", expected=31875000):
@Problem.solution()
def brute_force(self, ts=1000):
for a in range(3, round((ts - 3) / 2)):
for b in ran... | from math import ceil, sqrt
from problem import Problem
from utils.math import gcd
class PythagoreanTriplet(Problem, name="Special Pythagorean triplet", expected=31875000):
@Problem.solution()
def brute_force(self, ts=1000):
for a in range(3, round((ts - 3) / 2)):
for b in range(a + 1, ro... | none | 1 | 3.454254 | 3 | |
Roche.py | murbanec/Roche2D | 0 | 7487 |
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 14 10:37:04 2021
@author: <NAME>
"""
#calculates trajectory of small mass positioned close to L4 Lagrange point
#creates gif as output
import math
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation, PillowWriter
Distan... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 14 10:37:04 2021
@author: <NAME>
"""
#calculates trajectory of small mass positioned close to L4 Lagrange point
#creates gif as output
import math
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation, PillowWriter
Distan... | en | 0.812949 | # -*- coding: utf-8 -*- Created on Thu Jan 14 10:37:04 2021 @author: <NAME> #calculates trajectory of small mass positioned close to L4 Lagrange point #creates gif as output # m JUPITER FROM SUN # kg # kg #FROM KEPLER LAW #Period #center of mass is located at [0,0] massive object (Sun) is located at -r1, secondary obj... | 3.040827 | 3 |
youtube_dl/extractor/azubu.py | LyleH/youtube-dl | 0 | 7488 | <gh_stars>0
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
ExtractorError,
float_or_none,
sanitized_Request,
)
class AzubuIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?azubu\.tv/[^/]+#!/play/(?P<id>\d+)'
_TESTS = [
{
... | from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
ExtractorError,
float_or_none,
sanitized_Request,
)
class AzubuIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?azubu\.tv/[^/]+#!/play/(?P<id>\d+)'
_TESTS = [
{
'ur... | en | 0.622692 | #!/play/(?P<id>\d+)' #!/play/15575/2014-hot6-cup-last-big-match-ro8-day-1', #!/play/9344/-fnatic-at-worlds-2014:-toyz---%22i-love-rekkles,-he-has-amazing-mechanics%22-', | 2.194637 | 2 |
conda_build/main_develop.py | dan-blanchard/conda-build | 0 | 7489 | <reponame>dan-blanchard/conda-build
# (c) Continuum Analytics, Inc. / http://continuum.io
# All Rights Reserved
#
# conda is distributed under the terms of the BSD 3-clause license.
# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
from __future__ import absolute_import, division, print_function
i... | # (c) Continuum Analytics, Inc. / http://continuum.io
# All Rights Reserved
#
# conda is distributed under the terms of the BSD 3-clause license.
# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
from __future__ import absolute_import, division, print_function
import sys
from os.path import join, ... | en | 0.842154 | # (c) Continuum Analytics, Inc. / http://continuum.io # All Rights Reserved # # conda is distributed under the terms of the BSD 3-clause license. # Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause. Install a Python package in 'development mode'. This works by creating a conda.pth file in site-package... | 1.887541 | 2 |
benchmarking/experiments/sanity_check.py | ltgoslo/norBERT | 19 | 7490 | #!/bin/env python3
from transformers import TFBertForTokenClassification
from data_preparation.data_preparation_pos import MBERTTokenizer as MBERT_Tokenizer_pos
import sys
if __name__ == "__main__":
if len(sys.argv) > 1:
modelname = sys.argv[1]
else:
modelname = "ltgoslo/norbert"
model = T... | #!/bin/env python3
from transformers import TFBertForTokenClassification
from data_preparation.data_preparation_pos import MBERTTokenizer as MBERT_Tokenizer_pos
import sys
if __name__ == "__main__":
if len(sys.argv) > 1:
modelname = sys.argv[1]
else:
modelname = "ltgoslo/norbert"
model = T... | ru | 0.167759 | #!/bin/env python3 | 2.301654 | 2 |
nca47/api/controllers/v1/firewall/securityZone.py | WosunOO/nca_xianshu | 0 | 7491 | <filename>nca47/api/controllers/v1/firewall/securityZone.py
from oslo_serialization import jsonutils as json
from nca47.api.controllers.v1 import base
from nca47.common.i18n import _
from nca47.common.i18n import _LI, _LE
from nca47.common.exception import Nca47Exception
from oslo_log import log
from nca47.api.controll... | <filename>nca47/api/controllers/v1/firewall/securityZone.py
from oslo_serialization import jsonutils as json
from nca47.api.controllers.v1 import base
from nca47.common.i18n import _
from nca47.common.i18n import _LI, _LE
from nca47.common.exception import Nca47Exception
from oslo_log import log
from nca47.api.controll... | en | 0.299055 | # input the SecurityZone values with dic format # get_all the SecurityZone values with dic format # get the staticnat values with dic format # input the SecurityZone values with dic format # input the SecurityZone values with dic format | 2.078423 | 2 |
mlmodels/model_tch/nbeats/model.py | gitter-badger/mlmodels | 1 | 7492 | import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
def seasonality_model(thetas, t, device):
p = thetas.size()[-1]
assert p < 10, 'thetas_dim is too big.'
p1, p2 = (p // 2, p // 2) if p % 2 == 0 else (p // 2, p // 2 + 1)
s1 = torch.tensor([np.cos(2 * np.pi * i * ... | import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
def seasonality_model(thetas, t, device):
p = thetas.size()[-1]
assert p < 10, 'thetas_dim is too big.'
p1, p2 = (p // 2, p // 2) if p % 2 == 0 else (p // 2, p // 2 + 1)
s1 = torch.tensor([np.cos(2 * np.pi * i * ... | en | 0.78097 | # H/2-1 # no constraint for generic arch. # generic. 3.3. # generic. 3.3. #{stack_id}) (share_weights_in_stack={self.share_weights_in_stack})') # pick up the last one to make the # maybe batch size here. | 2.439188 | 2 |
BACKPROPAGATION/Backprop.py | chaya-v/AI-ML-Lab-Programs | 2 | 7493 | from math import exp
from random import seed
from random import random
def initialize_network(n_inputs, n_hidden, n_outputs):
network = list()
hidden_layer = [{'weights':[random() for i in range(n_inputs + 1)]} for i in range(n_hidden)]
network.append(hidden_layer)
output_layer = [{'weights':[random() for i in r... | from math import exp
from random import seed
from random import random
def initialize_network(n_inputs, n_hidden, n_outputs):
network = list()
hidden_layer = [{'weights':[random() for i in range(n_inputs + 1)]} for i in range(n_hidden)]
network.append(hidden_layer)
output_layer = [{'weights':[random() for i in r... | none | 1 | 3.356484 | 3 | |
tests/multi_design_test.py | benoitc/hypercouch | 3 | 7494 | """\
Copyright (c) 2009 <NAME> <<EMAIL>>
This file is part of hypercouch which is released uner the MIT license.
"""
import time
import unittest
import couchdb
COUCHURI = "http://127.0.0.1:5984/"
TESTDB = "hyper_tests"
class MultiDesignTest(unittest.TestCase):
def setUp(self):
self.srv = couchdb.Server(CO... | """\
Copyright (c) 2009 <NAME> <<EMAIL>>
This file is part of hypercouch which is released uner the MIT license.
"""
import time
import unittest
import couchdb
COUCHURI = "http://127.0.0.1:5984/"
TESTDB = "hyper_tests"
class MultiDesignTest(unittest.TestCase):
def setUp(self):
self.srv = couchdb.Server(CO... | en | 0.327863 | \ Copyright (c) 2009 <NAME> <<EMAIL>> This file is part of hypercouch which is released uner the MIT license. \ function(doc) { if(doc.body) index(doc.body); if(doc.foo != undefined) property("foo", doc.foo); } \ function(doc) { ... | 2.367818 | 2 |
xled_plus/samples/colmeander.py | DanieleMancini/xled_plus | 0 | 7495 | <filename>xled_plus/samples/colmeander.py<gh_stars>0
from .sample_setup import *
ctr = setup_control()
eff = ColorMeanderEffect(ctr, "solid")
eff.launch_rt()
input()
eff.stop_rt()
ctr.turn_off()
| <filename>xled_plus/samples/colmeander.py<gh_stars>0
from .sample_setup import *
ctr = setup_control()
eff = ColorMeanderEffect(ctr, "solid")
eff.launch_rt()
input()
eff.stop_rt()
ctr.turn_off()
| none | 1 | 1.428189 | 1 | |
python/dgl/nn/pytorch/sparse_emb.py | wcyjames/dgl | 0 | 7496 | <filename>python/dgl/nn/pytorch/sparse_emb.py
"""Torch NodeEmbedding."""
from datetime import timedelta
import torch as th
from ...backend import pytorch as F
from ...utils import get_shared_mem_array, create_shared_mem_array
_STORE = None
class NodeEmbedding: # NodeEmbedding
'''Class for storing node embeddings.... | <filename>python/dgl/nn/pytorch/sparse_emb.py
"""Torch NodeEmbedding."""
from datetime import timedelta
import torch as th
from ...backend import pytorch as F
from ...utils import get_shared_mem_array, create_shared_mem_array
_STORE = None
class NodeEmbedding: # NodeEmbedding
'''Class for storing node embeddings.... | en | 0.657158 | Torch NodeEmbedding. # NodeEmbedding Class for storing node embeddings. The class is optimized for training large-scale node embeddings. It updates the embedding in a sparse way and can scale to graphs with millions of nodes. It also supports partitioning to multiple GPUs (on a single machine) for more acc... | 2.842093 | 3 |
tests/sentry/web/frontend/test_create_team.py | seukjung/sentry-custom | 20 | 7497 | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.models import OrganizationMember, OrganizationMemberTeam, Team
from sentry.testutils import TestCase, PermissionTestCase
class CreateTeamPermissionTest(PermissionTestCase):
def setUp(self):
super(CreateTeamPe... | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.models import OrganizationMember, OrganizationMemberTeam, Team
from sentry.testutils import TestCase, PermissionTestCase
class CreateTeamPermissionTest(PermissionTestCase):
def setUp(self):
super(CreateTeamPe... | none | 1 | 2.134494 | 2 | |
agendamentos/migrations/0011_alter_agendamentosfuncionarios_table.py | afnmachado/univesp_pi_1 | 0 | 7498 | # Generated by Django 3.2.8 on 2021-11-29 05:47
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('agendamentos', '0010_agendamentosfuncionarios'),
]
operations = [
migrations.AlterModelTable(
name='agendamentosfuncionarios',
... | # Generated by Django 3.2.8 on 2021-11-29 05:47
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('agendamentos', '0010_agendamentosfuncionarios'),
]
operations = [
migrations.AlterModelTable(
name='agendamentosfuncionarios',
... | en | 0.855995 | # Generated by Django 3.2.8 on 2021-11-29 05:47 | 1.238852 | 1 |
openstack/tests/unit/metric/v1/test_capabilities.py | teresa-ho/stx-openstacksdk | 43 | 7499 | <reponame>teresa-ho/stx-openstacksdk<gh_stars>10-100
# 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 agre... | # 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, software
# distributed under the Li... | en | 0.859654 | # 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, software # distributed under the Li... | 1.955348 | 2 |