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 |
|---|---|---|---|---|---|---|---|---|---|---|
EMeRGE/dssmetrics/constants.py | NREL/EMeRGE | 6 | 1500 | <reponame>NREL/EMeRGE
""" Default values : DO NOT CHANGE !!!"""
LOG_FORMAT = "%(asctime)s: %(levelname)s: %(message)s"
DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
MAXITERATIONS = 100
LIFE_PARAMETERS = {"theta_i":30,"theta_fl":36,"theta_gfl":28.6,
"R":4.87,"n":1,"tau":3.5,"m":1,"A":-13.391,
... | """ Default values : DO NOT CHANGE !!!"""
LOG_FORMAT = "%(asctime)s: %(levelname)s: %(message)s"
DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
MAXITERATIONS = 100
LIFE_PARAMETERS = {"theta_i":30,"theta_fl":36,"theta_gfl":28.6,
"R":4.87,"n":1,"tau":3.5,"m":1,"A":-13.391,
"B":6972.15,"num_o... | hi | 0.099607 | Default values : DO NOT CHANGE !!! | 1.548013 | 2 |
minesweeper/game.py | MathisFederico/Minesweeper | 1 | 1501 | try:
import importlib.resources as pkg_resources
except ImportError:
# Try backported to PY<37 `importlib_resources`.
import importlib_resources as pkg_resources
from . import images
from gym import Env, spaces
from time import time
import numpy as np
from copy import copy
import colorsys
import pygame
f... | try:
import importlib.resources as pkg_resources
except ImportError:
# Try backported to PY<37 `importlib_resources`.
import importlib_resources as pkg_resources
from . import images
from gym import Env, spaces
from time import time
import numpy as np
from copy import copy
import colorsys
import pygame
f... | en | 0.459542 | # Try backported to PY<37 `importlib_resources`. # Define constants # Setting up gym Env conventions # Initalize state ## Setup bombs places ## Place numbers ## Place bombs # Setup rendering # 0 -> 1 = reveal; 1 -> 2 = toggle_flag # pylint: disable=E1101 # pylint: disable=E1101 # Plot background # Plot grid # Plot info... | 2.33567 | 2 |
tests/python/gaia-ui-tests/gaiatest/tests/functional/lockscreen/test_lockscreen_unlock_to_camera_with_passcode.py | BReduardokramer/gaia | 1 | 1502 | <filename>tests/python/gaia-ui-tests/gaiatest/tests/functional/lockscreen/test_lockscreen_unlock_to_camera_with_passcode.py
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0... | <filename>tests/python/gaia-ui-tests/gaiatest/tests/functional/lockscreen/test_lockscreen_unlock_to_camera_with_passcode.py
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0... | en | 0.842578 | # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Input data # Turn off geolocation prompt # this time we need it locked! # https://github.com/mozilla/gaia-ui-tests/issu... | 2.335779 | 2 |
models/layers/mesh_conv.py | CallumMcMahon/MeshCNN | 2 | 1503 | <filename>models/layers/mesh_conv.py
import torch
import torch.nn as nn
import torch.nn.functional as F
class MeshConv(nn.Module):
""" Computes convolution between edges and 4 incident (1-ring) edge neighbors
in the forward pass takes:
x: edge features (Batch x Features x Edges)
mesh: list of mesh data... | <filename>models/layers/mesh_conv.py
import torch
import torch.nn as nn
import torch.nn.functional as F
class MeshConv(nn.Module):
""" Computes convolution between edges and 4 incident (1-ring) edge neighbors
in the forward pass takes:
x: edge features (Batch x Features x Edges)
mesh: list of mesh data... | en | 0.783074 | Computes convolution between edges and 4 incident (1-ring) edge neighbors in the forward pass takes: x: edge features (Batch x Features x Edges) mesh: list of mesh data-structure (len(mesh) == Batch) and applies convolution # pad gemm # build 'neighborhood image' and apply convolution # flatten Gi gathe... | 2.754234 | 3 |
code/0-input/create_hdf5/check_hdf5.py | AvinWangZH/3D-convolutional-speaker-recognition | 1 | 1504 | import tables
import numpy as np
import matplotlib.pyplot as plt
# Reading the file.
fileh = tables.open_file('development.hdf5', mode='r')
# Dimentionality of the data structure.
print(fileh.root.utterance_test.shape)
print(fileh.root.utterance_train.shape)
print(fileh.root.label_train.shape)
print(fileh.root.label_... | import tables
import numpy as np
import matplotlib.pyplot as plt
# Reading the file.
fileh = tables.open_file('development.hdf5', mode='r')
# Dimentionality of the data structure.
print(fileh.root.utterance_test.shape)
print(fileh.root.utterance_train.shape)
print(fileh.root.label_train.shape)
print(fileh.root.label_... | en | 0.796411 | # Reading the file. # Dimentionality of the data structure. | 2.544941 | 3 |
qtask/utils/testing.py | LinkTsang/qtask-legacy-python | 0 | 1505 | <reponame>LinkTsang/qtask-legacy-python
import asyncio
import traceback
import unittest
def async_test(f):
def wrapper(test_case: unittest.TestCase, *args, **kwargs):
loop = asyncio.get_event_loop()
task = loop.create_task(f(test_case, *args, **kwargs))
try:
loop.run_until_comp... | import asyncio
import traceback
import unittest
def async_test(f):
def wrapper(test_case: unittest.TestCase, *args, **kwargs):
loop = asyncio.get_event_loop()
task = loop.create_task(f(test_case, *args, **kwargs))
try:
loop.run_until_complete(task)
except Exception:
... | none | 1 | 2.507723 | 3 | |
landing/views.py | theflatladder/kyrsovaya | 0 | 1506 | <reponame>theflatladder/kyrsovaya
from django.shortcuts import render, render_to_response, redirect
from django.contrib import auth
from django.contrib.auth.forms import UserCreationForm
from django.template.context_processors import csrf
from django.http import HttpResponseRedirect
def login(request):
args = {}
... | from django.shortcuts import render, render_to_response, redirect
from django.contrib import auth
from django.contrib.auth.forms import UserCreationForm
from django.template.context_processors import csrf
from django.http import HttpResponseRedirect
def login(request):
args = {}
args.update(csrf(request))
... | none | 1 | 2.293133 | 2 | |
FPRun11.py | yecfly/DEPRESSIONEST | 0 | 1507 | <gh_stars>0
from Facepatchindependenttrain import runPatch
import sys
if len(sys.argv)==6:
runPatch(GPU_Device_ID=1, FacePatchID=int(sys.argv[1]),
trainpklID=int(sys.argv[2]), testpklID=int(sys.argv[3]),
NetworkType=int(sys.argv[4]),
runs=int(sys... | from Facepatchindependenttrain import runPatch
import sys
if len(sys.argv)==6:
runPatch(GPU_Device_ID=1, FacePatchID=int(sys.argv[1]),
trainpklID=int(sys.argv[2]), testpklID=int(sys.argv[3]),
NetworkType=int(sys.argv[4]),
runs=int(sys.argv[5]))
... | none | 1 | 2.177101 | 2 | |
vendor/packages/translate-toolkit/translate/convert/test_po2tmx.py | jgmize/kitsune | 2 | 1508 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from translate.convert import po2tmx
from translate.convert import test_convert
from translate.misc import wStringIO
from translate.storage import tmx
from translate.storage import lisa
class TestPO2TMX:
def po2tmx(self, posource, sourcelanguage='en', ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from translate.convert import po2tmx
from translate.convert import test_convert
from translate.misc import wStringIO
from translate.storage import tmx
from translate.storage import lisa
class TestPO2TMX:
def po2tmx(self, posource, sourcelanguage='en', targetlanguage=... | en | 0.512056 | #!/usr/bin/env python # -*- coding: utf-8 -*- helper that converts po source to tmx source without requiring files # Afrikaans translation of program ABC # msgid "" msgstr "" "Project-Id-Version: program 2.1-branch\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-01-09 07:15+0100\n" "PO-Revision-Date: 2004-03-30 ... | 2.445803 | 2 |
plugin.video.yatp/libs/client/commands.py | mesabib/kodi.yatp | 54 | 1509 | <filename>plugin.video.yatp/libs/client/commands.py<gh_stars>10-100
# coding: utf-8
# Module: commands
# Created on: 28.07.2015
# Author: <NAME> aka <NAME>. (<EMAIL>)
# Licence: GPL v.3: http://www.gnu.org/copyleft/gpl.html
"""
Context menu commands
"""
import sys
import xbmc
import xbmcgui
import json_requests as jso... | <filename>plugin.video.yatp/libs/client/commands.py<gh_stars>10-100
# coding: utf-8
# Module: commands
# Created on: 28.07.2015
# Author: <NAME> aka <NAME>. (<EMAIL>)
# Licence: GPL v.3: http://www.gnu.org/copyleft/gpl.html
"""
Context menu commands
"""
import sys
import xbmc
import xbmcgui
import json_requests as jso... | en | 0.486928 | # coding: utf-8 # Module: commands # Created on: 28.07.2015 # Author: <NAME> aka <NAME>. (<EMAIL>) # Licence: GPL v.3: http://www.gnu.org/copyleft/gpl.html Context menu commands Display current torrent info :param info_hash: :return: | 2.291405 | 2 |
setup.py | GeorgeDittmar/MarkovTextGenerator | 1 | 1510 | #!/usr/bin/env python
from distutils.core import setup
setup(name='Mimik',
version='1.0',
description='Python framework for markov models',
author='<NAME>',
author_email='<EMAIL>',
url='https://www.python.org/sigs/distutils-sig/',
packages=['distutils', 'distutils.command'],
... | #!/usr/bin/env python
from distutils.core import setup
setup(name='Mimik',
version='1.0',
description='Python framework for markov models',
author='<NAME>',
author_email='<EMAIL>',
url='https://www.python.org/sigs/distutils-sig/',
packages=['distutils', 'distutils.command'],
... | ru | 0.26433 | #!/usr/bin/env python | 1.129797 | 1 |
pipeline/scripts/package.py | deplatformr/open-images | 2 | 1511 | import os
import shutil
import sqlite3
import tarfile
from datetime import datetime
import bagit
def create_package(images, batch_dir):
package_threshold = 838860800 # 800 Mib to the next power of 2 = 1GiB
print("Package threshold: " + get_human_readable_file_size(package_threshold))
abs_path = os.getc... | import os
import shutil
import sqlite3
import tarfile
from datetime import datetime
import bagit
def create_package(images, batch_dir):
package_threshold = 838860800 # 800 Mib to the next power of 2 = 1GiB
print("Package threshold: " + get_human_readable_file_size(package_threshold))
abs_path = os.getc... | en | 0.807901 | # 800 Mib to the next power of 2 = 1GiB # create new batch directory # move all related files for the last image that's getting removed from batch to keep within threshold # drop the last image from the list (convert tuple) to get the package size back under threshold # Convert batch directory into a Bagit directory # ... | 2.837179 | 3 |
app/search/hot_eval/hl_reportable.py | don4apaev/anfisa | 0 | 1512 | def evalRec(env, rec):
"""hl_reportable"""
return (len(set(rec.Genes) &
{
'ABHD12',
'ACTG1',
'ADGRV1',
'AIFM1',
'ATP6V1B1',
'BCS1L',
'BSND',
'CABP2',
'CACNA1D',
'CDC14A',
'... | def evalRec(env, rec):
"""hl_reportable"""
return (len(set(rec.Genes) &
{
'ABHD12',
'ACTG1',
'ADGRV1',
'AIFM1',
'ATP6V1B1',
'BCS1L',
'BSND',
'CABP2',
'CACNA1D',
'CDC14A',
'... | en | 0.356862 | hl_reportable | 1.568421 | 2 |
eval/util/metrics.py | fau-is/grm | 5 | 1513 | import sklearn
import pandas
import seaborn as sns
import matplotlib.pyplot as pyplot
from functools import reduce
# import numpy as np
def metrics_from_prediction_and_label(labels, predictions, verbose=False):
measures = {
"accuracy": sklearn.metrics.accuracy_score(labels, predictions),
"balance... | import sklearn
import pandas
import seaborn as sns
import matplotlib.pyplot as pyplot
from functools import reduce
# import numpy as np
def metrics_from_prediction_and_label(labels, predictions, verbose=False):
measures = {
"accuracy": sklearn.metrics.accuracy_score(labels, predictions),
"balance... | en | 0.530192 | # import numpy as np # note we use the average precision at different threshold values as the auc of the pr-curve # and not the auc-pr-curve with the trapezoidal rule / linear interpolation because it could be too optimistic # Specificity or true negative rate # Fall out or false positive rate # Negative predictive val... | 2.66166 | 3 |
dpgs_sandbox/tests/test_bug_migrations_in_base_models.py | gabrielpiassetta/django-pgschemas | 0 | 1514 | import warnings
from unittest.mock import patch
from django.apps import apps
from django.core import management
from django.core.management.base import CommandError
from django.db import models
from django.db.utils import ProgrammingError
from django.test import TransactionTestCase, tag
from django_pgschemas.checks i... | import warnings
from unittest.mock import patch
from django.apps import apps
from django.core import management
from django.core.management.base import CommandError
from django.db import models
from django.db.utils import ProgrammingError
from django.test import TransactionTestCase, tag
from django_pgschemas.checks i... | en | 0.868768 | Provoke a handled ProgrammingError by migrating models from empty database. # The goal is that the next line doesn't raise ProgrammingError Provoke a handled ProgrammingError by running tenant command with pending model changes. # Avoid warnings about model being registered twice # We first unapply a migration with fak... | 2.079555 | 2 |
tfx/components/transform/component.py | pingsutw/tfx | 0 | 1515 | <filename>tfx/components/transform/component.py
# Lint as: python2, python3
# Copyright 2019 Google LLC. 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://ww... | <filename>tfx/components/transform/component.py
# Lint as: python2, python3
# Copyright 2019 Google LLC. 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://ww... | en | 0.676428 | # Lint as: python2, python3 # Copyright 2019 Google LLC. 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 req... | 1.880612 | 2 |
objects/GitIndexEntry.py | anderslatif/alg | 0 | 1516 | # https://github.com/git/git/blob/master/Documentation/technical/index-format.txt
class GitIndexEntry(object):
# The last time a file's metadata changed. This is a tuple (seconds, nanoseconds)
ctime = None
# The last time a file's data changed. This is a tuple (seconds, nanoseconds)
mtime = None
#... | # https://github.com/git/git/blob/master/Documentation/technical/index-format.txt
class GitIndexEntry(object):
# The last time a file's metadata changed. This is a tuple (seconds, nanoseconds)
ctime = None
# The last time a file's data changed. This is a tuple (seconds, nanoseconds)
mtime = None
#... | en | 0.791964 | # https://github.com/git/git/blob/master/Documentation/technical/index-format.txt # The last time a file's metadata changed. This is a tuple (seconds, nanoseconds) # The last time a file's data changed. This is a tuple (seconds, nanoseconds) # the ID of device containing this file # The file's inode number # The object... | 2.294116 | 2 |
matdgl/layers/partitionpaddinglayer.py | huzongxiang/CrystalNetwork | 6 | 1517 |
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 13 14:47:13 2021
@author: huzongxiang
"""
import tensorflow as tf
from tensorflow.keras import layers
class PartitionPadding(layers.Layer):
def __init__(self, batch_size, **kwargs):
super().__init__(**kwargs)
self.batch_size = batch_size
def ... |
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 13 14:47:13 2021
@author: huzongxiang
"""
import tensorflow as tf
from tensorflow.keras import layers
class PartitionPadding(layers.Layer):
def __init__(self, batch_size, **kwargs):
super().__init__(**kwargs)
self.batch_size = batch_size
def ... | en | 0.771132 | # -*- coding: utf-8 -*- Created on Wed Oct 13 14:47:13 2021 @author: huzongxiang # Obtain subgraphs # Pad and stack subgraphs # Remove empty subgraphs (usually for last batch) # Obtain subgraphs # Pad and stack subgraphs # Remove empty subgraphs (usually for last batch) | 2.54802 | 3 |
lino_book/projects/min9/settings/memory.py | khchine5/book | 1 | 1518 | <gh_stars>1-10
from .demo import *
SITE.verbose_name = SITE.verbose_name + " (:memory:)"
# SITE = Site(globals(), title=Site.title+" (:memory:)")
DATABASES['default']['NAME'] = ':memory:'
| from .demo import *
SITE.verbose_name = SITE.verbose_name + " (:memory:)"
# SITE = Site(globals(), title=Site.title+" (:memory:)")
DATABASES['default']['NAME'] = ':memory:' | en | 0.42443 | # SITE = Site(globals(), title=Site.title+" (:memory:)") | 1.667175 | 2 |
reservation/urls.py | aryamanak10/diner-restaurant-website | 1 | 1519 | from django.urls import path
from . import views
app_name = 'reservation'
urlpatterns = [
path('', views.reserve_table, name = 'reserve_table'),
] | from django.urls import path
from . import views
app_name = 'reservation'
urlpatterns = [
path('', views.reserve_table, name = 'reserve_table'),
] | none | 1 | 1.526623 | 2 | |
chainer/_version.py | yumetov/chainer | 3,705 | 1520 | __version__ = '7.8.0'
_optional_dependencies = [
{
'name': 'CuPy',
'packages': [
'cupy-cuda120',
'cupy-cuda114',
'cupy-cuda113',
'cupy-cuda112',
'cupy-cuda111',
'cupy-cuda110',
'cupy-cuda102',
'cupy-cud... | __version__ = '7.8.0'
_optional_dependencies = [
{
'name': 'CuPy',
'packages': [
'cupy-cuda120',
'cupy-cuda114',
'cupy-cuda113',
'cupy-cuda112',
'cupy-cuda111',
'cupy-cuda110',
'cupy-cuda102',
'cupy-cud... | none | 1 | 1.083206 | 1 | |
image_aug.py | qwerasdf887/image_augmentation | 0 | 1521 | <filename>image_aug.py
# coding=UTF-8
# This Python file uses the following encoding: utf-8
import cv2
import numpy as np
import xml.etree.cElementTree as ET
from random import sample
#default args:
default_args = {'noise_prob': 0.1,
'gasuss_mean': 0,
'gasuss_var': 0.001,
... | <filename>image_aug.py
# coding=UTF-8
# This Python file uses the following encoding: utf-8
import cv2
import numpy as np
import xml.etree.cElementTree as ET
from random import sample
#default args:
default_args = {'noise_prob': 0.1,
'gasuss_mean': 0,
'gasuss_var': 0.001,
... | zh | 0.07988 | # coding=UTF-8 # This Python file uses the following encoding: utf-8 #default args: #添加黑色noise #高斯noise #調整彩度(彩度通道加上隨機-N~N之值) #調整飽和度(飽和度通道加上隨機-N~N之值) #調整亮度(亮度通道加上隨機-N~N之值) #水平翻轉 Args: box_loc: bounding box location(x_min, y_min, x_max, y_max) #垂直翻轉 Args: box_loc: bounding box location(num box,(x_min, y_... | 2.628622 | 3 |
03_picnic/picnic.py | intimanipuchi/tiny_python_projects | 0 | 1522 | #!/usr/bin/env python3
"""
Author : <NAME> <<EMAIL>>
Date : 2021-12-15
Purpose: Working with lists
"""
import argparse
# --------------------------------------------------
def get_args():
"""Get command-line arguments"""
parser = argparse.ArgumentParser(
description="Working with lists",
f... | #!/usr/bin/env python3
"""
Author : <NAME> <<EMAIL>>
Date : 2021-12-15
Purpose: Working with lists
"""
import argparse
# --------------------------------------------------
def get_args():
"""Get command-line arguments"""
parser = argparse.ArgumentParser(
description="Working with lists",
f... | en | 0.283181 | #!/usr/bin/env python3 Author : <NAME> <<EMAIL>> Date : 2021-12-15 Purpose: Working with lists # -------------------------------------------------- Get command-line arguments # -------------------------------------------------- The main function: formatting and printing the output # print(items) # print(items) # ----... | 4.199751 | 4 |
triangle.py | montyshyama/python-basics | 0 | 1523 | <filename>triangle.py
side_a=int(input("Enter the first side(a):"))
side_b=int(input("Enter the second side(b):"))
side_c=int(input("Enter the third side(c):"))
if side_a==side_b and side_a==side_c:
print("The triangle is an equilateral triangle.")
elif side_a==side_b or side_a==side_c or side_b==side_c:
... | <filename>triangle.py
side_a=int(input("Enter the first side(a):"))
side_b=int(input("Enter the second side(b):"))
side_c=int(input("Enter the third side(c):"))
if side_a==side_b and side_a==side_c:
print("The triangle is an equilateral triangle.")
elif side_a==side_b or side_a==side_c or side_b==side_c:
... | none | 1 | 4.17685 | 4 | |
david/modules/artist/view.py | ktmud/david | 2 | 1524 | <reponame>ktmud/david
# -*- coding: utf-8 -*-
from flask import Blueprint, request
from david.lib.template import st
from .model import Artist
bp = Blueprint('artist', __name__)
@bp.app_template_global('artists')
def artists():
return Artist.query.all()
@bp.route('/artist/<uid>/')
def intro(uid):
artist = Ar... | # -*- coding: utf-8 -*-
from flask import Blueprint, request
from david.lib.template import st
from .model import Artist
bp = Blueprint('artist', __name__)
@bp.app_template_global('artists')
def artists():
return Artist.query.all()
@bp.route('/artist/<uid>/')
def intro(uid):
artist = Artist.get_or_404(uid)
... | en | 0.769321 | # -*- coding: utf-8 -*- | 2.207407 | 2 |
Volume Estimation/volume.py | JessieRamaux/Food-Volume-Estimation | 10 | 1525 | import numpy as np
import cv2
import os
import json
import glob
from PIL import Image, ImageDraw
plate_diameter = 25 #cm
plate_depth = 1.5 #cm
plate_thickness = 0.2 #cm
def Max(x, y):
if (x >= y):
return x
else:
return y
def polygons_to_mask(img_shape, polygons):
mask = np.zeros(img_shape... | import numpy as np
import cv2
import os
import json
import glob
from PIL import Image, ImageDraw
plate_diameter = 25 #cm
plate_depth = 1.5 #cm
plate_thickness = 0.2 #cm
def Max(x, y):
if (x >= y):
return x
else:
return y
def polygons_to_mask(img_shape, polygons):
mask = np.zeros(img_shape... | en | 0.16399 | #cm #cm #cm #print(lowest) #print(len_per_pix, depth_per_pix) | 2.502933 | 3 |
t2k/bin/cmttags.py | tianluyuan/pyutils | 1 | 1526 | #!/usr/bin/env python
"""
A script to create tags for CMT managed packages.
Call from within cmt/ directory
"""
import subprocess
import sys
import os
from optparse import OptionParser
__author__ = '<NAME>'
__email__ = 't<EMAIL>uan [at] colorado.edu'
# Ignore large external packages for now
IGNORES = ['CMT', 'EXTE... | #!/usr/bin/env python
"""
A script to create tags for CMT managed packages.
Call from within cmt/ directory
"""
import subprocess
import sys
import os
from optparse import OptionParser
__author__ = '<NAME>'
__email__ = 't<EMAIL>uan [at] colorado.edu'
# Ignore large external packages for now
IGNORES = ['CMT', 'EXTE... | en | 0.802256 | #!/usr/bin/env python A script to create tags for CMT managed packages. Call from within cmt/ directory # Ignore large external packages for now # Extensions for finding src files, must satisfy unix wildcard rules # Ignore these files and dirs, key specifies argument to find # (e.g. '-iname') Are we inside cmt/ Ensure... | 2.349195 | 2 |
salt/daemons/masterapi.py | rickh563/salt | 0 | 1527 | # -*- coding: utf-8 -*-
'''
This module contains all of the routines needed to set up a master server, this
involves preparing the three listeners and the workers needed by the master.
'''
from __future__ import absolute_import
# Import python libs
import fnmatch
import logging
import os
import re
import time
import s... | # -*- coding: utf-8 -*-
'''
This module contains all of the routines needed to set up a master server, this
involves preparing the three listeners and the workers needed by the master.
'''
from __future__ import absolute_import
# Import python libs
import fnmatch
import logging
import os
import re
import time
import s... | en | 0.837755 | # -*- coding: utf-8 -*- This module contains all of the routines needed to set up a master server, this involves preparing the three listeners and the workers needed by the master. # Import python libs # Import salt libs # Import 3rd-party libs # pwd is not available on windows # Things to do in lower layers: # only ac... | 1.984316 | 2 |
core/domain/role_services_test.py | Mohitbalwani26/oppia | 0 | 1528 | <gh_stars>0
# coding: utf-8
#
# Copyright 2017 The Oppia 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
#
# ... | # coding: utf-8
#
# Copyright 2017 The Oppia 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 requi... | en | 0.821358 | # coding: utf-8 # # Copyright 2017 The Oppia 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 requi... | 1.907345 | 2 |
deep_learning/keras/keras/backend/cntk_backend.py | xpennec/applications | 21 | 1529 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cntk as C
import numpy as np
from .common import floatx, epsilon, image_dim_ordering, image_data_format
from collections import defaultdict
from contextlib import contextmanager
import warnings
C.set_g... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cntk as C
import numpy as np
from .common import floatx, epsilon, image_dim_ordering, image_data_format
from collections import defaultdict
from contextlib import contextmanager
import warnings
C.set_g... | en | 0.83772 | # A learning phase is a bool tensor used to run Keras models in # either train mode (learning_phase == 1) or test mode (learning_phase == 0). # LEARNING_PHASE_PLACEHOLDER is the placeholder for dynamic learning phase # static learning phase flag, if it is not 0 or 1, we will go with dynamic learning phase tensor. # cnt... | 2.274226 | 2 |
Project Files/Prebuilt tools/twitter/Twitter/pylib/oauthlib/oauth1/rfc5849/endpoints/resource.py | nVoid/Yale-TouchDesigner-April2016 | 39 | 1530 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth1.rfc5849.endpoints.resource
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of the resource protection provider logic of
OAuth 1.0 RFC 5849.
"""
from __future__ import absolute_import, unicode_literals
from oauthlib.common import log
from .base i... | # -*- coding: utf-8 -*-
"""
oauthlib.oauth1.rfc5849.endpoints.resource
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of the resource protection provider logic of
OAuth 1.0 RFC 5849.
"""
from __future__ import absolute_import, unicode_literals
from oauthlib.common import log
from .base i... | en | 0.780487 | # -*- coding: utf-8 -*- oauthlib.oauth1.rfc5849.endpoints.resource ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of the resource protection provider logic of OAuth 1.0 RFC 5849. An endpoint responsible for protecting resources. Typical use is to instantiate with a request validator a... | 2.606096 | 3 |
python/ex_1.py | AymenSe/Geometric-operations-DIP | 0 | 1531 | <filename>python/ex_1.py
####################################################
#
# @ Authors : <NAME>
# <NAME>
#
# @ Hint: you have to install all requirements
# from requirements.txt
#
####################################################
import numpy as np
import cv2 as cv
import matp... | <filename>python/ex_1.py
####################################################
#
# @ Authors : <NAME>
# <NAME>
#
# @ Hint: you have to install all requirements
# from requirements.txt
#
####################################################
import numpy as np
import cv2 as cv
import matp... | en | 0.611636 | #################################################### # # @ Authors : <NAME> # <NAME> # # @ Hint: you have to install all requirements # from requirements.txt # #################################################### # load the image # Store height and width and channels of the image # Store the spectral resolutio... | 3.366796 | 3 |
utils/hit_rate_utils.py | h-zcc/ref-nms | 19 | 1532 | <gh_stars>10-100
from utils.misc import calculate_iou, xywh_to_xyxy
__all__ = ['NewHitRateEvaluator', 'CtxHitRateEvaluator']
class NewHitRateEvaluator:
def __init__(self, refer, top_N=None, threshold=0.5):
"""Evaluate refexp-based hit rate.
Args:
refdb: `refdb` dict.
sp... | from utils.misc import calculate_iou, xywh_to_xyxy
__all__ = ['NewHitRateEvaluator', 'CtxHitRateEvaluator']
class NewHitRateEvaluator:
def __init__(self, refer, top_N=None, threshold=0.5):
"""Evaluate refexp-based hit rate.
Args:
refdb: `refdb` dict.
split: Dataset spli... | en | 0.718122 | Evaluate refexp-based hit rate. Args: refdb: `refdb` dict. split: Dataset split to evaluate on. top_N: Select top-N scoring proposals to evaluate. `None` means no selection. Default `None`. Evaluate refexp-based hit rate. Args: proposal_dict: {exp_id or ... | 2.325453 | 2 |
LeetCode_ReorderDataLogFiles.py | amukher3/Problem_solutions | 1 | 1533 | # -*- coding: utf-8 -*-
"""
Created on Sat Aug 22 19:07:30 2020
@author: <NAME>
"""
class Solution:
def reorderLogFiles(self, logs: List[str]) -> List[str]:
letLog=[]
digLog=[]
for i in range(len(logs)):
temp=[]
temp=logs[i].split(' ... | # -*- coding: utf-8 -*-
"""
Created on Sat Aug 22 19:07:30 2020
@author: <NAME>
"""
class Solution:
def reorderLogFiles(self, logs: List[str]) -> List[str]:
letLog=[]
digLog=[]
for i in range(len(logs)):
temp=[]
temp=logs[i].split(' ... | en | 0.702181 | # -*- coding: utf-8 -*- Created on Sat Aug 22 19:07:30 2020
@author: <NAME> | 3.250321 | 3 |
saleor/core/transactions.py | fairhopeweb/saleor | 15,337 | 1534 | from contextlib import contextmanager
from django.db import DatabaseError
from ..core.tracing import traced_atomic_transaction
@contextmanager
def transaction_with_commit_on_errors():
"""Perform transaction and raise an error in any occurred."""
error = None
with traced_atomic_transaction():
try... | from contextlib import contextmanager
from django.db import DatabaseError
from ..core.tracing import traced_atomic_transaction
@contextmanager
def transaction_with_commit_on_errors():
"""Perform transaction and raise an error in any occurred."""
error = None
with traced_atomic_transaction():
try... | en | 0.887046 | Perform transaction and raise an error in any occurred. | 2.360704 | 2 |
src/command_modules/azure-cli-policyinsights/azure/cli/command_modules/policyinsights/tests/latest/test_policyinsights_scenario.py | diberry/azure-cli | 1 | 1535 | <reponame>diberry/azure-cli
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ----------------------------------------... | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | en | 0.42147 | # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------... | 1.876846 | 2 |
tests/prep_post/test.py | Aslic/rmats_turbo_4.1.0 | 0 | 1536 | <reponame>Aslic/rmats_turbo_4.1.0
import glob
import os.path
import subprocess
import sys
import unittest
import tests.bam
import tests.base_test
import tests.gtf
import tests.output_parser as output_parser
import tests.test_config
import tests.util
class Test(tests.base_test.BaseTest):
def setUp(self):
... | import glob
import os.path
import subprocess
import sys
import unittest
import tests.bam
import tests.base_test
import tests.gtf
import tests.output_parser as output_parser
import tests.test_config
import tests.util
class Test(tests.base_test.BaseTest):
def setUp(self):
super().setUp()
self._tes... | en | 0.611237 | # chromosome # chromosome length # chromosome # chromosome length # chromosome # chromosome length # chromosome # chromosome length # filenames begin with a timestamp used for alphanumeric sort | 2.208243 | 2 |
nltk/align/util.py | kruskod/nltk | 1 | 1537 | # Natural Language Toolkit: Aligner Utilities
#
# Copyright (C) 2001-2015 NLTK Project
# Author: <NAME>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
from nltk.align.api import Alignment
def pharaohtext2tuples(pharaoh_text):
"""
Converts pharaoh text format into an Alignment object ... | # Natural Language Toolkit: Aligner Utilities
#
# Copyright (C) 2001-2015 NLTK Project
# Author: <NAME>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
from nltk.align.api import Alignment
def pharaohtext2tuples(pharaoh_text):
"""
Converts pharaoh text format into an Alignment object ... | en | 0.691054 | # Natural Language Toolkit: Aligner Utilities # # Copyright (C) 2001-2015 NLTK Project # Author: <NAME> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT Converts pharaoh text format into an Alignment object (a list of tuples). >>> pharaoh_text = '0-0 2-1 9-2 21-3 10-4 7-5' >... | 3.820419 | 4 |
grr/server/grr_response_server/databases/db_yara_test_lib.py | khanhgithead/grr | 4,238 | 1538 | <gh_stars>1000+
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""A module with test cases for the YARA database method."""
import os
from grr_response_server.databases import db
from grr_response_server.rdfvalues import objects as rdf_objects
class DatabaseTestYaraMixin(object):
"""A mixin class for testing YAR... | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""A module with test cases for the YARA database method."""
import os
from grr_response_server.databases import db
from grr_response_server.rdfvalues import objects as rdf_objects
class DatabaseTestYaraMixin(object):
"""A mixin class for testing YARA methods of dat... | en | 0.649581 | #!/usr/bin/env python # -*- encoding: utf-8 -*- A module with test cases for the YARA database method. A mixin class for testing YARA methods of database implementations. # Writing duplicated signatures is possible, it should not raise. | 2.272439 | 2 |
gpytorch/kernels/inducing_point_kernel.py | 4aHxKzD/gpytorch | 1 | 1539 | #!/usr/bin/env python3
import copy
import math
import torch
from ..distributions import MultivariateNormal
from ..lazy import DiagLazyTensor, LowRankRootAddedDiagLazyTensor, LowRankRootLazyTensor, MatmulLazyTensor, delazify
from ..mlls import InducingPointKernelAddedLossTerm
from ..models import exact_prediction_str... | #!/usr/bin/env python3
import copy
import math
import torch
from ..distributions import MultivariateNormal
from ..lazy import DiagLazyTensor, LowRankRootAddedDiagLazyTensor, LowRankRootLazyTensor, MatmulLazyTensor, delazify
from ..mlls import InducingPointKernelAddedLossTerm
from ..models import exact_prediction_str... | en | 0.460614 | #!/usr/bin/env python3 # Diagonal correction for predictive posterior # Get diagonal of covar # Allow for fast variances | 2.031907 | 2 |
app/__init__.py | Jotasenpai/DigitalMediaStoreRESTfull | 0 | 1540 | import logging
import os
from flask import Flask
from flask_cors import CORS
from app.extensions import api
from app.extensions.database import db
from app.extensions.schema import ma
from app.views import albums, artists, hello, tracks
def create_app(config, **kwargs):
logging.basicConfig(level=logging.INFO)
... | import logging
import os
from flask import Flask
from flask_cors import CORS
from app.extensions import api
from app.extensions.database import db
from app.extensions.schema import ma
from app.views import albums, artists, hello, tracks
def create_app(config, **kwargs):
logging.basicConfig(level=logging.INFO)
... | en | 0.289794 | # app.url_map.strict_slashes = False | 1.884401 | 2 |
app.py | SASHA-PAIS/A-Flask-web-app-for-inventory-management | 0 | 1541 | <gh_stars>0
from flask import Flask, url_for, request, redirect
from flask import render_template as render
from flask_mysqldb import MySQL
import yaml
import json
import MySQLdb
import decimal
class Encoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, decimal.Decimal):
retu... | from flask import Flask, url_for, request, redirect
from flask import render_template as render
from flask_mysqldb import MySQL
import yaml
import json
import MySQLdb
import decimal
class Encoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, decimal.Decimal):
return str(obj)
... | en | 0.547142 | # Setting up the flask instance # Configure the database # Initialise all tables CREATE TABLE IF NOT EXISTS products(prod_id integer primary key auto_increment, prod_name varchar(20) UNIQUE NOT NULL, prod_quantity integer not null, unallocated_quantity integer); # Might have to... | 2.877315 | 3 |
python/paddle/fluid/tests/unittests/ir/inference/test_trt_reduce_mean_op.py | zmxdream/Paddle | 8 | 1542 | <gh_stars>1-10
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | en | 0.856067 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli... | 1.851121 | 2 |
configs/vinbig/detectors_resnext.py | SeHwanJoo/mmdetection_vinbig | 2 | 1543 | _base_ = [
'../_base_/models/cascade_rcnn_r50_fpn.py',
'./dataset_base.py',
'./scheduler_base.py',
'../_base_/default_runtime.py'
]
model = dict(
pretrained='open-mmlab://resnext101_32x4d',
backbone=dict(
type='DetectoRS_ResNeXt',
pretrained='open-mmlab://resnext101_32x4d',
... | _base_ = [
'../_base_/models/cascade_rcnn_r50_fpn.py',
'./dataset_base.py',
'./scheduler_base.py',
'../_base_/default_runtime.py'
]
model = dict(
pretrained='open-mmlab://resnext101_32x4d',
backbone=dict(
type='DetectoRS_ResNeXt',
pretrained='open-mmlab://resnext101_32x4d',
... | none | 1 | 1.381269 | 1 | |
skbio/draw/tests/test_distributions.py | johnchase/scikit-bio | 0 | 1544 | <gh_stars>0
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------... | # ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | en | 0.809587 | # ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------------------------------... | 2.221271 | 2 |
packages/gtmapi/lmsrvcore/api/interfaces/__init__.py | jjwatts/gigantum-client | 60 | 1545 | <gh_stars>10-100
from lmsrvcore.api.interfaces.user import User
from lmsrvcore.api.interfaces.git import GitCommit, GitRef, GitRepository
| from lmsrvcore.api.interfaces.user import User
from lmsrvcore.api.interfaces.git import GitCommit, GitRef, GitRepository | none | 1 | 1.102599 | 1 | |
tensorflow_probability/python/bijectors/invert_test.py | matthieucoquet/probability | 0 | 1546 | # Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | # Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | en | 0.79885 | # Copyright 2018 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o... | 1.812566 | 2 |
dayu_widgets/alert.py | ZSD-tim/dayu_widgets | 0 | 1547 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###################################################################
# Author: <NAME>
# Date : 2019.2
# Email : <EMAIL>
###################################################################
"""
MAlert class.
"""
import six
import functools
from dayu_widgets.avatar import MAv... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###################################################################
# Author: <NAME>
# Date : 2019.2
# Email : <EMAIL>
###################################################################
"""
MAlert class.
"""
import six
import functools
from dayu_widgets.avatar import MAv... | en | 0.304806 | #!/usr/bin/env python # -*- coding: utf-8 -*- ################################################################### # Author: <NAME> # Date : 2019.2 # Email : <EMAIL> ################################################################### MAlert class. Alert component for feedback. Property: dayu_type: The feed... | 1.956609 | 2 |
week03/code05.py | byeongal/KMUCP | 0 | 1548 | <gh_stars>0
input_str = input("문자열을 입력해 주세요. >> ")
print("입력받은 문자열의 길이는", len(input_str), "입니다.")
| input_str = input("문자열을 입력해 주세요. >> ")
print("입력받은 문자열의 길이는", len(input_str), "입니다.") | none | 1 | 2.967627 | 3 | |
jobs/SCH/JB_SALES_HIERARCHY_FLAG_N_SR.py | bibinvasudev/EBI_Project | 0 | 1549 | <reponame>bibinvasudev/EBI_Project
# SCH1101.sh --> JB_SALES_HIERARCHY_FLAG_N_SR.py
#**************************************************************************************************************
#
# Created by : bibin
# Version : 1.0
#
# Description :
# 1. This script will load the data into 'S... | # SCH1101.sh --> JB_SALES_HIERARCHY_FLAG_N_SR.py
#**************************************************************************************************************
#
# Created by : bibin
# Version : 1.0
#
# Description :
# 1. This script will load the data into 'SALES_HIERARCHY' table based on stre... | en | 0.351381 | # SCH1101.sh --> JB_SALES_HIERARCHY_FLAG_N_SR.py #************************************************************************************************************** # # Created by : bibin # Version : 1.0 # # Description : # 1. This script will load the data into 'SALES_HIERARCHY' table based on stream... | 1.961382 | 2 |
myth/util.py | amanbhandari2002/mythproto | 1 | 1550 | def decodeLongLong(lst):
high = int(lst[0]) << 32
low = int(lst[1])
if low < 0:
low += 4294967296
if high < 0:
high += 4294967296
return high + low
def encodeLongLong(i):
high = int(i / 4294967296)
low = i - high
return high, low
def parseOk(str):
if str == 'ok':
return True
else:
return False
def ... | def decodeLongLong(lst):
high = int(lst[0]) << 32
low = int(lst[1])
if low < 0:
low += 4294967296
if high < 0:
high += 4294967296
return high + low
def encodeLongLong(i):
high = int(i / 4294967296)
low = i - high
return high, low
def parseOk(str):
if str == 'ok':
return True
else:
return False
def ... | en | 0.631423 | #for i in range(len(lst)): # print i, '\t', repr(lst[i]) # t is a nine item tuple returned by the time module. This method converts it to # MythTV's standard representation used on filenames | 3.184712 | 3 |
scripts/tator_tracker.py | openem-team/openem | 10 | 1551 | <reponame>openem-team/openem
#!/usr/bin/env python3
import argparse
import openem
import os
import cv2
import numpy as np
from openem.tracking import *
import json
import sys
import datetime
import tator
from pprint import pprint
from collections import defaultdict
import yaml
import math
import subprocess
import sy... | #!/usr/bin/env python3
import argparse
import openem
import os
import cv2
import numpy as np
from openem.tracking import *
import json
import sys
import datetime
import tator
from pprint import pprint
from collections import defaultdict
import yaml
import math
import subprocess
import sys
def crop_localization(fram... | en | 0.815725 | #!/usr/bin/env python3 # Weight methods # Weight methods that require the video #extractor=FeaturesExtractor(args.model_file) # Group by localizations by frame # If media does not exist, download it. # Unfrag the file # Not all visual methods need detection images # The method is analytical on the detections coordinate... | 2.174001 | 2 |
hypergan/losses/multi_loss.py | Darkar25/HyperGAN | 1 | 1552 | import tensorflow as tf
import numpy as np
import hyperchamber as hc
from hypergan.losses.base_loss import BaseLoss
from hypergan.multi_component import MultiComponent
TINY=1e-8
class MultiLoss(BaseLoss):
"""Takes multiple distributions and does an additional approximator"""
def _create(self, d_real, d_fake):... | import tensorflow as tf
import numpy as np
import hyperchamber as hc
from hypergan.losses.base_loss import BaseLoss
from hypergan.multi_component import MultiComponent
TINY=1e-8
class MultiLoss(BaseLoss):
"""Takes multiple distributions and does an additional approximator"""
def _create(self, d_real, d_fake):... | en | 0.897103 | Takes multiple distributions and does an additional approximator #relational layer? | 2.100052 | 2 |
src/fidesops/api/v1/endpoints/policy_endpoints.py | mohan-pogala/fidesops | 0 | 1553 | import logging
from typing import Any, Dict, List
from fastapi import APIRouter, Body, Depends, Security
from fastapi_pagination import (
Page,
Params,
)
from fastapi_pagination.bases import AbstractPage
from fastapi_pagination.ext.sqlalchemy import paginate
from fidesops.schemas.shared_schemas import FidesOp... | import logging
from typing import Any, Dict, List
from fastapi import APIRouter, Body, Depends, Security
from fastapi_pagination import (
Page,
Params,
)
from fastapi_pagination.bases import AbstractPage
from fastapi_pagination.ext.sqlalchemy import paginate
from fidesops.schemas.shared_schemas import FidesOp... | en | 0.695419 | Return a paginated list of all Policy records in this system Helper method to load Policy or throw a 404 Return a single Policy # type: ignore Given a list of policy data elements, create or update corresponding Policy objects or report failure # type: ignore Given a list of Rule data elements, create or update cor... | 1.827382 | 2 |
engage-analytics/sentiment_analysis/src/report/interface_report.py | oliveriopt/mood-analytics | 0 | 1554 | <gh_stars>0
import emoji
import sentiment_analysis.src.report.cons_report as cons
import sentiment_analysis.src.constants as global_cons
from utils.data_connection.api_data_manager import APISourcesFetcher
from utils.utilities import read_json_file, CUSTOM_YEAR_WEEK_AGG, extract_dimension, extract_question
from sentim... | import emoji
import sentiment_analysis.src.report.cons_report as cons
import sentiment_analysis.src.constants as global_cons
from utils.data_connection.api_data_manager import APISourcesFetcher
from utils.utilities import read_json_file, CUSTOM_YEAR_WEEK_AGG, extract_dimension, extract_question
from sentiment_analysis... | en | 0.843734 | Sort by dimension and by sentiment :return: Create array with the dictionary for interface :param features: list of features to extract :param company_week: company week of the company :return: Create array with the dictionary for interface - referenced to topic headlines :param ... | 2.242911 | 2 |
dwh_analytic/dags/data_warehouse_prod/schema/dim_process.py | dnguyenngoc/analytic | 0 | 1555 | resource ='human ad machime'
class DimProcess:
def __init__(
self,
*kwargs,
process_key: int,
module: str,
type: str,
step: str,
sub_step: str,
resource: str = 'human',
):
def step(self):
return ['qc', 'auto_qc', 'apr_qc', 'ke... | resource ='human ad machime'
class DimProcess:
def __init__(
self,
*kwargs,
process_key: int,
module: str,
type: str,
step: str,
sub_step: str,
resource: str = 'human',
):
def step(self):
return ['qc', 'auto_qc', 'apr_qc', 'ke... | none | 1 | 2.247243 | 2 | |
lino/modlib/gfks/mixins.py | NewRGB/lino | 1 | 1556 | # -*- coding: UTF-8 -*-
# Copyright 2010-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
from builtins import object
from django.contrib.contenttypes.models import *
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils.text import format_lazy
... | # -*- coding: UTF-8 -*-
# Copyright 2010-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
from builtins import object
from django.contrib.contenttypes.models import *
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils.text import format_lazy
... | en | 0.744346 | # -*- coding: UTF-8 -*- # Copyright 2010-2018 Rumma & Ko Ltd # License: BSD (see file COPYING for details) # Translators: will also be concatenated with '(type)' '(object)' | 2.072208 | 2 |
optical_form_reader/main.py | 1enes/optical_form_reader | 0 | 1557 | <filename>optical_form_reader/main.py<gh_stars>0
import cv2
import numpy as np
from imutils import contours
from imutils.perspective import four_point_transform
import imutils
import cv2
import matplotlib.pyplot as plt
import numpy as np
from imutils import contours
from imutils.perspective import four_point_t... | <filename>optical_form_reader/main.py<gh_stars>0
import cv2
import numpy as np
from imutils import contours
from imutils.perspective import four_point_transform
import imutils
import cv2
import matplotlib.pyplot as plt
import numpy as np
from imutils import contours
from imutils.perspective import four_point_t... | en | 0.214875 | #, #cv2.drawContours(isim,[box],0,(255,0,0),thickness=3) #cv2.drawContours(isim,[approx],0,(0,0,255),thickness=2) #cv2.drawContours(isim,[box],0,(255,0,0),thickness=3) #cv2.drawContours(isim,[approx],0,(0,0,255),thickness=2) #print(areas[0][0]) #cv2.drawContours(image,[approx],0,(0,255,0),thickness=3) #Tekrar var #thr6... | 2.192121 | 2 |
service.py | Tigge/script.filmtipset-grade | 1 | 1558 | # Copyright (c) 2013, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the foll... | # Copyright (c) 2013, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the foll... | en | 0.683519 | # Copyright (c) 2013, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the follow... | 1.63987 | 2 |
test/testMatrix.py | turkeydonkey/nzmath3 | 1 | 1559 | <reponame>turkeydonkey/nzmath3
import unittest
from nzmath.matrix import *
import nzmath.vector as vector
import nzmath.rational as rational
import nzmath.poly.uniutil as uniutil
Ra = rational.Rational
Poly = uniutil.polynomial
Int = rational.theIntegerRing
# sub test
try:
from test.testMatrixFiniteField import ... | import unittest
from nzmath.matrix import *
import nzmath.vector as vector
import nzmath.rational as rational
import nzmath.poly.uniutil as uniutil
Ra = rational.Rational
Poly = uniutil.polynomial
Int = rational.theIntegerRing
# sub test
try:
from test.testMatrixFiniteField import *
except:
try:
from ... | en | 0.591556 | # sub test ## for RingMatrix ## for RingSquareMatrix ## for FieldMatrix ## for FieldSquareMatrix ## other objects #zero test #sf.bug #1914349 # sf bug#1849220 unitMatrix() is an alias of one. # issubring # issuperring # getCommonSuperring | 2.442712 | 2 |
python/test-nose-3.py | li-ma/homework | 0 | 1560 | <gh_stars>0
# Module Level
def setUp():
print 'test setup'
def tearDown():
print 'test teardown'
# Function Level
def func_1_setup():
print 'test_func_1 setup'
def func_1_teardown():
print 'test_func_1_teardown'
# Target Func
def test_func_1():
print 'test_func_1 run'
assert True
test_func... | # Module Level
def setUp():
print 'test setup'
def tearDown():
print 'test teardown'
# Function Level
def func_1_setup():
print 'test_func_1 setup'
def func_1_teardown():
print 'test_func_1_teardown'
# Target Func
def test_func_1():
print 'test_func_1 run'
assert True
test_func_1.setUp = f... | en | 0.375623 | # Module Level # Function Level # Target Func | 2.259988 | 2 |
lib/reindex/reporting.py | scality/utapi | 13 | 1561 | import requests
import redis
import json
import ast
import sys
import time
import urllib
import re
import sys
from threading import Thread
from concurrent.futures import ThreadPoolExecutor
import argparse
def get_options():
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--sentinel-ip", default=... | import requests
import redis
import json
import ast
import sys
import time
import urllib
import re
import sys
from threading import Thread
from concurrent.futures import ThreadPoolExecutor
import argparse
def get_options():
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--sentinel-ip", default=... | none | 1 | 2.624429 | 3 | |
src/skim/modeling/skim_attention/modeling_skim.py | recitalAI/skim-attention | 4 | 1562 | <reponame>recitalAI/skim-attention<gh_stars>1-10
from collections import namedtuple
import logging
from dataclasses import dataclass
from typing import Optional, Tuple
import math
import torch
from torch import nn
from torch.nn import CrossEntropyLoss, LayerNorm
from torch.autograd.function import Function
from tran... | from collections import namedtuple
import logging
from dataclasses import dataclass
from typing import Optional, Tuple
import math
import torch
from torch import nn
from torch.nn import CrossEntropyLoss, LayerNorm
from torch.autograd.function import Function
from transformers.file_utils import (
ModelOutput,
)
... | en | 0.802294 | Construct the text embeddings from word and token_type embeddings. Construct sequential position embeddings. Construct the layout embeddings from the bounding box coordinates. Construct the embeddings from word, position and token_type embeddings. # project into same dimension as text embeddings # Take the dot product ... | 2.220608 | 2 |
api/routers/dashboard.py | xming521/coco_API | 0 | 1563 | import time
import psutil
import pymysql
from fastapi import APIRouter
from api.utils import response_code
router = APIRouter()
@router.get('/dashboard/getinfo')
def getinfo():
from init_global import g
res = {}
db = g.db_pool.connection()
cur = db.cursor()
cur.execute(f'select count(app_name) ... | import time
import psutil
import pymysql
from fastapi import APIRouter
from api.utils import response_code
router = APIRouter()
@router.get('/dashboard/getinfo')
def getinfo():
from init_global import g
res = {}
db = g.db_pool.connection()
cur = db.cursor()
cur.execute(f'select count(app_name) ... | zh | 0.831912 | # cpu # CPU核心 # 使用率 # CPU空余 # 内存 # 内存信息 # 总内存 # 已用内存 # 剩余内存 # 磁盘 # 总储存空间大小 # 已用 # 剩余 # print(res) | 2.232132 | 2 |
retargeting/models/Kinematics.py | yujiatay/deep-motion-editing | 1 | 1564 | import torch
import torch.nn as nn
import numpy as np
import math
class ForwardKinematics:
def __init__(self, args, edges):
self.topology = [-1] * (len(edges) + 1)
self.rotation_map = []
for i, edge in enumerate(edges):
self.topology[edge[1]] = edge[0]
self.rotation... | import torch
import torch.nn as nn
import numpy as np
import math
class ForwardKinematics:
def __init__(self, args, edges):
self.topology = [-1] * (len(edges) + 1)
self.rotation_map = []
for i, edge in enumerate(edges):
self.topology[edge[1]] = edge[0]
self.rotation... | en | 0.782967 | rotation should have shape batch_size * Joint_num * (3/4) * Time position should have shape batch_size * 3 * Time offset should have shape batch_size * Joint_num * 3 output have shape batch_size * Time * Joint_num * 3 #norm[norm < 1e-10] = 1 rotation should have shape batch_size * Joint_num * (3/4) * Time ... | 2.369217 | 2 |
tests/operators/test_hive_operator.py | Ryan-Miao/airflow | 0 | 1565 | <reponame>Ryan-Miao/airflow<gh_stars>0
# -*- coding: utf-8 -*-
#
# 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... | # -*- coding: utf-8 -*-
#
# 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
#... | en | 0.7677 | # -*- coding: utf-8 -*- # # 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 #... | 1.991881 | 2 |
main.py | OrionDark7/Alakajam12 | 0 | 1566 | import pygame, math
from game import map, ui
window = pygame.display.set_mode([800, 600])
ui.window = window
screen = "game"
s = {"fullscreen": False}
running = True
gamedata = {"level": 0, "coal": 0, "iron": 1, "copper":0}
tiles = pygame.sprite.Group()
rails = pygame.sprite.Group()
carts = pygame.sprite.Group()
inter... | import pygame, math
from game import map, ui
window = pygame.display.set_mode([800, 600])
ui.window = window
screen = "game"
s = {"fullscreen": False}
running = True
gamedata = {"level": 0, "coal": 0, "iron": 1, "copper":0}
tiles = pygame.sprite.Group()
rails = pygame.sprite.Group()
carts = pygame.sprite.Group()
inter... | none | 1 | 2.871568 | 3 | |
Code/extract_method3.py | AbdullahNoori/CS-2.1-Trees-Sorting | 0 | 1567 | <gh_stars>0
# Written by <NAME>
# Example for Compose Methods: Extract Method.
import math
def get_distance(xc1=5, xc2=7.25, yc1=22, yc2=-4.84):
# Calculate the distance between the two circle
return math.sqrt((xc1-xc2)**2 + (yc1 - yc2)**2)
print('distance', get_distance())
# *** somewhere else in your pr... | # Written by <NAME>
# Example for Compose Methods: Extract Method.
import math
def get_distance(xc1=5, xc2=7.25, yc1=22, yc2=-4.84):
# Calculate the distance between the two circle
return math.sqrt((xc1-xc2)**2 + (yc1 - yc2)**2)
print('distance', get_distance())
# *** somewhere else in your program ***
de... | en | 0.914007 | # Written by <NAME> # Example for Compose Methods: Extract Method. # Calculate the distance between the two circle # *** somewhere else in your program *** # calcualte the length of vector AB vector which is a vector between A and B points. | 3.713837 | 4 |
sympy/integrals/prde.py | Abhi58/sympy | 2 | 1568 | """
Algorithms for solving Parametric Risch Differential Equations.
The methods used for solving Parametric Risch Differential Equations parallel
those for solving Risch Differential Equations. See the outline in the
docstring of rde.py for more information.
The Parametric Risch Differential Equation problem is, giv... | """
Algorithms for solving Parametric Risch Differential Equations.
The methods used for solving Parametric Risch Differential Equations parallel
those for solving Risch Differential Equations. See the outline in the
docstring of rde.py for more information.
The Parametric Risch Differential Equation problem is, giv... | en | 0.855389 | Algorithms for solving Parametric Risch Differential Equations. The methods used for solving Parametric Risch Differential Equations parallel those for solving Risch Differential Equations. See the outline in the docstring of rde.py for more information. The Parametric Risch Differential Equation problem is, given f... | 3.020745 | 3 |
ssh_telnet/netmiko/ex07_netmiko_command_mult_prompts.py | levs72/pyneng-examples | 11 | 1569 | from pprint import pprint
import yaml
import netmiko
import paramiko
def send_cmd_with_prompt(device, command, *, wait_for, confirmation):
if type(wait_for) == str:
wait_for = [wait_for]
if type(confirmation) == str:
confirmation = [confirmation]
with netmiko.Netmiko(**device) as ssh:
... | from pprint import pprint
import yaml
import netmiko
import paramiko
def send_cmd_with_prompt(device, command, *, wait_for, confirmation):
if type(wait_for) == str:
wait_for = [wait_for]
if type(confirmation) == str:
confirmation = [confirmation]
with netmiko.Netmiko(**device) as ssh:
... | en | 0.54815 | R1#copy run start Destination filename [startup-config]? Building configuration... [OK] R1# | 2.84435 | 3 |
mppi/Utilities/AttributeDict.py | marcodalessandro76/MPPI | 1 | 1570 | <filename>mppi/Utilities/AttributeDict.py<gh_stars>1-10
class AttributeDict(object):
"""
A class to convert a nested Dictionary into an object with key-values
accessibly using attribute notation (AttributeDict.attribute) instead of
key notation (Dict["key"]). This class recursively sets Dicts to objects... | <filename>mppi/Utilities/AttributeDict.py<gh_stars>1-10
class AttributeDict(object):
"""
A class to convert a nested Dictionary into an object with key-values
accessibly using attribute notation (AttributeDict.attribute) instead of
key notation (Dict["key"]). This class recursively sets Dicts to objects... | en | 0.523369 | A class to convert a nested Dictionary into an object with key-values accessibly using attribute notation (AttributeDict.attribute) instead of key notation (Dict["key"]). This class recursively sets Dicts to objects, allowing you to recurse down nested dicts (like: AttributeDict.attr.attr) Return all the at... | 3.490646 | 3 |
LightTestLoop.py | Growing-Beyond-Earth/GettingStarted | 0 | 1571 | # GROWNG BEYOND EARTH CONTROL BOX Traning
# RASPBERRY PI PICO / MICROPYTHON
# FAIRCHILD TROPICAL BOTANIC GARDEN, Oct 18, 2021
# The Growing Beyond Earth (GBE) control box is a device that controls
# the LED lights and fan in a GBE growth chamber. It can also control
# accessories including a 12v water pump and enviro... | # GROWNG BEYOND EARTH CONTROL BOX Traning
# RASPBERRY PI PICO / MICROPYTHON
# FAIRCHILD TROPICAL BOTANIC GARDEN, Oct 18, 2021
# The Growing Beyond Earth (GBE) control box is a device that controls
# the LED lights and fan in a GBE growth chamber. It can also control
# accessories including a 12v water pump and enviro... | en | 0.823796 | # GROWNG BEYOND EARTH CONTROL BOX Traning # RASPBERRY PI PICO / MICROPYTHON # FAIRCHILD TROPICAL BOTANIC GARDEN, Oct 18, 2021 # The Growing Beyond Earth (GBE) control box is a device that controls # the LED lights and fan in a GBE growth chamber. It can also control # accessories including a 12v water pump and environm... | 3.441535 | 3 |
core/known_bugs_utils.py | nicolasbock/hotsos | 0 | 1572 | <gh_stars>0
import os
import yaml
from core import plugintools
from core import constants
from core.searchtools import SearchDef
from core.issues.issue_utils import IssueEntry
LAUNCHPAD = "launchpad"
MASTER_YAML_KNOWN_BUGS_KEY = "bugs-detected"
KNOWN_BUGS = {MASTER_YAML_KNOWN_BUGS_KEY: []}
class BugSearchDef(Search... | import os
import yaml
from core import plugintools
from core import constants
from core.searchtools import SearchDef
from core.issues.issue_utils import IssueEntry
LAUNCHPAD = "launchpad"
MASTER_YAML_KNOWN_BUGS_KEY = "bugs-detected"
KNOWN_BUGS = {MASTER_YAML_KNOWN_BUGS_KEY: []}
class BugSearchDef(SearchDef):
de... | en | 0.864657 | @param reason: string reason describing the issue and why it has been flagged. This string can be a template i.e. containing {} fields that can be rendered using results. @param reason_format_result_groups: if the reason string is a template, this is a list of indexes in the results that... | 2.340963 | 2 |
examples/xml-rpc/echoserver.py | keobox/yap101 | 0 | 1573 | import SimpleXMLRPCServer as xmls
def echo(msg):
print 'Got', msg
return msg
class echoserver(xmls.SimpleXMLRPCServer):
allow_reuse_address = True
server = echoserver(('127.0.0.1', 8001))
server.register_function(echo, 'echo')
print 'Listening on port 8001'
try:
server.serve_forever()
except:
ser... | import SimpleXMLRPCServer as xmls
def echo(msg):
print 'Got', msg
return msg
class echoserver(xmls.SimpleXMLRPCServer):
allow_reuse_address = True
server = echoserver(('127.0.0.1', 8001))
server.register_function(echo, 'echo')
print 'Listening on port 8001'
try:
server.serve_forever()
except:
ser... | none | 1 | 2.939568 | 3 | |
tf_pose/slim/nets/mobilenet/mobilenet_v2_test.py | gpspelle/pose-estimation | 862 | 1574 | # Copyright 2018 The TensorFlow 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 applica... | # Copyright 2018 The TensorFlow 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 applica... | en | 0.850496 | # Copyright 2018 The TensorFlow 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 applica... | 2.051281 | 2 |
firebase-gist.py | darwin/firebase-gist | 1 | 1575 | from firebase import firebase
import os
import datetime
import json
import logging
from boto.s3.connection import S3Connection
from boto.s3.key import Key
from github3 import login
firebase_url = os.environ['FIREBASE_DB']
firebase_secret = os.environ['FIREBASE_SECRET']
firebase_path = os.environ['FIREBASE_PATH']
fireb... | from firebase import firebase
import os
import datetime
import json
import logging
from boto.s3.connection import S3Connection
from boto.s3.key import Key
from github3 import login
firebase_url = os.environ['FIREBASE_DB']
firebase_secret = os.environ['FIREBASE_SECRET']
firebase_path = os.environ['FIREBASE_PATH']
fireb... | en | 0.828922 | # not checked ATM | 2.409693 | 2 |
practice/2008/qualification/C-Fly_swatter/c.py | victorWeiFreelancer/CodeJam | 0 | 1576 | import sys
sys.dont_write_bytecode = True
def hitP(f, R, t, r, g):
if f>=g/2 :
return 0.0
missArea = 0.0
gridL = g+2*r
nGrids = (R - t) // gridL
missGridSideLength = g - 2*f
print("gridL %.12f; nGrids %d" %(gridL, nGrids) )
indentSquareLength = nGrids*gridL
remain = (R - t) - in... | import sys
sys.dont_write_bytecode = True
def hitP(f, R, t, r, g):
if f>=g/2 :
return 0.0
missArea = 0.0
gridL = g+2*r
nGrids = (R - t) // gridL
missGridSideLength = g - 2*f
print("gridL %.12f; nGrids %d" %(gridL, nGrids) )
indentSquareLength = nGrids*gridL
remain = (R - t) - in... | ja | 0.205476 | #%d: %.6f" %(i+1, p)) | 2.930825 | 3 |
synapse/notifier.py | rkfg/synapse | 1 | 1577 | <gh_stars>1-10
# -*- coding: utf-8 -*-
# Copyright 2014 - 2016 OpenMarket 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 req... | # -*- coding: utf-8 -*-
# Copyright 2014 - 2016 OpenMarket 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 applic... | en | 0.917218 | # -*- coding: utf-8 -*- # Copyright 2014 - 2016 OpenMarket 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 applic... | 1.640752 | 2 |
saleor/checkout/tests/test_base_calculations.py | nestfiy/saleor | 0 | 1578 | <reponame>nestfiy/saleor<gh_stars>0
from decimal import Decimal
from prices import Money, TaxedMoney
from ...discount import DiscountValueType, VoucherType
from ...discount.utils import get_product_discount_on_sale
from ..base_calculations import (
base_checkout_total,
base_tax_rate,
calculate_base_line_t... | from decimal import Decimal
from prices import Money, TaxedMoney
from ...discount import DiscountValueType, VoucherType
from ...discount.utils import get_product_discount_on_sale
from ..base_calculations import (
base_checkout_total,
base_tax_rate,
calculate_base_line_total_price,
calculate_base_line_... | en | 0.477854 | # given # when # then # given # when # then # given # set category on sale # when # then # given # set category on sale # when # then # given # when # then # given # when # then # given # when # then # given # when # then # given # when # then # apply once per order is applied when calculating line total. # given # whe... | 2.451934 | 2 |
tests/test_date.py | andy-z/ged4py | 10 | 1579 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `ged4py.date` module."""
import unittest
from ged4py.calendar import (
CalendarType, CalendarDate, FrenchDate, GregorianDate, HebrewDate, JulianDate,
CalendarDateVisitor
)
from ged4py.date import (
DateValue, DateValueAbout, DateValueAfter, DateV... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `ged4py.date` module."""
import unittest
from ged4py.calendar import (
CalendarType, CalendarDate, FrenchDate, GregorianDate, HebrewDate, JulianDate,
CalendarDateVisitor
)
from ged4py.date import (
DateValue, DateValueAbout, DateValueAfter, DateV... | en | 0.602747 | #!/usr/bin/env python # -*- coding: utf-8 -*- Tests for `ged4py.date` module. Tests for `ged4py.date` module. Test date.CalendarDate class. Test date.CalendarDate class. Test date.CalendarDate class. # missing day compares as "past" the last day of month, but before next month # missing month compares as "past" the las... | 3.000899 | 3 |
src/quart/local.py | Dunkledore/quart | 3 | 1580 | <reponame>Dunkledore/quart<gh_stars>1-10
from __future__ import annotations
import asyncio
import copy
from contextvars import ContextVar # noqa # contextvars not understood as stdlib
from typing import Any # noqa # contextvars not understood as stdlib
from typing import Callable, Dict, Optional
class TaskLocal:
... | from __future__ import annotations
import asyncio
import copy
from contextvars import ContextVar # noqa # contextvars not understood as stdlib
from typing import Any # noqa # contextvars not understood as stdlib
from typing import Callable, Dict, Optional
class TaskLocal:
"""An object local to the current task... | en | 0.25552 | # noqa # contextvars not understood as stdlib # noqa # contextvars not understood as stdlib An object local to the current task. # Note as __setattr__ is overidden below, use the object __setattr__ Proxy to a task local object. # Note as __setattr__ is overidden below, use the object __setattr__ # type: ignore # noqa: ... | 2.54615 | 3 |
pytorch3dunet/unet3d/predictor.py | searobbersduck/pytorch-3dunet | 0 | 1581 | import time
import h5py
import hdbscan
import numpy as np
import torch
from sklearn.cluster import MeanShift
from pytorch3dunet.datasets.hdf5 import SliceBuilder
from pytorch3dunet.unet3d.utils import get_logger
from pytorch3dunet.unet3d.utils import unpad
logger = get_logger('UNet3DPredictor')
class _AbstractPred... | import time
import h5py
import hdbscan
import numpy as np
import torch
from sklearn.cluster import MeanShift
from pytorch3dunet.datasets.hdf5 import SliceBuilder
from pytorch3dunet.unet3d.utils import get_logger
from pytorch3dunet.unet3d.utils import unpad
logger = get_logger('UNet3DPredictor')
class _AbstractPred... | en | 0.761416 | # TODO: support multiple internal datasets Applies the model on the given dataset and saves the result in the `output_file` in the H5 format. Predictions from the network are kept in memory. If the results from the network don't fit in into RAM use `LazyPredictor` instead. The output dataset names inside t... | 2.317331 | 2 |
var/spack/repos/builtin/packages/visionary-dev-tools/package.py | electronicvisions/spack | 2 | 1582 | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os.path as osp
class VisionaryDevTools(Package):
"""Developer convenience packages common to all visionary
... | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os.path as osp
class VisionaryDevTools(Package):
"""Developer convenience packages common to all visionary
... | en | 0.798308 | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) Developer convenience packages common to all visionary development meta packages. Application specific build tools b... | 1.493602 | 1 |
extra/convertBAMtoPILFER.py | MartaLoBalastegui/XICRA | 3 | 1583 | #usr/bin/env python
## useful imports
import time
import io
import os
import re
import sys
from sys import argv
import subprocess
## ARGV
if len (sys.argv) < 5:
print ("\nUsage:")
print ("python3 %s bam_file folder bedtools_bin samtools_bin logfile\n" %os.path.realpath(__file__))
exit()
bam_file = os.path.abspath... | #usr/bin/env python
## useful imports
import time
import io
import os
import re
import sys
from sys import argv
import subprocess
## ARGV
if len (sys.argv) < 5:
print ("\nUsage:")
print ("python3 %s bam_file folder bedtools_bin samtools_bin logfile\n" %os.path.realpath(__file__))
exit()
bam_file = os.path.abspath... | en | 0.551833 | #usr/bin/env python ## useful imports ## ARGV # start ## Variables ## START ## generate bed file with bedtools bamtobed -i bam_file ## generate samtools ## generate paste filter tmp file ## paste Aligned.sortedByCoord.out.bed Aligned.sortedByCoord.out.sam | awk -v "OFS=\t" '{print $1, $2, $3, $16, $6}' ## parse pilfer ... | 2.414882 | 2 |
day7/main5list.py | nikhilsamninan/python-files | 0 | 1584 | a="<NAME>ought a butter the butter was bitter so betty bought a better butter which was not bitter"
v=[a[-1] for a in a.split() if(len(a)%2==0)]
print(v) | a="<NAME>ought a butter the butter was bitter so betty bought a better butter which was not bitter"
v=[a[-1] for a in a.split() if(len(a)%2==0)]
print(v) | none | 1 | 3.514898 | 4 | |
app/reader.py | lcarnevale/proxy-mqtt2influx | 0 | 1585 | <reponame>lcarnevale/proxy-mqtt2influx<filename>app/reader.py<gh_stars>0
# -*- coding: utf-8 -*-
#!/usr/bin/env python
"""Writer class based on InfluxDB
This implementation does its best to follow the Robert Martin's Clean code guidelines.
The comments follows the Google Python Style Guide:
https://github.com/goo... | # -*- coding: utf-8 -*-
#!/usr/bin/env python
"""Writer class based on InfluxDB
This implementation does its best to follow the Robert Martin's Clean code guidelines.
The comments follows the Google Python Style Guide:
https://github.com/google/styleguide/blob/gh-pages/pyguide.md
"""
__copyright__ = 'Copyright 2... | en | 0.721414 | # -*- coding: utf-8 -*- #!/usr/bin/env python Writer class based on InfluxDB This implementation does its best to follow the Robert Martin's Clean code guidelines. The comments follows the Google Python Style Guide: https://github.com/google/styleguide/blob/gh-pages/pyguide.md | 2.925602 | 3 |
example_problems/tutorial/tiling_mxn-boards_with_1x2-boards/services/tell_if_tilable/tell_if_tilable_server.py | DottaPaperella/TALight | 0 | 1586 | #!/usr/bin/env python3
from sys import stderr, exit, argv
from random import randrange
#from TALinputs import TALinput
from multilanguage import Env, Lang, TALcolors
# METADATA OF THIS TAL_SERVICE:
problem="tiling_mxn-boards_with_1x2-boards"
service="is_tilable"
args_list = [
('m',int),
('n',int),
('my_co... | #!/usr/bin/env python3
from sys import stderr, exit, argv
from random import randrange
#from TALinputs import TALinput
from multilanguage import Env, Lang, TALcolors
# METADATA OF THIS TAL_SERVICE:
problem="tiling_mxn-boards_with_1x2-boards"
service="is_tilable"
args_list = [
('m',int),
('n',int),
('my_co... | en | 0.283 | #!/usr/bin/env python3 #from TALinputs import TALinput # METADATA OF THIS TAL_SERVICE: # START CODING YOUR SERVICE: | 2.875973 | 3 |
tests/unit/peapods/runtimes/remote/ssh/test_ssh_remote.py | yk/jina | 1 | 1587 | import pytest
from jina.enums import RemoteAccessType
from jina.flow import Flow
from jina.parser import set_pea_parser, set_pod_parser
from jina.peapods.pods import BasePod
from jina.peapods.runtimes.remote.ssh import SSHRuntime
from jina.proto import jina_pb2
@pytest.mark.skip('works locally, but until I findout h... | import pytest
from jina.enums import RemoteAccessType
from jina.flow import Flow
from jina.parser import set_pea_parser, set_pod_parser
from jina.peapods.pods import BasePod
from jina.peapods.runtimes.remote.ssh import SSHRuntime
from jina.proto import jina_pb2
@pytest.mark.skip('works locally, but until I findout h... | none | 1 | 2.008578 | 2 | |
waio/factory/models/basic.py | dotX12/waio | 24 | 1588 | from dataclasses import dataclass
@dataclass
class PayloadSender:
phone: int
name: str
@dataclass
class PayloadBaseModel:
sender: PayloadSender
payload_id: str
| from dataclasses import dataclass
@dataclass
class PayloadSender:
phone: int
name: str
@dataclass
class PayloadBaseModel:
sender: PayloadSender
payload_id: str
| none | 1 | 2.168608 | 2 | |
Uber/validExpression.py | Nithanaroy/random_scripts | 0 | 1589 | def main(expr):
openingParams = '({['
closingParams = ')}]'
stack = []
for c in expr:
if c in openingParams:
stack.append(c)
elif c in closingParams:
topOfStack = stack.pop()
openingIndex = openingParams.find(topOfStack)
closingIndex = clos... | def main(expr):
openingParams = '({['
closingParams = ')}]'
stack = []
for c in expr:
if c in openingParams:
stack.append(c)
elif c in closingParams:
topOfStack = stack.pop()
openingIndex = openingParams.find(topOfStack)
closingIndex = clos... | none | 1 | 3.467826 | 3 | |
sgains/tool.py | KrasnitzLab/sgains | 1 | 1590 | import os
import sys
from copy import deepcopy
import traceback
import functools
from collections import defaultdict
import yaml
from argparse import ArgumentParser,\
RawDescriptionHelpFormatter, ArgumentDefaultsHelpFormatter
from sgains.configuration.parser import SgainsValidator, Config
from sgains.configurat... | import os
import sys
from copy import deepcopy
import traceback
import functools
from collections import defaultdict
import yaml
from argparse import ArgumentParser,\
RawDescriptionHelpFormatter, ArgumentDefaultsHelpFormatter
from sgains.configuration.parser import SgainsValidator, Config
from sgains.configurat... | none | 1 | 1.956951 | 2 | |
lib/modeling/VGG16.py | rsumner31/Detectron | 429 | 1591 | # Copyright (c) 2017-present, Facebook, Inc.
#
# 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... | # Copyright (c) 2017-present, Facebook, Inc.
#
# 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... | en | 0.737448 | # Copyright (c) 2017-present, Facebook, Inc. # # 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... | 1.693182 | 2 |
setup.py | yangjing1127/xmind2testcase | 537 | 1592 | #!/usr/env/bin python
# -*- coding: utf-8 -*-
import io
import os
import sys
from shutil import rmtree
from setuptools import setup, find_packages, Command
about = {}
here = os.path.abspath(os.path.dirname(__file__))
with io.open(os.path.join(here, 'xmind2testcase', '__about__.py'), encoding='utf-8') as f: # custom
... | #!/usr/env/bin python
# -*- coding: utf-8 -*-
import io
import os
import sys
from shutil import rmtree
from setuptools import setup, find_packages, Command
about = {}
here = os.path.abspath(os.path.dirname(__file__))
with io.open(os.path.join(here, 'xmind2testcase', '__about__.py'), encoding='utf-8') as f: # custom
... | en | 0.559966 | #!/usr/env/bin python # -*- coding: utf-8 -*- # custom # custom Build and publish this package and make a tag. Support: python setup.py pypi Copied from requests_html Prints things in green color. override override # custom # custom # custom # custom # custom # python3 setup.py pypi | 2.022453 | 2 |
skultrafast/styles.py | Tillsten/skultrafast | 10 | 1593 | <reponame>Tillsten/skultrafast
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 17 21:33:24 2015
@author: Tillsten
"""
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
tableau20 = [(31, 119, 180), (174, 199, 232), (255, 127, 14), (255, 187, 120),
(44, 160, 44), (152, 223, 138... | # -*- coding: utf-8 -*-
"""
Created on Thu Sep 17 21:33:24 2015
@author: Tillsten
"""
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
tableau20 = [(31, 119, 180), (174, 199, 232), (255, 127, 14), (255, 187, 120),
(44, 160, 44), (152, 223, 138), (214, 39, 40), (255, 152, 15... | en | 0.211172 | # -*- coding: utf-8 -*- Created on Thu Sep 17 21:33:24 2015
@author: Tillsten #plt.rcParams['savefig.dpi'] = 110 #plt.rcParams['font.family'] = 'Vera Sans' #*np.cos(x/0.05*(2*np.pi)) #l.set_clip_on(0) #plt.title("Hallo") #ax.plot(np.fft.fftfreq(x.size)[:y.size/2], abs(np.fft.fft(y))[:y.size/2]) #plt.grid(1, axis='y'... | 1.979656 | 2 |
src/oci/devops/models/github_build_run_source.py | ezequielramos/oci-python-sdk | 3 | 1594 | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | en | 0.732104 | # coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 2.028537 | 2 |
aiida_fleur/tests/tools/test_common_fleur_wf.py | anoopkcn/aiida-fleur | 0 | 1595 | <filename>aiida_fleur/tests/tools/test_common_fleur_wf.py<gh_stars>0
from __future__ import absolute_import
import pytest
import os
# is_code
def test_is_code_interface(fixture_code):
from aiida_fleur.tools.common_fleur_wf import is_code
assert is_code('random_string') is None
assert is_code('fleur.inpGU... | <filename>aiida_fleur/tests/tools/test_common_fleur_wf.py<gh_stars>0
from __future__ import absolute_import
import pytest
import os
# is_code
def test_is_code_interface(fixture_code):
from aiida_fleur.tools.common_fleur_wf import is_code
assert is_code('random_string') is None
assert is_code('fleur.inpGU... | en | 0.623858 | # is_code Tests if get_inputs_fleur assembles inputs correctly. Note it is the work of FleurCalculation to check if input types are correct i.e. 'code' is a Fleur code etc. Tests if get_inputs_fleur assembles inputs correctly. Note it is the work of FleurinputgenCalculation to check if input types are c... | 2.142015 | 2 |
src/probnum/random_variables/_random_variable.py | admdev8/probnum | 0 | 1596 | """
Random Variables.
This module implements random variables. Random variables are the main in- and outputs
of probabilistic numerical methods.
"""
from typing import Any, Callable, Dict, Generic, Optional, Tuple, TypeVar, Union
import numpy as np
from probnum import utils as _utils
from probnum.type import (
... | """
Random Variables.
This module implements random variables. Random variables are the main in- and outputs
of probabilistic numerical methods.
"""
from typing import Any, Callable, Dict, Generic, Optional, Tuple, TypeVar, Union
import numpy as np
from probnum import utils as _utils
from probnum.type import (
... | en | 0.709763 | Random Variables. This module implements random variables. Random variables are the main in- and outputs of probabilistic numerical methods. # functools.cached_property is only available in Python >=3.8 Random variables are the main objects used by probabilistic numerical methods. Every probabilistic numerical me... | 3.472448 | 3 |
platform/gcutil/lib/google_compute_engine/gcutil_lib/address_cmds_test.py | IsaacHuang/google-cloud-sdk | 0 | 1597 | # Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | en | 0.859311 | # Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a... | 2.162072 | 2 |
vote/migrations/0005_auto_20210204_1900.py | jnegrete2005/JuradoFMS | 2 | 1598 | <filename>vote/migrations/0005_auto_20210204_1900.py<gh_stars>1-10
# Generated by Django 3.1.5 on 2021-02-05 00:00
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('vote', '0004_auto_20210131_1621'),
]
operat... | <filename>vote/migrations/0005_auto_20210204_1900.py<gh_stars>1-10
# Generated by Django 3.1.5 on 2021-02-05 00:00
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('vote', '0004_auto_20210131_1621'),
]
operat... | en | 0.800347 | # Generated by Django 3.1.5 on 2021-02-05 00:00 | 1.364797 | 1 |
tools/wasm-sourcemap.py | ngzhian/emscripten | 1 | 1599 | #!/usr/bin/env python
# Copyright 2018 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
"""Utility tools that extracts DWARF informatio... | #!/usr/bin/env python
# Copyright 2018 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
"""Utility tools that extracts DWARF informatio... | en | 0.759015 | #!/usr/bin/env python # Copyright 2018 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. Utility tools that extracts DWARF information en... | 2.302353 | 2 |