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 |
|---|---|---|---|---|---|---|---|---|---|---|
tests/text_data_test.py | lalitaalaalitah/doc_curation | 0 | 6626451 | import os
from doc_curation import text_data
def test_get_subunit_list():
unit_info_file = os.path.join(os.path.dirname(text_data.__file__), "vedaH/vAjasaneyi/shatapatha.json")
assert text_data.get_subunit_list(json_file=unit_info_file, unit_path_list=[]) == range(1, 15)
assert text_data.get_subunit_list... | import os
from doc_curation import text_data
def test_get_subunit_list():
unit_info_file = os.path.join(os.path.dirname(text_data.__file__), "vedaH/vAjasaneyi/shatapatha.json")
assert text_data.get_subunit_list(json_file=unit_info_file, unit_path_list=[]) == range(1, 15)
assert text_data.get_subunit_list... | none | 1 | 2.416558 | 2 | |
holoviews/plotting/bokeh/annotation.py | TheoMathurin/holoviews | 304 | 6626452 | <filename>holoviews/plotting/bokeh/annotation.py
from collections import defaultdict
try:
from html import escape
except:
from cgi import escape
import param
import numpy as np
from bokeh.models import BoxAnnotation, Span, Arrow, Slope
from panel.models import HTML
try:
from bokeh.models.arrow_heads imp... | <filename>holoviews/plotting/bokeh/annotation.py
from collections import defaultdict
try:
from html import escape
except:
from cgi import escape
import param
import numpy as np
from bokeh.models import BoxAnnotation, Span, Arrow, Slope
from panel.models import HTML
try:
from bokeh.models.arrow_heads imp... | en | 0.799873 | Whether to show legend for the plot. Amount of offset to apply to labels along x-axis. Amount of offset to apply to labels along x-axis. # Deprecated options Deprecated in favor of color style mapping, e.g. `color=dim('color')` # If color dim is same as text dim, rename color column Whether to include the annotation in... | 2.238845 | 2 |
src/tensorseason/utils.py | canerturkmen/tensorseason | 0 | 6626453 | <gh_stars>0
import warnings
from typing import List
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import tensorly as tl
from gluonts.dataset.util import to_pandas
from gluonts.dataset.repository.datasets import get_dataset, dataset_recipes
from scipy import interpolate
from scipy.stats import ... | import warnings
from typing import List
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import tensorly as tl
from gluonts.dataset.util import to_pandas
from gluonts.dataset.repository.datasets import get_dataset, dataset_recipes
from scipy import interpolate
from scipy.stats import linregress
f... | en | 0.812562 | # introduce some utility functions fold first mode into n_p tubes # RMSEs with DCT # RMSEs with DFT # take the DCT # get the frequencies with most magnitude # zero out the other frequencies # reconstruct # take the DCT # get the frequencies with most magnitude # zero out the other frequencies # reconstruct # with tenso... | 2.276521 | 2 |
concurrency/test_charfinder.py | pythonfluente/example-code | 7 | 6626454 | <gh_stars>1-10
import pytest
from charfinder import UnicodeNameIndex, tokenize, sample_chars
from unicodedata import name
@pytest.fixture
def sample_index():
return UnicodeNameIndex(sample_chars)
@pytest.fixture(scope="module")
def full_index():
return UnicodeNameIndex()
def test_tokenize():
assert l... | import pytest
from charfinder import UnicodeNameIndex, tokenize, sample_chars
from unicodedata import name
@pytest.fixture
def sample_index():
return UnicodeNameIndex(sample_chars)
@pytest.fixture(scope="module")
def full_index():
return UnicodeNameIndex()
def test_tokenize():
assert list(tokenize(''... | none | 1 | 2.521135 | 3 | |
scripts/train.0527.py | cocoaaa/ReprLearn | 0 | 6626455 | """train.py
Train a single configuration of a model specified on a specified data
Required CLI args
-----------------
--model_name: "vae", "beta_vae", "iwae", "bivae"
--data_name: "mnist", "multi_rotated_mnist", "multi_mono_mnist",
"maptiles", "multi_maptiles"
--latent_dim: int, eg. 10
Opt... | """train.py
Train a single configuration of a model specified on a specified data
Required CLI args
-----------------
--model_name: "vae", "beta_vae", "iwae", "bivae"
--data_name: "mnist", "multi_rotated_mnist", "multi_mono_mnist",
"maptiles", "multi_maptiles"
--latent_dim: int, eg. 10
Opt... | en | 0.163929 | train.py Train a single configuration of a model specified on a specified data Required CLI args ----------------- --model_name: "vae", "beta_vae", "iwae", "bivae" --data_name: "mnist", "multi_rotated_mnist", "multi_mono_mnist", "maptiles", "multi_maptiles" --latent_dim: int, eg. 10 Option... | 2.384711 | 2 |
temp_prox/main_slide.py | sanweiliti/HMP | 92 | 6626456 | <filename>temp_prox/main_slide.py
# -*- coding: utf-8 -*-
# Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is
# holder of all proprietary rights on this computer program.
# You can only use this computer program if you have closed
# a license agreement with MPG or you get the right to use the comp... | <filename>temp_prox/main_slide.py
# -*- coding: utf-8 -*-
# Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is
# holder of all proprietary rights on this computer program.
# You can only use this computer program if you have closed
# a license agreement with MPG or you get the right to use the comp... | en | 0.482054 | # -*- coding: utf-8 -*- # Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is # holder of all proprietary rights on this computer program. # You can only use this computer program if you have closed # a license agreement with MPG or you get the right to use the computer # program from someone who is ... | 1.97214 | 2 |
.cloud-build/utils/util.py | nayaknishant/vertex-ai-samples | 0 | 6626457 | <reponame>nayaknishant/vertex-ai-samples
import os
import subprocess
import tarfile
import uuid
from datetime import datetime
from typing import Optional
from google.auth import credentials as auth_credentials
from google.cloud import storage
from google.cloud.aiplatform import utils
def download_file(bucket_name: s... | import os
import subprocess
import tarfile
import uuid
from datetime import datetime
from typing import Optional
from google.auth import credentials as auth_credentials
from google.cloud import storage
from google.cloud.aiplatform import utils
def download_file(bucket_name: str, blob_name: str, destination_file: str... | en | 0.755565 | Copies a remote GCS file to a local path Copies a local file to a GCS path # Archive all source in current directory # Upload archive to GCS bucket | 2.430555 | 2 |
venv/Scripts/django-admin.py | DavidWz0403/Challange | 0 | 6626458 | <filename>venv/Scripts/django-admin.py
#!c:\users\davidwz\desktop\challange\venv\scripts\python.exe
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| <filename>venv/Scripts/django-admin.py
#!c:\users\davidwz\desktop\challange\venv\scripts\python.exe
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| en | 0.285852 | #!c:\users\davidwz\desktop\challange\venv\scripts\python.exe | 1.105738 | 1 |
losses/utils.py | bunthet01/srl_zoo | 3 | 6626459 | try:
# absolute import
from pipeline import NO_PAIRS_ERROR
from utils import printRed
except:
# relative import
from ..pipeline import NO_PAIRS_ERROR
from ..utils import printRed
import torch as th
import numpy as np
def overSampling(batch_size, m_list, pairs, function_on_pairs, actions, rewa... | try:
# absolute import
from pipeline import NO_PAIRS_ERROR
from utils import printRed
except:
# relative import
from ..pipeline import NO_PAIRS_ERROR
from ..utils import printRed
import torch as th
import numpy as np
def overSampling(batch_size, m_list, pairs, function_on_pairs, actions, rewa... | en | 0.695197 | # absolute import # relative import Look for minibatches missing pairs of observations with the similar/dissimilar rewards (see params) Sample for each of those minibatches an observation from another batch that satisfies the similarity/dissimilarity with the 1rst observation. return the new pairs & the mod... | 2.231509 | 2 |
logic/list_operations.py | royhershkovitz/Sudoku-Solver | 0 | 6626460 | def diff(lst1: list, lst2: list):
return [value for value in lst1 if not value in lst2]
def intersection(lst1: list, *args):
lst1 = lst1
for lst2 in args:
lst1 = [value for value in lst1 if value in lst2]
return lst1
def intersection_list_organs(lst: list):
out = lst.pop(0)
for sub i... | def diff(lst1: list, lst2: list):
return [value for value in lst1 if not value in lst2]
def intersection(lst1: list, *args):
lst1 = lst1
for lst2 in args:
lst1 = [value for value in lst1 if value in lst2]
return lst1
def intersection_list_organs(lst: list):
out = lst.pop(0)
for sub i... | none | 1 | 3.696896 | 4 | |
setup.py | sigopt/sigopt_sklearn | 58 | 6626461 | <gh_stars>10-100
from setuptools import setup
from sigopt_sklearn.version import VERSION
# Keep this in sync with `requirements.txt` and the conda install process in `.travis.yml`!
install_requires = [
'joblib>=0.9.4',
'numpy>=1.9',
'scikit-learn>=0.19,<0.21',
'sigopt>=2.6.0',
]
setup(
name='sigopt_sklearn'... | from setuptools import setup
from sigopt_sklearn.version import VERSION
# Keep this in sync with `requirements.txt` and the conda install process in `.travis.yml`!
install_requires = [
'joblib>=0.9.4',
'numpy>=1.9',
'scikit-learn>=0.19,<0.21',
'sigopt>=2.6.0',
]
setup(
name='sigopt_sklearn',
version=VERSI... | en | 0.806751 | # Keep this in sync with `requirements.txt` and the conda install process in `.travis.yml`! | 1.23337 | 1 |
scripts/mix.py | jfajkowski/asr-utils | 0 | 6626462 | #!/usr/bin/python3
import argparse
import logging
import random
def parse_args():
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group(required=True)
parser.add_argument('-f', '--file', dest='files', action='append', nargs=2, metavar=('CORPUS', 'RATIO'), default=[])
group.ad... | #!/usr/bin/python3
import argparse
import logging
import random
def parse_args():
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group(required=True)
parser.add_argument('-f', '--file', dest='files', action='append', nargs=2, metavar=('CORPUS', 'RATIO'), default=[])
group.ad... | fr | 0.386793 | #!/usr/bin/python3 | 2.667698 | 3 |
common/src/stack/switch/pylib/switch/x1052.py | knutsonchris/stacki | 0 | 6626463 | <filename>common/src/stack/switch/pylib/switch/x1052.py<gh_stars>0
# Copyright (c) 2006 - 2017 Teradata
# All rights reserved. Stacki(r) v5.x stacki.com
# https://github.com/Teradata/stacki/blob/master/LICENSE.txt
# @copyright@
from . import Switch, SwitchException
import os
import time
import pexpect
class SwitchDe... | <filename>common/src/stack/switch/pylib/switch/x1052.py<gh_stars>0
# Copyright (c) 2006 - 2017 Teradata
# All rights reserved. Stacki(r) v5.x stacki.com
# https://github.com/Teradata/stacki/blob/master/LICENSE.txt
# @copyright@
from . import Switch, SwitchException
import os
import time
import pexpect
class SwitchDe... | en | 0.736133 | # Copyright (c) 2006 - 2017 Teradata # All rights reserved. Stacki(r) v5.x stacki.com # https://github.com/Teradata/stacki/blob/master/LICENSE.txt # @copyright@ Class for interfacing with a Dell x1052 switch. Connect to the switch # q will exit out of an existing scrollable more/less type of prompt # Probably not neces... | 2.227643 | 2 |
mysql/pythob_mysql6.py | MiracleWong/PythonBasic | 0 | 6626464 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
# 对数据库的删除操作
import MySQLdb
# 打开数据库连接
conn = MySQLdb.connect("localhost", "root", "<PASSWORD>", "crm")
# 使用cursor()方法获取操作游标
cursor = conn.cursor()
# SQL 更新语句
sql = "DELETE FROM EMPLOYEE WHERE AGE = '%d'" % (21)
#sql = "DELETE FROM EMPLOYEE WHERE AGE > '%d'" % (21)
try:... | #!/usr/bin/python
# -*- coding: UTF-8 -*-
# 对数据库的删除操作
import MySQLdb
# 打开数据库连接
conn = MySQLdb.connect("localhost", "root", "<PASSWORD>", "crm")
# 使用cursor()方法获取操作游标
cursor = conn.cursor()
# SQL 更新语句
sql = "DELETE FROM EMPLOYEE WHERE AGE = '%d'" % (21)
#sql = "DELETE FROM EMPLOYEE WHERE AGE > '%d'" % (21)
try:... | zh | 0.7843 | #!/usr/bin/python # -*- coding: UTF-8 -*- # 对数据库的删除操作 # 打开数据库连接 # 使用cursor()方法获取操作游标 # SQL 更新语句 #sql = "DELETE FROM EMPLOYEE WHERE AGE > '%d'" % (21) # 执行SQL语句 # 提交到数据库执行 # 发生错误时进行回滚 # 关闭数据库连接 | 3.412014 | 3 |
setup.py | safetydave/open-spacial-may | 0 | 6626465 | from setuptools import setup, find_packages
setup(name='ospacial',
version='0.1',
description='Solution to Open-Spacial Shokunin Challenge',
url='https://github.com/safetydave/open-spacial',
author='<NAME>',
author_email='<EMAIL>',
license='MIT',
python_requires='>=3.6.0',
... | from setuptools import setup, find_packages
setup(name='ospacial',
version='0.1',
description='Solution to Open-Spacial Shokunin Challenge',
url='https://github.com/safetydave/open-spacial',
author='<NAME>',
author_email='<EMAIL>',
license='MIT',
python_requires='>=3.6.0',
... | none | 1 | 1.180388 | 1 | |
svhn 64x64/mainmodel1_6layers_copy.py | vrishabh22/OCR-Minor-Project | 0 | 6626466 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import h5py
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
import time
import os
from datetime import timedelta
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '1'
plt.rcParams['figure.figsiz... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import h5py
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
import time
import os
from datetime import timedelta
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '1'
plt.rcParams['figure.figsiz... | en | 0.284126 | #--------------------------------------MAIN MODEL---------------------------------- # optimizer = tf.train.RMSPropOptimizer(learning_rate).minimize(loss, global_step=global_step) # for i in range(10): # print(i) | 2.202191 | 2 |
release/stubs.min/System/Diagnostics/__init___parts/EventLogEntry.py | htlcnn/ironpython-stubs | 182 | 6626467 | class EventLogEntry(Component,IComponent,IDisposable,ISerializable):
""" Encapsulates a single record in the event log. This class cannot be inherited. """
def Dispose(self):
"""
Dispose(self: Component,disposing: bool)
Releases the unmanaged resources used by the System.ComponentModel.Component and opt... | class EventLogEntry(Component,IComponent,IDisposable,ISerializable):
""" Encapsulates a single record in the event log. This class cannot be inherited. """
def Dispose(self):
"""
Dispose(self: Component,disposing: bool)
Releases the unmanaged resources used by the System.ComponentModel.Component and opt... | en | 0.764724 | Encapsulates a single record in the event log. This class cannot be inherited. Dispose(self: Component,disposing: bool)
Releases the unmanaged resources used by the System.ComponentModel.Component and optionally
releases the managed resources.
disposing: true to release both managed and ... | 2.116007 | 2 |
setup.py | datalexum/UNIX-time-from-NTP | 1 | 6626468 | <gh_stars>1-10
from setuptools import setup, find_packages
from io import open
from os import path
import pathlib
HERE = pathlib.Path(__file__).parent
README = (HERE / "README.md").read_text()
with open(path.join(HERE, 'requirements.txt'), encoding='utf-8') as f:
all_reqs = f.read().split('\n')
install_requires = ... | from setuptools import setup, find_packages
from io import open
from os import path
import pathlib
HERE = pathlib.Path(__file__).parent
README = (HERE / "README.md").read_text()
with open(path.join(HERE, 'requirements.txt'), encoding='utf-8') as f:
all_reqs = f.read().split('\n')
install_requires = [x.strip() for ... | en | 0.220645 | [console_scripts] utfn=utfn.__main__:main | 1.678683 | 2 |
src/fedex_python/examples/unitary_schemas/generate_schemas_modules.py | h4ck3rm1k3/stepcode | 1 | 6626469 | __doc__= ''' This script runs fedex_python over each EXPRESS schema in the test/unitary_schemas folder'''
unitary_schemas_path = '../../../../test/unitary_schemas'
fedex_python_path = '../../../../cmake-build/bin/fedex_python'
import subprocess
import glob
import os
unitary_schemas = glob.glob(os.path.join(unitary_s... | __doc__= ''' This script runs fedex_python over each EXPRESS schema in the test/unitary_schemas folder'''
unitary_schemas_path = '../../../../test/unitary_schemas'
fedex_python_path = '../../../../cmake-build/bin/fedex_python'
import subprocess
import glob
import os
unitary_schemas = glob.glob(os.path.join(unitary_s... | en | 0.702431 | This script runs fedex_python over each EXPRESS schema in the test/unitary_schemas folder | 1.831335 | 2 |
iniParser/iniparser.py | MDGSF/PythonPractice | 1 | 6626470 | <reponame>MDGSF/PythonPractice<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Author: <NAME>
Date: 2019-04-22
Module IniParser implements an *.ini parser.
"""
DefaultSectionName = 'default'
class Node:
def __init__(self, key, value):
self.key = key
self.value = value
class Sec... | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Author: <NAME>
Date: 2019-04-22
Module IniParser implements an *.ini parser.
"""
DefaultSectionName = 'default'
class Node:
def __init__(self, key, value):
self.key = key
self.value = value
class Section:
def __init__(self, name=DefaultSect... | en | 0.581209 | #!/usr/bin/env python # -*- coding: UTF-8 -*- Author: <NAME> Date: 2019-04-22 Module IniParser implements an *.ini parser. Get value with item(key). If key already exists, update key=value. If key not exists, set new key=value. Check key whether is exists in this section. Remove key in this section. IniParser ... | 2.876364 | 3 |
Pygame/Game/study/hellouglyworld.py | danghohuuphuc/Code_Python | 0 | 6626471 | <gh_stars>0
import pygame, sys
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((800, 600))
iconpikachu = pygame.image.load("pikachu.png")
pygame.display.set_icon(iconpikachu)
pygame.display.set_caption("Hello Ugly World")
WHITE = (255, 255, 255)
GREEN = (0, 255, 0)
BLUE = (0, 0, 128)
font... | import pygame, sys
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((800, 600))
iconpikachu = pygame.image.load("pikachu.png")
pygame.display.set_icon(iconpikachu)
pygame.display.set_caption("Hello Ugly World")
WHITE = (255, 255, 255)
GREEN = (0, 255, 0)
BLUE = (0, 0, 128)
fontObj = pygame... | en | 0.833005 | # the main game loop | 3.26503 | 3 |
layer.py | unionsetde/ToyNN | 0 | 6626472 | <reponame>unionsetde/ToyNN
import numpy
import pickle
class fully_connected_layer:
def __init__(self, num_of_input, num_of_output, w, b):
self.input_size = num_of_input
self.output_size = num_of_output
self.weights = numpy.random.randn(self.output_size, self.input_size)
self.bias = ... | import numpy
import pickle
class fully_connected_layer:
def __init__(self, num_of_input, num_of_output, w, b):
self.input_size = num_of_input
self.output_size = num_of_output
self.weights = numpy.random.randn(self.output_size, self.input_size)
self.bias = numpy.zeros(self.output_siz... | en | 0.673012 | # silding-window 2D convolution # leaky ReLU activation # scalar value # record the activation position of the sub-input # output is 1-D array | 2.813833 | 3 |
src/sos/monitor.py | BoPeng/sos | 0 | 6626473 | <filename>src/sos/monitor.py
#!/usr/bin/env python3
#
# Copyright (c) <NAME> and the University of Texas MD Anderson Cancer Center
# Distributed under the terms of the 3-clause BSD License.
import os
import stat
import threading
import time
import psutil
from .tasks import TaskFile
from .utils import env, expand_time... | <filename>src/sos/monitor.py
#!/usr/bin/env python3
#
# Copyright (c) <NAME> and the University of Texas MD Anderson Cancer Center
# Distributed under the terms of the 3-clause BSD License.
import os
import stat
import threading
import time
import psutil
from .tasks import TaskFile
from .utils import env, expand_time... | en | 0.853951 | #!/usr/bin/env python3 # # Copyright (c) <NAME> and the University of Texas MD Anderson Cancer Center # Distributed under the terms of the 3-clause BSD License. # # # remove previous status file, which could be readonly if the job is killed # kill the task # the job should be removed # the job should be killed # mark t... | 2.205157 | 2 |
Sketches/RJL/bittorrent/BitTorrent/launchmany-curses.py | sparkslabs/kamaelia_orig | 12 | 6626474 | <filename>Sketches/RJL/bittorrent/BitTorrent/launchmany-curses.py
#!/usr/bin/env python
# The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
... | <filename>Sketches/RJL/bittorrent/BitTorrent/launchmany-curses.py
#!/usr/bin/env python
# The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
... | en | 0.783175 | #!/usr/bin/env python # The contents of this file are subject to the BitTorrent Open Source License # Version 1.1 (the License). You may not copy or use this file, in either # source code or executable form, except in compliance with the License. You # may obtain a copy of the License at http://www.bittorrent.com/lic... | 2.140018 | 2 |
models/__init__.py | EmanuelNk/semantic-segmentation | 0 | 6626475 | <filename>models/__init__.py<gh_stars>0
from .segformer import SegFormer
from .custom_cnn import CustomCNN
from .custom_vit import CustomVIT
from .ddrnet import DDRNet
__all__ = {
'customcnn': CustomCNN,
'customvit': CustomVIT,
'segformer': SegFormer,
'ddrnet': DDRNet,
}
def get_model(model_name: str,... | <filename>models/__init__.py<gh_stars>0
from .segformer import SegFormer
from .custom_cnn import CustomCNN
from .custom_vit import CustomVIT
from .ddrnet import DDRNet
__all__ = {
'customcnn': CustomCNN,
'customvit': CustomVIT,
'segformer': SegFormer,
'ddrnet': DDRNet,
}
def get_model(model_name: str,... | none | 1 | 2.178869 | 2 | |
pynfact/__main__.py | jacorbal/pynfact | 0 | 6626476 | <filename>pynfact/__main__.py<gh_stars>0
#!/usr/bin/env python3
# vim: set ft=python fileencoding=utf-8 tw=72:
r"""
A blog-oriented static web content generator.
* Input formats: Markdown and reStructuredText
* Output format: HTML5.
:author: \<NAME>
:email: <EMAIL>
:copyright: © 2012-2020, <NAME>
:license: MIT
"""
fr... | <filename>pynfact/__main__.py<gh_stars>0
#!/usr/bin/env python3
# vim: set ft=python fileencoding=utf-8 tw=72:
r"""
A blog-oriented static web content generator.
* Input formats: Markdown and reStructuredText
* Output format: HTML5.
:author: \<NAME>
:email: <EMAIL>
:copyright: © 2012-2020, <NAME>
:license: MIT
"""
fr... | en | 0.338002 | #!/usr/bin/env python3 # vim: set ft=python fileencoding=utf-8 tw=72: A blog-oriented static web content generator. * Input formats: Markdown and reStructuredText * Output format: HTML5. :author: \<NAME> :email: <EMAIL> :copyright: © 2012-2020, <NAME> :license: MIT | 1.337388 | 1 |
nuitka/nodes/FrameNodes.py | em3ndez/Nuitka | 1 | 6626477 | # Copyright 2020, <NAME>, mailto:<EMAIL>
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | # Copyright 2020, <NAME>, mailto:<EMAIL>
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | en | 0.907439 | # Copyright 2020, <NAME>, mailto:<EMAIL> # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice... | 2.036582 | 2 |
FaceClassify/nets/ResNets.py | CharlesPikachu/CharlesFace | 13 | 6626478 | # Author:
# Charlse
# Function:
# ResNet(in torchvision):
# resnet18, resnet34, resnet50, resnet101, resnet152.
import torch
import math
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as models
from torch.autograd import Variable
# Parameters Explain:
# is_fc: ... | # Author:
# Charlse
# Function:
# ResNet(in torchvision):
# resnet18, resnet34, resnet50, resnet101, resnet152.
import torch
import math
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as models
from torch.autograd import Variable
# Parameters Explain:
# is_fc: ... | en | 0.821441 | # Author: # Charlse # Function: # ResNet(in torchvision): # resnet18, resnet34, resnet50, resnet101, resnet152. # Parameters Explain: # is_fc: # True: use fully connected layer to get feature vector. # False: don't use fully connected layer to get feature vector. # is_AvgPool: # True: use AvgPool. # False... | 2.648444 | 3 |
filip/ocb/orion.py | N5GEH/n5geh.tools.FiLiP | 1 | 6626479 | <reponame>N5GEH/n5geh.tools.FiLiP
import json
import requests
from filip.utils import request_utils as requtils
from filip.testing import test
import math
import logging
logger = logging.getLogger('ocb')
# ToDo Query params
# Class is only implemented for backward compatibility
class Attribute:
"""
Describe... | import json
import requests
from filip.utils import request_utils as requtils
from filip.testing import test
import math
import logging
logger = logging.getLogger('ocb')
# ToDo Query params
# Class is only implemented for backward compatibility
class Attribute:
"""
Describes the attribute of an entity.
... | en | 0.742337 | # ToDo Query params # Class is only implemented for backward compatibility Describes the attribute of an entity. :param entity_dict: A dictionarry describing the entity Needed Structure: { "id" : "Sensor002", "type": "temperature_Sensor", "Temperature" : ... | 3.098836 | 3 |
auth0/v3/test/authentication/test_passwordless.py | santiagoroman/auth0-python | 0 | 6626480 | import unittest
import mock
from ...authentication.passwordless import Passwordless
class TestPasswordless(unittest.TestCase):
@mock.patch('auth0.v3.authentication.passwordless.Passwordless.post')
def test_email(self, mock_post):
p = Passwordless('my.domain.com')
p.email(client_id='cid',
... | import unittest
import mock
from ...authentication.passwordless import Passwordless
class TestPasswordless(unittest.TestCase):
@mock.patch('auth0.v3.authentication.passwordless.Passwordless.post')
def test_email(self, mock_post):
p = Passwordless('my.domain.com')
p.email(client_id='cid',
... | none | 1 | 2.760054 | 3 | |
setup.py | shiquanwang/numba | 1 | 6626481 | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
import os
import sys
import shutil
import subprocess
from fnmatch import fnmatchcase
from distutils.util import convert_path
# Do not EVER use setuptools, it makes cythonization fail
# Distribute fixes that
from distutils.core imp... | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
import os
import sys
import shutil
import subprocess
from fnmatch import fnmatchcase
from distutils.util import convert_path
# Do not EVER use setuptools, it makes cythonization fail
# Distribute fixes that
from distutils.core imp... | en | 0.178306 | # -*- coding: utf-8 -*- # Do not EVER use setuptools, it makes cythonization fail # Distribute fixes that # import numba #------------------------------------------------------------------------ # Setup constants and arguments #------------------------------------------------------------------------ Use numba.get_inclu... | 1.83153 | 2 |
torch_geometric/loader/utils.py | lightaime/pytorch_geometric | 1 | 6626482 | <reponame>lightaime/pytorch_geometric<filename>torch_geometric/loader/utils.py
import copy
import math
from typing import Dict, Optional, Tuple, Union
import torch
from torch import Tensor
from torch_sparse import SparseTensor
from torch_geometric.data import Data, HeteroData
from torch_geometric.data.storage import ... | import copy
import math
from typing import Dict, Optional, Tuple, Union
import torch
from torch import Tensor
from torch_sparse import SparseTensor
from torch_geometric.data import Data, HeteroData
from torch_geometric.data.storage import EdgeStorage, NodeStorage
from torch_geometric.typing import EdgeType, OptTensor... | en | 0.857121 | # If we are in a background process, we write directly into a shared # memory tensor to avoid an extra copy: # Since C++ cannot take dictionaries with tuples as key as input, edge type # triplets need to be converted into single strings. # Convert the graph data into a suitable format for sampling (CSC format). # Retur... | 2.194793 | 2 |
tests/http_client_test.py | dnephin/swagger-py | 0 | 6626483 | # -*- coding: utf-8 -*-
import base64
import unittest
import httpretty
import mock
import pytest
import requests
from swaggerpy.http_client import (
SynchronousHttpClient,
SynchronousEventual,
)
class SynchronousClientTestCase(unittest.TestCase):
def _default_params(self):
return {
... | # -*- coding: utf-8 -*-
import base64
import unittest
import httpretty
import mock
import pytest
import requests
from swaggerpy.http_client import (
SynchronousHttpClient,
SynchronousEventual,
)
class SynchronousClientTestCase(unittest.TestCase):
def _default_params(self):
return {
... | en | 0.893052 | # -*- coding: utf-8 -*- # no-op cancel, test that is supports the interface | 2.263396 | 2 |
modules/emoji_utils.py | Ghost-Proxy/Voluspa | 0 | 6626484 | from emoji import emojize
def ri_alphabet(n):
if n < 1:
n = 1
elif n > 26:
n = 26
current_emoji = '\U0001f1e6' # Regional Indicator A
i = 0
while i < n:
yield current_emoji
current_emoji = chr(ord(current_emoji) + 1)
i += 1
def ri_at_index(i):
if i < 0... | from emoji import emojize
def ri_alphabet(n):
if n < 1:
n = 1
elif n > 26:
n = 26
current_emoji = '\U0001f1e6' # Regional Indicator A
i = 0
while i < n:
yield current_emoji
current_emoji = chr(ord(current_emoji) + 1)
i += 1
def ri_at_index(i):
if i < 0... | en | 0.482499 | # Regional Indicator A | 3.417673 | 3 |
training/coach.py | maltetoelle/pixel2style2pixel | 0 | 6626485 | import os
import matplotlib
import matplotlib.pyplot as plt
matplotlib.use('Agg')
import torch
from torch import nn
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
import torch.nn.functional as F
from utils import common, train_utils
from criteria import id_loss... | import os
import matplotlib
import matplotlib.pyplot as plt
matplotlib.use('Agg')
import torch
from torch import nn
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
import torch.nn.functional as F
from utils import common, train_utils
from criteria import id_loss... | en | 0.66334 | # TODO: Allow multiple GPU? currently using CUDA_VISIBLE_DEVICES # Initialize network # Estimate latent_avg via dense sampling if latent_avg is not available # Initialize loss # Initialize optimizer # Initialize dataset # Initialize logger # Initialize checkpoint dir # Logging related # Log images of first batch to wan... | 1.889022 | 2 |
dbops_venv/lib/python3.5/site-packages/alembic/config.py | fractal520/dbops | 15 | 6626486 | from argparse import ArgumentParser
from .compat import SafeConfigParser
import inspect
import os
import sys
from . import command, util, package_dir, compat
class Config(object):
"""Represent an Alembic configuration.
Within an ``env.py`` script, this is available
via the :attr:`.EnvironmentContext.conf... | from argparse import ArgumentParser
from .compat import SafeConfigParser
import inspect
import os
import sys
from . import command, util, package_dir, compat
class Config(object):
"""Represent an Alembic configuration.
Within an ``env.py`` script, this is available
via the :attr:`.EnvironmentContext.conf... | en | 0.659824 | Represent an Alembic configuration. Within an ``env.py`` script, this is available via the :attr:`.EnvironmentContext.config` attribute, which in turn is available at ``alembic.context``:: from alembic import context some_param = context.config.get_main_option("my option") When invok... | 2.858855 | 3 |
djangoProject1/polls/views/details_note.py | Pavel-Petkov03/djangoFirstProject | 1 | 6626487 | <reponame>Pavel-Petkov03/djangoFirstProject
from django.shortcuts import render
from django.views import View
from djangoProject1.polls.models import Note
class DetailsView(View):
def get(self, req, pk):
current_note = Note.objects.get(id=pk)
return render(req, "note-details.html", {"not... | from django.shortcuts import render
from django.views import View
from djangoProject1.polls.models import Note
class DetailsView(View):
def get(self, req, pk):
current_note = Note.objects.get(id=pk)
return render(req, "note-details.html", {"note": current_note}) | none | 1 | 1.850647 | 2 | |
moe/tests/bandit/bandit_test_case.py | mikepsinn/MOE | 0 | 6626488 | <filename>moe/tests/bandit/bandit_test_case.py
# -*- coding: utf-8 -*-
"""Base test case class for bandit tests; includes different historical infos (different sampled arms)."""
import testify as T
from moe.bandit.data_containers import BernoulliArm, HistoricalData, SampleArm
class BanditTestCase(T.TestCase):
"... | <filename>moe/tests/bandit/bandit_test_case.py
# -*- coding: utf-8 -*-
"""Base test case class for bandit tests; includes different historical infos (different sampled arms)."""
import testify as T
from moe.bandit.data_containers import BernoulliArm, HistoricalData, SampleArm
class BanditTestCase(T.TestCase):
"... | en | 0.826482 | # -*- coding: utf-8 -*- Base test case class for bandit tests; includes different historical infos (different sampled arms). Base test case for the bandit library. This sets up arms for test cases and includes an integration test case for verifying that default values do not throw an error. # Define in a subcl... | 2.741557 | 3 |
NDS/model/_model.py | lincis/ObsDataRest | 0 | 6626489 | <filename>NDS/model/_model.py
from werkzeug.security import generate_password_hash, check_password_hash
from ..database import db
class UserModel(db.Model):
__tablename__ = 'user'
id = db.Column(db.Integer, primary_key = True)
username = db.Column(db.String(80), unique = True, nullable = False)
passwor... | <filename>NDS/model/_model.py
from werkzeug.security import generate_password_hash, check_password_hash
from ..database import db
class UserModel(db.Model):
__tablename__ = 'user'
id = db.Column(db.Integer, primary_key = True)
username = db.Column(db.String(80), unique = True, nullable = False)
passwor... | none | 1 | 2.638135 | 3 | |
lambda/prediction-lambda/handler/technical_indicators.py | CheranMahalingam/Forex_Sentiment_Analysis | 6 | 6626490 | <filename>lambda/prediction-lambda/handler/technical_indicators.py
"""
Module generates technical indicator data such as exponential moving averages,
and accumulation/distribution lines to help LSTM model generate accurate predictions
"""
import boto3
from boto3.dynamodb.conditions import Key
import datetime
# LSTM m... | <filename>lambda/prediction-lambda/handler/technical_indicators.py
"""
Module generates technical indicator data such as exponential moving averages,
and accumulation/distribution lines to help LSTM model generate accurate predictions
"""
import boto3
from boto3.dynamodb.conditions import Key
import datetime
# LSTM m... | en | 0.833028 | Module generates technical indicator data such as exponential moving averages, and accumulation/distribution lines to help LSTM model generate accurate predictions # LSTM models only supported for these currency pairs for now Controller function for calculating new economic indicator data. Args: new_ohlc_d... | 2.231987 | 2 |
star_13.py | onesk/aoc2017 | 0 | 6626491 | data = """
0: 3
1: 2
4: 4
6: 4
"""
from star_13_input import data
fw = []
for line in data.strip().split('\n'):
d_s, r_s = line.split(': ')
d, r = int(d_s), int(r_s)
fw.append((d, r))
max_d = max(fw)[0]
ranges = [None] * (max_d + 1)
for d, r in fw:
ranges[d] = r
# read before coding next time
def wr... | data = """
0: 3
1: 2
4: 4
6: 4
"""
from star_13_input import data
fw = []
for line in data.strip().split('\n'):
d_s, r_s = line.split(': ')
d, r = int(d_s), int(r_s)
fw.append((d, r))
max_d = max(fw)[0]
ranges = [None] * (max_d + 1)
for d, r in fw:
ranges[d] = r
# read before coding next time
def wr... | en | 0.817887 | 0: 3 1: 2 4: 4 6: 4 # read before coding next time | 2.63571 | 3 |
examples/klvdata_test.py | felipeservicos/klvdata | 0 | 6626492 | #!/usr/bin/env python
import sys, klvdata;
for packet in klvdata.StreamParser(sys.stdin.buffer.read()): packet.structure()
| #!/usr/bin/env python
import sys, klvdata;
for packet in klvdata.StreamParser(sys.stdin.buffer.read()): packet.structure()
| ru | 0.26433 | #!/usr/bin/env python | 2.245632 | 2 |
grr/server/grr_response_server/data_stores/mysql_advanced_data_store_benchmark_test.py | 4ndygu/grr | 0 | 6626493 | <filename>grr/server/grr_response_server/data_stores/mysql_advanced_data_store_benchmark_test.py
#!/usr/bin/env python
"""Benchmark tests for MySQL advanced data store."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from grr_response_core.lib import f... | <filename>grr/server/grr_response_server/data_stores/mysql_advanced_data_store_benchmark_test.py
#!/usr/bin/env python
"""Benchmark tests for MySQL advanced data store."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from grr_response_core.lib import f... | en | 0.435183 | #!/usr/bin/env python Benchmark tests for MySQL advanced data store. Benchmark the mysql data store abstraction. Benchmark the mysql data store abstraction. | 1.899203 | 2 |
layoutx/widgets/spinbox.py | 8or5q/LayoutX | 61 | 6626494 | <filename>layoutx/widgets/spinbox.py
from .widget import Widget
from tkinter import ttk, StringVar
class SpinBox(Widget):
def __init__(self, master, **kwargs):
self._textv = StringVar()
super().__init__(
tk=ttk.Spinbox(master, textvariable=self._textv), **kwargs
)
self._setter = self.co... | <filename>layoutx/widgets/spinbox.py
from .widget import Widget
from tkinter import ttk, StringVar
class SpinBox(Widget):
def __init__(self, master, **kwargs):
self._textv = StringVar()
super().__init__(
tk=ttk.Spinbox(master, textvariable=self._textv), **kwargs
)
self._setter = self.co... | none | 1 | 2.820243 | 3 | |
sksurgerysurfacematch/algorithms/reconstructor_with_rectified_images.py | UCL/scikit-surgerysurfacematch | 1 | 6626495 | <filename>sksurgerysurfacematch/algorithms/reconstructor_with_rectified_images.py
# -*- coding: utf-8 -*-
""" Base class for surface reconstruction on already rectified images. """
import numpy as np
import cv2
import sksurgerysurfacematch.interfaces.stereo_reconstructor as sr
class StereoReconstructorWithRectifie... | <filename>sksurgerysurfacematch/algorithms/reconstructor_with_rectified_images.py
# -*- coding: utf-8 -*-
""" Base class for surface reconstruction on already rectified images. """
import numpy as np
import cv2
import sksurgerysurfacematch.interfaces.stereo_reconstructor as sr
class StereoReconstructorWithRectifie... | en | 0.791563 | # -*- coding: utf-8 -*- Base class for surface reconstruction on already rectified images. Base class for those stereo reconstruction methods that work specifically from rectified images. This class handles rectification and the necessary coordinate transformations. Note: The client calls the reconstruct() ... | 2.825157 | 3 |
sirena_client/base/messaging/response.py | utair-digital/sirena-client | 11 | 6626496 | from struct import unpack
from Crypto.Cipher import DES, PKCS1_v1_5
from Crypto.PublicKey import RSA
from .base import ResponseABC, Header
from ..types import AsymEncryptionHandShake
class Response(ResponseABC):
"""
Не зашифрованный ответ
"""
class ResponseEncryptedSym(ResponseABC):
"""
Ответ за... | from struct import unpack
from Crypto.Cipher import DES, PKCS1_v1_5
from Crypto.PublicKey import RSA
from .base import ResponseABC, Header
from ..types import AsymEncryptionHandShake
class Response(ResponseABC):
"""
Не зашифрованный ответ
"""
class ResponseEncryptedSym(ResponseABC):
"""
Ответ за... | ru | 0.955131 | Не зашифрованный ответ Ответ зашифрованный симмитричным ключем # noqa Обработчик тела ответа Распаковать сообщение по стандартам PKCS padding Ответ зашифрованный ассимитричным ключем # noqa Обработчик тела ответа на запрос # Длина зашифрованного сообщения в сетевом формате находится в первых 4 байтах сообщения # минус ... | 2.621664 | 3 |
manage.py | Temeez/uncertain-dashboard | 0 | 6626497 | <filename>manage.py
#!/usr/bin/env python
import os
from flask.ext.script import Manager, Shell, Server
from flask_migrate import Migrate, MigrateCommand
from uncertaind import app
from uncertaind.models import db
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('runserver', Server())
manager.add... | <filename>manage.py
#!/usr/bin/env python
import os
from flask.ext.script import Manager, Shell, Server
from flask_migrate import Migrate, MigrateCommand
from uncertaind import app
from uncertaind.models import db
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('runserver', Server())
manager.add... | ru | 0.26433 | #!/usr/bin/env python | 2.219069 | 2 |
python/paddle/fluid/tests/unittests/ir/inference/test_map_matmul_to_mul_pass.py | zmxdream/Paddle | 2 | 6626498 | # 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... | # 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.755761 | # 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.847797 | 2 |
examples/datatables/project/buildui.py | DevStar0804/karen-django-react | 2,536 | 6626499 | import pandas as pd
import re
import numpy as np
from collections import OrderedDict
from pyxley.charts.datatables import DataTable
from pyxley import UILayout, register_layouts
import json
def get_data(filename="./project/static/data.json"):
df = pd.DataFrame(json.load(open(filename, "r")))
df = df.dropna()
... | import pandas as pd
import re
import numpy as np
from collections import OrderedDict
from pyxley.charts.datatables import DataTable
from pyxley import UILayout, register_layouts
import json
def get_data(filename="./project/static/data.json"):
df = pd.DataFrame(json.load(open(filename, "r")))
df = df.dropna()
... | en | 0.320163 | # fix the salary column and cast as float # make some random bounds confidence_interval(this.api().column(3, {{"page":"current"}}).data(), "{tablename}"); confidence_interval(this.api().column(3, {{"page":"current"}}).data(), "{tablename}"); <svg width="156" height="20"><g></g></svg> | 2.952867 | 3 |
python/az/aro/azext_aro/_rbac.py | amanohar/ARO-RP | 0 | 6626500 | <gh_stars>0
# Copyright (c) Microsoft Corporation.
# Licensed under the Apache License 2.0.
import os
import uuid
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.cli.core.commands.client_factory import get_subscription_id
from azure.cli.core.profiles import get_sdk
from azure.cli... | # Copyright (c) Microsoft Corporation.
# Licensed under the Apache License 2.0.
import os
import uuid
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.cli.core.commands.client_factory import get_subscription_id
from azure.cli.core.profiles import get_sdk
from azure.cli.core.profil... | en | 0.801546 | # Copyright (c) Microsoft Corporation. # Licensed under the Apache License 2.0. # generate random uuid for role assignment | 1.863942 | 2 |
src/first_month/.idea/task_1_3_3.py | NareTorosyan/Python_Introduction_to_Data_Science | 0 | 6626501 |
#1 Write a Python function which returns factorial value of given number n.
def fact(n):
if n == 1:
return 1
return n*fact(n-1)
#2 Write a Python function which returns the n-th element of the fibonacci series.
def fib(n):
if n == 1:
return 0
elif n== 2:
return 1
return f... |
#1 Write a Python function which returns factorial value of given number n.
def fact(n):
if n == 1:
return 1
return n*fact(n-1)
#2 Write a Python function which returns the n-th element of the fibonacci series.
def fib(n):
if n == 1:
return 0
elif n== 2:
return 1
return f... | en | 0.612906 | #1 Write a Python function which returns factorial value of given number n. #2 Write a Python function which returns the n-th element of the fibonacci series. | 4.266487 | 4 |
timekeeper/tools/lockwatcher.py | antonopa/timekeeper | 1 | 6626502 | <reponame>antonopa/timekeeper
#!/usr/bin/env python3
"""
Basic dbus listener to monitor locking/unlocking of screen. Unlocking tries to insert a new day
(only first insertion, aka start of day, will succeed) and locking update the end of day time
(last lock is assumed to be the time we leave the office).
"""
import dbu... | #!/usr/bin/env python3
"""
Basic dbus listener to monitor locking/unlocking of screen. Unlocking tries to insert a new day
(only first insertion, aka start of day, will succeed) and locking update the end of day time
(last lock is assumed to be the time we leave the office).
"""
import dbus
from dbus.mainloop.glib impo... | en | 0.874086 | #!/usr/bin/env python3 Basic dbus listener to monitor locking/unlocking of screen. Unlocking tries to insert a new day (only first insertion, aka start of day, will succeed) and locking update the end of day time (last lock is assumed to be the time we leave the office). ActiveChanged signal from org.gnome.ScreenSaver ... | 2.995117 | 3 |
src/data/iter_parquet/iter_parquet.py | grantmwilliams/Useful-Snippets | 0 | 6626503 | """
This program takes a S3 URi a parquet file returns a lazy iterator of tuples to the values
I have 3 implementations shown below. Benchmarking shows them to be similar in speed with 2 & 3 tending to be fastest.
"""
import s3fs
import pyarrow as pa
import pyarrow.parquet as pq
from itertools import chain
f... | """
This program takes a S3 URi a parquet file returns a lazy iterator of tuples to the values
I have 3 implementations shown below. Benchmarking shows them to be similar in speed with 2 & 3 tending to be fastest.
"""
import s3fs
import pyarrow as pa
import pyarrow.parquet as pq
from itertools import chain
f... | en | 0.718635 | This program takes a S3 URi a parquet file returns a lazy iterator of tuples to the values I have 3 implementations shown below. Benchmarking shows them to be similar in speed with 2 & 3 tending to be fastest. # create file system for file interface objects from S3 # open a file interface object # convert the pyth... | 2.97929 | 3 |
integration_tests/test-packages/python/pythonspecific2/setup.py | franklinen/doppel-cli | 5 | 6626504 | from setuptools import find_packages
from setuptools import setup
setup(
name="pythonspecific2",
version="0.0.1",
packages=find_packages(),
)
| from setuptools import find_packages
from setuptools import setup
setup(
name="pythonspecific2",
version="0.0.1",
packages=find_packages(),
)
| none | 1 | 1.209932 | 1 | |
venv/Lib/site-packages/tensorflow_core/_api/v2/math/__init__.py | TEDxVienna/continuum | 0 | 6626505 | <filename>venv/Lib/site-packages/tensorflow_core/_api/v2/math/__init__.py
# This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/python/tools/api/generator/create_python_api.py script.
"""Math Operations.
Note: Functions taking `Tensor` arguments can also take anything accepted by
`tf.convert_to_ten... | <filename>venv/Lib/site-packages/tensorflow_core/_api/v2/math/__init__.py
# This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/python/tools/api/generator/create_python_api.py script.
"""Math Operations.
Note: Functions taking `Tensor` arguments can also take anything accepted by
`tf.convert_to_ten... | en | 0.708127 | # This file is MACHINE GENERATED! Do not edit. # Generated by: tensorflow/python/tools/api/generator/create_python_api.py script. Math Operations. Note: Functions taking `Tensor` arguments can also take anything accepted by `tf.convert_to_tensor`. Note: Elementwise binary operations in TensorFlow follow [numpy-style ... | 3.108411 | 3 |
tests/test_keybuilders.py | z4r/django-stopwatch | 3 | 6626506 | <gh_stars>1-10
from django.core.urlresolvers import ResolverMatch
from django.http import HttpRequest, HttpResponse
from django.test import TestCase
from stopwatch import errors
from stopwatch.keybuilders import RestApiKeyBuilder
def func():
pass
class RestApiKeyBuilderTestCase(TestCase):
def setUp(self):
... | from django.core.urlresolvers import ResolverMatch
from django.http import HttpRequest, HttpResponse
from django.test import TestCase
from stopwatch import errors
from stopwatch.keybuilders import RestApiKeyBuilder
def func():
pass
class RestApiKeyBuilderTestCase(TestCase):
def setUp(self):
self.key... | none | 1 | 2.205068 | 2 | |
GAScore/testbench/am_rx.py | sharm294/shoal | 1 | 6626507 | <reponame>sharm294/shoal<gh_stars>1-10
import os
from sonar.testbench import Testbench, Module, TestVector, Thread
from sonar.interfaces import AXIS
from sonar_strToInt import strToInt
am_rx = Testbench.default('am_rx')
filepath = os.path.join(os.path.dirname(__file__), 'build/am_rx/')
dut = Module.default("DUT")
d... | import os
from sonar.testbench import Testbench, Module, TestVector, Thread
from sonar.interfaces import AXIS
from sonar_strToInt import strToInt
am_rx = Testbench.default('am_rx')
filepath = os.path.join(os.path.dirname(__file__), 'build/am_rx/')
dut = Module.default("DUT")
dut.add_clock_port('ap_clk', '20ns')
dut... | en | 0.451921 | ################################################################################ # Test Vectors ################################################################################ # Initialization thread (added to each test vector to reset everything) #----------------------------------------------------------------------... | 2.038277 | 2 |
gcloud/tests/utils/cmdb/test_business_host_topo.py | ZhuoZhuoCrayon/bk-sops | 1 | 6626508 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2020 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2020 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | en | 0.864615 | # -*- coding: utf-8 -*- Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2020 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compli... | 1.912605 | 2 |
tools/mo/openvino/tools/mo/front/tf/next_iteration_ext.py | ryanloney/openvino-1 | 1,127 | 6626509 | <gh_stars>1000+
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from openvino.tools.mo.front.common.partial_infer.elemental import copy_shape_infer
from openvino.tools.mo.front.extractor import FrontExtractorOp
from openvino.tools.mo.graph.graph import Node
class NextIterationExtrac... | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from openvino.tools.mo.front.common.partial_infer.elemental import copy_shape_infer
from openvino.tools.mo.front.extractor import FrontExtractorOp
from openvino.tools.mo.graph.graph import Node
class NextIterationExtractor(FrontExtract... | de | 0.250642 | # Copyright (C) 2018-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 | 1.784384 | 2 |
parse/tests.py | danrobinson/PingBox | 0 | 6626510 | import unittest
from parse_rest.connection import register, ParseBatcher, SessionToken
from parse_rest.user import User
from parse_rest.datatypes import Object, Function
"""
# Prod
register(
"8fhsO5d7WTt6c7ffpVrPpHTVvuAi6vArrciyt8cK",
"tBnfG7a0P38w0ka3jWVTRkqcDxMIOdUXxNv8sZFp",
master_key="<KEY>",
)
"""
# Test
... | import unittest
from parse_rest.connection import register, ParseBatcher, SessionToken
from parse_rest.user import User
from parse_rest.datatypes import Object, Function
"""
# Prod
register(
"8fhsO5d7WTt6c7ffpVrPpHTVvuAi6vArrciyt8cK",
"tBnfG7a0P38w0ka3jWVTRkqcDxMIOdUXxNv8sZFp",
master_key="<KEY>",
)
"""
# Test
... | en | 0.453104 | # Prod register( "8fhsO5d7WTt6c7ffpVrPpHTVvuAi6vArrciyt8cK", "tBnfG7a0P38w0ka3jWVTRkqcDxMIOdUXxNv8sZFp", master_key="<KEY>", ) # Test #master_key="<KEY>", def test_tasks_by_user(self): pass def test_tasks_by_watcher(self): pass def test_tasks_by_creator(self): pass def test_initial_score_is_z... | 2.412788 | 2 |
sentiment.py | chauhanjatin10/sentiment_analysis | 0 | 6626511 | <filename>sentiment.py<gh_stars>0
from nltk import tokenize
from nltk import pos_tag, word_tokenize, ne_chunk
from nltk.tree import Tree
from nltk.sentiment.vader import SentimentIntensityAnalyzer
class NER:
def __init__(self):
self.text = text
def extract_named_entities(self):
named_entiites = []
for chunk ... | <filename>sentiment.py<gh_stars>0
from nltk import tokenize
from nltk import pos_tag, word_tokenize, ne_chunk
from nltk.tree import Tree
from nltk.sentiment.vader import SentimentIntensityAnalyzer
class NER:
def __init__(self):
self.text = text
def extract_named_entities(self):
named_entiites = []
for chunk ... | none | 1 | 2.897044 | 3 | |
server/manage.py | kdknive/buku-aska | 0 | 6626512 | import os
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from src.app import create_app, db
env_name = os.getenv('FLASK_ENV')
app = create_app(env_name)
migrate = Migrate(app=app, db=db)
manager = Manager(app=app)
manager.add_command('db', MigrateCommand)
if __name__ == '__mai... | import os
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from src.app import create_app, db
env_name = os.getenv('FLASK_ENV')
app = create_app(env_name)
migrate = Migrate(app=app, db=db)
manager = Manager(app=app)
manager.add_command('db', MigrateCommand)
if __name__ == '__mai... | none | 1 | 1.918087 | 2 | |
tango_user/views.py | tBaxter/Tango | 17 | 6626513 | import datetime
import json
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from django.http import HttpResponse
from django.shortcuts import render, get_object_or_404
from django.urls import reverse
from django.utils... | import datetime
import json
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from django.http import HttpResponse
from django.shortcuts import render, get_object_or_404
from django.urls import reverse
from django.utils... | en | 0.744296 | Renders either default user list (paginated) or search results.
To-do: split search to separate view, make pagination work better. Returns detail view for a single user | 2.1923 | 2 |
setup.py | DefaltSimon/SSKJpy | 0 | 6626514 | # coding=utf-8
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
# with open("README.md") as rdm:
# long_desc = rdm.read()
setup(
name='sskjpy',
author="DefaltSimon",
version='0.2.1',
license='MIT',
packages=["sskjpy"],
description="A Sloven... | # coding=utf-8
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
# with open("README.md") as rdm:
# long_desc = rdm.read()
setup(
name='sskjpy',
author="DefaltSimon",
version='0.2.1',
license='MIT',
packages=["sskjpy"],
description="A Sloven... | en | 0.558152 | # coding=utf-8 # with open("README.md") as rdm: # long_desc = rdm.read() # long_description=long_desc, | 1.220868 | 1 |
src/app.py | zayscue/christmas-list | 0 | 6626515 | <gh_stars>0
import uuid
import boto3
import logging
from datetime import datetime
import awsgi
from flask import (
Flask,
request,
jsonify,
)
from inputs.create_list_inputs import CreateListInputs
logging.getLogger().setLevel(logging.INFO)
db = boto3.resource("dynamodb")
app = Flask(__name__)
TABLE_NAME =... | import uuid
import boto3
import logging
from datetime import datetime
import awsgi
from flask import (
Flask,
request,
jsonify,
)
from inputs.create_list_inputs import CreateListInputs
logging.getLogger().setLevel(logging.INFO)
db = boto3.resource("dynamodb")
app = Flask(__name__)
TABLE_NAME = "ChristmasL... | none | 1 | 2.234045 | 2 | |
examples/mujoco/train_ppo_gym.py | xinyuewang1/chainerrl | 0 | 6626516 | <filename>examples/mujoco/train_ppo_gym.py
"""An example of training PPO against OpenAI Gym Envs.
This script is an example of training a PPO agent against OpenAI Gym envs.
Both discrete and continuous action spaces are supported.
To solve CartPole-v0, run:
python train_ppo_gym.py --env CartPole-v0
"""
from __fut... | <filename>examples/mujoco/train_ppo_gym.py
"""An example of training PPO against OpenAI Gym Envs.
This script is an example of training a PPO agent against OpenAI Gym envs.
Both discrete and continuous action spaces are supported.
To solve CartPole-v0, run:
python train_ppo_gym.py --env CartPole-v0
"""
from __fut... | en | 0.828952 | An example of training PPO against OpenAI Gym Envs. This script is an example of training a PPO agent against OpenAI Gym envs. Both discrete and continuous action spaces are supported. To solve CartPole-v0, run: python train_ppo_gym.py --env CartPole-v0 # NOQA # NOQA An example of A3C feedforward softmax policy. ... | 2.35332 | 2 |
plugins/dcmp/settings.py | qmgeng/docker-airflow | 269 | 6626517 | # encoding: utf-8
import os
import socket
from airflow import configuration
TASK_TYPES = ["bash", "hql", "python", "short_circuit", "partition_sensor", "time_sensor", "timedelta_sensor"]
AUTHENTICATE = configuration.getboolean('webserver', 'AUTHENTICATE')
BASE_URL = configuration.get('webserver', 'BASE_URL')
try:... | # encoding: utf-8
import os
import socket
from airflow import configuration
TASK_TYPES = ["bash", "hql", "python", "short_circuit", "partition_sensor", "time_sensor", "timedelta_sensor"]
AUTHENTICATE = configuration.getboolean('webserver', 'AUTHENTICATE')
BASE_URL = configuration.get('webserver', 'BASE_URL')
try:... | en | 0.83829 | # encoding: utf-8 | 1.800622 | 2 |
keras_model/model.py | anthonyhu/domain-adapt | 1 | 6626518 | <gh_stars>1-10
import os
import random
import numpy as np
import tensorflow as tf
import tensorflow.keras.backend as K
import matplotlib.pyplot as plt
from tensorflow.keras.layers import Input, Lambda, Conv2DTranspose, AveragePooling2D, Flatten, Dense, UpSampling2D
from tensorflow.keras import Model
from tensorflow.k... | import os
import random
import numpy as np
import tensorflow as tf
import tensorflow.keras.backend as K
import matplotlib.pyplot as plt
from tensorflow.keras.layers import Input, Lambda, Conv2DTranspose, AveragePooling2D, Flatten, Dense, UpSampling2D
from tensorflow.keras import Model
from tensorflow.keras.optimizers... | en | 0.537007 | # GAN coefficient # Reconstruction coefficient # KL divergence coefficient # perceptual loss Parameters ---------- input_size: tuple(int, int, int) name: str Returns ------- encoder: tf.keras.model.Model input: image outputs: z_mean and z (a sample) Parameter... | 2.302594 | 2 |
blogs/xmlload/xmlload.py | wietze/bigquery-oreilly-book | 365 | 6626519 | <filename>blogs/xmlload/xmlload.py
import argparse
import logging
import apache_beam as beam
def parse_into_dict(xmlfile):
import xmltodict
with open(xmlfile) as ifp:
doc = xmltodict.parse(ifp.read())
return doc
table_schema = {
'fields': [
{'name' : 'CustomerID', 'type': 'STRING',... | <filename>blogs/xmlload/xmlload.py
import argparse
import logging
import apache_beam as beam
def parse_into_dict(xmlfile):
import xmltodict
with open(xmlfile) as ifp:
doc = xmltodict.parse(ifp.read())
return doc
table_schema = {
'fields': [
{'name' : 'CustomerID', 'type': 'STRING',... | en | 0.746644 | # The @ symbol is not allowed as a column name in BigQuery # optional attribute #WRITE_TRUNCATE | 2.473955 | 2 |
hw/hw_train_and_test.py | vihari/CSD | 41 | 6626520 | <gh_stars>10-100
# Copyright 2015 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 re... | # Copyright 2015 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.83414 | # Copyright 2015 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... | 1.715874 | 2 |
exercicios/020.py | danielcesarcs/Python_aulas_cursoemvideo | 0 | 6626521 | <gh_stars>0
"""Ordem dos Sorteados"""
# Uso da importação de bibliotecas
import random
a = input('Aluno 1: ')
b = input('Aluno 2: ')
c = input('Aluno 3: ')
d = input('Aluno 4: ')
lista = [a, b, c, d]
random.shuffle(lista) # Metodo vai embaralhar a lista e reorganizar
print('A ordem de sortedos é: ')
print(lista)
| """Ordem dos Sorteados"""
# Uso da importação de bibliotecas
import random
a = input('Aluno 1: ')
b = input('Aluno 2: ')
c = input('Aluno 3: ')
d = input('Aluno 4: ')
lista = [a, b, c, d]
random.shuffle(lista) # Metodo vai embaralhar a lista e reorganizar
print('A ordem de sortedos é: ')
print(lista) | pt | 0.911461 | Ordem dos Sorteados # Uso da importação de bibliotecas # Metodo vai embaralhar a lista e reorganizar | 3.857491 | 4 |
torchblocks/processor/utils.py | deepframwork/TorchBlocks | 1 | 6626522 | import json
import copy
class InputExample:
"""
A single training/test example for simple sequence classification.
texts: 列表形式,比如 [text_a,text_b]
label: 标签信息,
label_ids: 标签列表,比如多标签,NER等任务
"""
def __init__(self,
guid,
texts,
... | import json
import copy
class InputExample:
"""
A single training/test example for simple sequence classification.
texts: 列表形式,比如 [text_a,text_b]
label: 标签信息,
label_ids: 标签列表,比如多标签,NER等任务
"""
def __init__(self,
guid,
texts,
... | en | 0.732219 | A single training/test example for simple sequence classification.
texts: 列表形式,比如 [text_a,text_b]
label: 标签信息,
label_ids: 标签列表,比如多标签,NER等任务 Serializes this instance to a Python dictionary. Serializes this instance to a JSON string. A single set of features of processor.
Property names ar... | 3.203585 | 3 |
backend/api/battles/serializers.py | gabrielaleal/pokebattle | 1 | 6626523 | from rest_framework import serializers
from api.pokemon.serializers import PokemonSerializer, PokemonWinnerSerializer
from api.users.serializers import UserSerializer
from battles.models import Battle, BattleTeam
from battles.tasks import run_battle_and_send_result_email
from battles.utils.battle import get_round_winn... | from rest_framework import serializers
from api.pokemon.serializers import PokemonSerializer, PokemonWinnerSerializer
from api.users.serializers import UserSerializer
from battles.models import Battle, BattleTeam
from battles.tasks import run_battle_and_send_result_email
from battles.utils.battle import get_round_winn... | en | 0.887973 | # same as the clean method on form # noqa # if the creator team doesn't exist yet, just return user data # if it exists, return the battle team data (which also has the creator information) # Read-only fields (so I can use them on frontend if I need any of them) # same as the form_valid method on the view # get self.re... | 2.578607 | 3 |
api/rest/models.py | dragonsuperf/job-spider | 0 | 6626524 | <reponame>dragonsuperf/job-spider<filename>api/rest/models.py
from django.db import models
class Article(models.Model):
company_name = models.CharField(max_length=32, default='ERROR')
career = models.CharField(max_length=16, default='0')
duty = models.CharField(max_length=32, default='ERROR')
location... | from django.db import models
class Article(models.Model):
company_name = models.CharField(max_length=32, default='ERROR')
career = models.CharField(max_length=16, default='0')
duty = models.CharField(max_length=32, default='ERROR')
location = models.CharField(max_length=64, default='ERROR')
requir... | none | 1 | 2.162157 | 2 | |
backend/app/apps/hotels/helpers/recommendation.py | Hesbon5600/hotel-recommender | 0 | 6626525 | <reponame>Hesbon5600/hotel-recommender
import pandas as pd
from datetime import datetime
from sqlalchemy import create_engine
from django.conf import settings
from app import celery_app
from ..models import Hotel
def generate_score():
"""
Generate the score for each hotel based on the IMDB algorithm
"""
... | import pandas as pd
from datetime import datetime
from sqlalchemy import create_engine
from django.conf import settings
from app import celery_app
from ..models import Hotel
def generate_score():
"""
Generate the score for each hotel based on the IMDB algorithm
"""
df_ = pd.DataFrame(list(Hotel.object... | en | 0.90688 | Generate the score for each hotel based on the IMDB algorithm # Calculate C # The average rating of a hotel in Nairobi is around 3,2, on a scale of 5. # Next, let's calculate the number of votes, m, received by a hotel in the 55th percentile. # The pandas library makes this task extremely trivial using the .quantile() ... | 2.988791 | 3 |
mikeio/dfsutil.py | murray91/mikeio | 0 | 6626526 | from typing import List, Union
import numpy as np
import pandas as pd
from .eum import EUMType, EUMUnit, ItemInfo, TimeAxisType
from .custom_exceptions import ItemsError
from mikecore.DfsFile import DfsDynamicItemInfo
def _valid_item_numbers(
dfsItemInfo: List[DfsDynamicItemInfo],
items: Union[int, List[int]... | from typing import List, Union
import numpy as np
import pandas as pd
from .eum import EUMType, EUMUnit, ItemInfo, TimeAxisType
from .custom_exceptions import ItemsError
from mikecore.DfsFile import DfsDynamicItemInfo
def _valid_item_numbers(
dfsItemInfo: List[DfsDynamicItemInfo],
items: Union[int, List[int]... | en | 0.321073 | # TODO: naming: time_steps or timesteps? # end=start # stop only # start only # TODO: handle non-equidistant calendar Utility function to find item numbers Parameters ---------- dfsItemInfo : MIKE dfs ItemInfo object item_names : list[str] Names of items to be found Returns ------- ... | 2.503228 | 3 |
cvpods/checkpoint/catalog.py | reinforcementdriving/cvpods | 0 | 6626527 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from cvpods.utils import PathHandler, PathManager
import logging
class ModelCatalog(object):
"""
Store mappings from names to third-party models.
"""
S3_C2_DETECTRON_PREFIX = "https://dl.fbaipublicfiles.com/detectron"
# MSRA... | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from cvpods.utils import PathHandler, PathManager
import logging
class ModelCatalog(object):
"""
Store mappings from names to third-party models.
"""
S3_C2_DETECTRON_PREFIX = "https://dl.fbaipublicfiles.com/detectron"
# MSRA... | en | 0.842161 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved Store mappings from names to third-party models. # MSRA models have STRIDE_IN_1X1=True. False otherwise. # NOTE: all BN models here have fused BN into an affine layer. # As a result, you should only load them to a model with "FrozenBN". # Loading th... | 1.864107 | 2 |
zerxis_invitations/invitations/apps.py | Kirembu/zerxis-invitations | 0 | 6626528 | import importlib
from django.apps import AppConfig as BaseAppConfig
from django.utils.translation import gettext_lazy as _
class AppConfig(BaseAppConfig):
name = "zerxis_invitations"
label = "zerxis_invitations"
verbose_name = _("Zerxis Invitations")
def ready(self):
importlib.import_module... | import importlib
from django.apps import AppConfig as BaseAppConfig
from django.utils.translation import gettext_lazy as _
class AppConfig(BaseAppConfig):
name = "zerxis_invitations"
label = "zerxis_invitations"
verbose_name = _("Zerxis Invitations")
def ready(self):
importlib.import_module... | none | 1 | 1.751938 | 2 | |
soapypower/power.py | alexnask/soapy_power | 111 | 6626529 | #!/usr/bin/env python3
import sys, time, datetime, math, logging, signal
import numpy
import simplesoapy
from simplespectral import zeros
from soapypower import psd, writer
logger = logging.getLogger(__name__)
_shutdown = False
def _shutdown_handler(sig, frame):
"""Set global _shutdown flag when receiving SIG... | #!/usr/bin/env python3
import sys, time, datetime, math, logging, signal
import numpy
import simplesoapy
from simplespectral import zeros
from soapypower import psd, writer
logger = logging.getLogger(__name__)
_shutdown = False
def _shutdown_handler(sig, frame):
"""Set global _shutdown flag when receiving SIG... | en | 0.848703 | #!/usr/bin/env python3 Set global _shutdown flag when receiving SIGTERM or SIGINT signals # Register signals with _shutdown_handler SoapySDR spectrum analyzer Return nearest frequency based on bin size Return nearest number of FFT bins (even or power of two) Return nearest overlap/crop factor based on number of bins Co... | 2.407536 | 2 |
myvenv/lib/python3.6/site-packages/nltk/twitter/common.py | catb0y/twitter_feeling | 11 | 6626530 | # -*- coding: utf-8 -*-
# Natural Language Toolkit: Twitter client
#
# Copyright (C) 2001-2017 NLTK Project
# Author: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Utility functions for the :module:`twitterclient` module which do not require
the `t... | # -*- coding: utf-8 -*-
# Natural Language Toolkit: Twitter client
#
# Copyright (C) 2001-2017 NLTK Project
# Author: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Utility functions for the :module:`twitterclient` module which do not require
the `t... | en | 0.732494 | # -*- coding: utf-8 -*- # Natural Language Toolkit: Twitter client # # Copyright (C) 2001-2017 NLTK Project # Author: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT Utility functions for the :module:`twitterclient` module which do not require the `twytho... | 3.250988 | 3 |
tests/mod_base/base.py | fossabot/extendable | 3 | 6626531 | from extendable import ExtendableMeta
class Base(metaclass=ExtendableMeta):
def test(self) -> str:
return "base"
| from extendable import ExtendableMeta
class Base(metaclass=ExtendableMeta):
def test(self) -> str:
return "base"
| none | 1 | 2.843421 | 3 | |
kytos/core/link.py | MarvinTorres/kytos | 0 | 6626532 | """Module with all classes related to links.
Links are low level abstractions representing connections between two
interfaces.
"""
import hashlib
import json
import random
from kytos.core.common import GenericEntity
from kytos.core.exceptions import (KytosLinkCreationError,
KytosNo... | """Module with all classes related to links.
Links are low level abstractions representing connections between two
interfaces.
"""
import hashlib
import json
import random
from kytos.core.common import GenericEntity
from kytos.core.exceptions import (KytosLinkCreationError,
KytosNo... | en | 0.769958 | Module with all classes related to links. Links are low level abstractions representing connections between two interfaces. Define a link between two Endpoints. Create a Link instance and set its attributes. Two kytos.core.interface.Interface are required as parameters. Override the is_enabled method. ... | 3.043232 | 3 |
rotations/rotations.py | MomsFriendlyRobotCompany/rotations | 1 | 6626533 | # -*- coding: utf-8 -*-
##############################################
# The MIT License (MIT)
# Copyright (c) 2020 <NAME>
# see LICENSE for full details
##############################################
import numpy as np
rad2deg = 180/np.pi
deg2rad = np.pi/180
# https://en.wikipedia.org/wiki/Rotation_matrix
def R1(a,... | # -*- coding: utf-8 -*-
##############################################
# The MIT License (MIT)
# Copyright (c) 2020 <NAME>
# see LICENSE for full details
##############################################
import numpy as np
rad2deg = 180/np.pi
deg2rad = np.pi/180
# https://en.wikipedia.org/wiki/Rotation_matrix
def R1(a,... | en | 0.433405 | # -*- coding: utf-8 -*- ############################################## # The MIT License (MIT) # Copyright (c) 2020 <NAME> # see LICENSE for full details ############################################## # https://en.wikipedia.org/wiki/Rotation_matrix Returns a rotation matrix based on: Z(c)*X(b)*Z(a) # return np.array( #... | 3.38547 | 3 |
pint_server/tests/unit/conftest.py | jeremy-moffitt/public-cloud-info-service | 0 | 6626534 | <reponame>jeremy-moffitt/public-cloud-info-service<gh_stars>0
# Copyright (c) 2021 SUSE LLC
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 3 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the ... | # Copyright (c) 2021 SUSE LLC
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 3 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; witho... | en | 0.895506 | # Copyright (c) 2021 SUSE LLC # # This program is free software; you can redistribute it and/or # modify it under the terms of version 3 of the GNU General Public License as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; witho... | 1.90139 | 2 |
setup.py | nuchi/tf_pb_without_tf | 5 | 6626535 | import setuptools
setuptools.setup(
name='tf_pb',
packages=setuptools.find_packages('.'),
install_requires=['protobuf', 'grpcio']
)
| import setuptools
setuptools.setup(
name='tf_pb',
packages=setuptools.find_packages('.'),
install_requires=['protobuf', 'grpcio']
)
| none | 1 | 1.094781 | 1 | |
runtime/test/specs/V1_2/lstm3_state3_float16.mod.py | riscv-android-src/platform-packages-modules-NeuralNetworks | 0 | 6626536 | #
# Copyright (C) 2017 The Android Open Source Project
#
# 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 la... | #
# Copyright (C) 2017 The Android Open Source Project
#
# 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 la... | en | 0.751353 | # # Copyright (C) 2017 The Android Open Source Project # # 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 la... | 1.995155 | 2 |
src/cicadad/util/context.py | cicadatesting/cicada-distributed | 6 | 6626537 | <filename>src/cicadad/util/context.py
from typing import Any
import base64
import json
def encode_context(context: Any) -> str:
"""Encode a context as a base64 string
Args:
context (any): Context object. Must be json serializable
Returns:
str: Encoded context base64 string
"""
re... | <filename>src/cicadad/util/context.py
from typing import Any
import base64
import json
def encode_context(context: Any) -> str:
"""Encode a context as a base64 string
Args:
context (any): Context object. Must be json serializable
Returns:
str: Encoded context base64 string
"""
re... | en | 0.413254 | Encode a context as a base64 string Args: context (any): Context object. Must be json serializable Returns: str: Encoded context base64 string Decode a base64 string to JSON deserialized context Args: encoded_context (str): Base64 context string Returns: any: Decoded ... | 3.005459 | 3 |
obsidion/cogs/fun/fun.py | Darkflame72/Minecraft-Discord | 1 | 6626538 | """Fun cog."""
from __future__ import annotations
import logging
from random import choice
from typing import List
from typing import TYPE_CHECKING
import discord
from discord.ext import commands
from discord_slash import cog_ext
from discord_slash.context import SlashContext
from discord_slash.utils.manage_commands ... | """Fun cog."""
from __future__ import annotations
import logging
from random import choice
from typing import List
from typing import TYPE_CHECKING
import discord
from discord.ext import commands
from discord_slash import cog_ext
from discord_slash.context import SlashContext
from discord_slash.utils.manage_commands ... | en | 0.695996 | Fun cog. Init. Load text from file. Args: file (str): file name Returns: List[str]: list of input Get an idea for a new build. Get an idea for a new build. Get an idea for a new build. # Used to detect the start of a word # Used to prevent 'H's without 'm's # Used to make "HmmHmm... | 2.430284 | 2 |
bvspca/social/wagtail_hooks.py | rds0751/bvspca | 10 | 6626539 | from wagtail.contrib.modeladmin.options import (ModelAdmin, modeladmin_register)
from .models import SocialMediaQueue
class NewsSocialMediaQueueModelAdmin(ModelAdmin):
model = SocialMediaQueue
menu_label = 'SM Queue'
menu_icon = 'fa-share-square '
menu_order = 450
add_to_settings_menu = True
... | from wagtail.contrib.modeladmin.options import (ModelAdmin, modeladmin_register)
from .models import SocialMediaQueue
class NewsSocialMediaQueueModelAdmin(ModelAdmin):
model = SocialMediaQueue
menu_label = 'SM Queue'
menu_icon = 'fa-share-square '
menu_order = 450
add_to_settings_menu = True
... | none | 1 | 1.603775 | 2 | |
actions/reboot_vm.py | cognifloyd/stackstorm-libcloud | 0 | 6626540 | <reponame>cognifloyd/stackstorm-libcloud
from lib.actions import SingleVMAction
__all__ = [
'RebootVMAction'
]
class RebootVMAction(SingleVMAction):
api_type = 'compute'
def run(self, credentials, vm_id, extra_kwargs=None):
extra_kwargs = extra_kwargs or {}
driver = self._get_driver_for_... | from lib.actions import SingleVMAction
__all__ = [
'RebootVMAction'
]
class RebootVMAction(SingleVMAction):
api_type = 'compute'
def run(self, credentials, vm_id, extra_kwargs=None):
extra_kwargs = extra_kwargs or {}
driver = self._get_driver_for_credentials(credentials=credentials)
... | none | 1 | 2.397588 | 2 | |
test/test_cutpaste.py | thymeyk/imdetector | 3 | 6626541 | <gh_stars>1-10
import os
import unittest
from imdetector.image import SuspiciousImage
from imdetector.cutpaste import CutPaste
DIR = os.getcwd()
class TestCutPaste(unittest.TestCase):
def test_cutpaste(self):
# TODO: re-traing a model
expected = [0, 1]
img1 = SuspiciousImage(
... | import os
import unittest
from imdetector.image import SuspiciousImage
from imdetector.cutpaste import CutPaste
DIR = os.getcwd()
class TestCutPaste(unittest.TestCase):
def test_cutpaste(self):
# TODO: re-traing a model
expected = [0, 1]
img1 = SuspiciousImage(
os.path.join(
... | en | 0.752428 | # TODO: re-traing a model | 2.942564 | 3 |
crits/samples/sample.py | frbapolkosnik/crits | 0 | 6626542 | import json
from mongoengine import Document
from mongoengine import StringField, ListField
from mongoengine import IntField
from django.conf import settings
from crits.samples.migrate import migrate_sample
from crits.core.crits_mongoengine import CritsBaseAttributes
from crits.core.crits_mongoengine import CritsSour... | import json
from mongoengine import Document
from mongoengine import StringField, ListField
from mongoengine import IntField
from django.conf import settings
from crits.samples.migrate import migrate_sample
from crits.core.crits_mongoengine import CritsBaseAttributes
from crits.core.crits_mongoengine import CritsSour... | en | 0.823632 | Sample object # this is a shard key. you can't modify it once it's set. # MongoEngine will still mark the field as modified even if you set it # to the same value. Is this a PE file. Is this a PDF. Queries GridFS for a matching binary to this sample document. Set the Sample filenames to a specified list. :para... | 2.072612 | 2 |
models/semisup_mtl.py | zachstarkk/ASM2V | 0 | 6626543 | <gh_stars>0
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import random
from typing import Tuple, List
import yaml
# TSA
def get_tsa_thresh(schedule, global_step, num_train_steps, start, end, device):
training_progress = torch.tensor(float(global_step) / float(num_train_ste... | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import random
from typing import Tuple, List
import yaml
# TSA
def get_tsa_thresh(schedule, global_step, num_train_steps, start, end, device):
training_progress = torch.tensor(float(global_step) / float(num_train_steps))
if ... | en | 0.513844 | # TSA Baic one single shared bottom for all tasks across all views for benchmark evaluation for semi-supervised learning # self.specific_tasks_1 = nn.ModuleList([nn.Linear(sensor_dim, 1) for _ in range(num_tasks)]) # X shape: [batch_size, num_tasks, num_views, seq_len, sensor_dim] from single task # >> [batch_size, num... | 2.40194 | 2 |
clean/taxi/taxispark.py | chrislin009/trafficDispatcher | 1 | 6626544 | import sys
import datetime
from pyspark import SparkContext
from csv import reader
from operator import add
def week(datetimestr):
#get weeknumber of the yaer
date, time = datetimestr.split(' ')
yearstr, monthstr, daystr = date.split('-')
year = int(yearstr)
month = int(monthstr)
day = int(daystr)
isoyear, isow... | import sys
import datetime
from pyspark import SparkContext
from csv import reader
from operator import add
def week(datetimestr):
#get weeknumber of the yaer
date, time = datetimestr.split(' ')
yearstr, monthstr, daystr = date.split('-')
year = int(yearstr)
month = int(monthstr)
day = int(daystr)
isoyear, isow... | en | 0.799675 | #get weeknumber of the yaer | 3.0005 | 3 |
wotw_highlighter/block_styler.py | wizardsoftheweb/wotw_highlighter | 0 | 6626545 | <reponame>wizardsoftheweb/wotw_highlighter
"""This file provides a class to provide styling"""
from os.path import dirname, join
from wotw_highlighter.block_options import BlockOptions
class BlockStyler(BlockOptions):
"""This class provides styles for a highlighted_blob"""
@staticmethod
def dump_pygmen... | """This file provides a class to provide styling"""
from os.path import dirname, join
from wotw_highlighter.block_options import BlockOptions
class BlockStyler(BlockOptions):
"""This class provides styles for a highlighted_blob"""
@staticmethod
def dump_pygments_styles():
"""Dumps all the style... | en | 0.681637 | This file provides a class to provide styling This class provides styles for a highlighted_blob Dumps all the styles from Pygments Dumps all the additional styling Dumps all the style Assigns styles to the BlockOptions chain | 2.804505 | 3 |
Py/font_big.py | ttempe/Pocket_Organ | 11 | 6626546 | # Code generated by font_to_py.py.
# Font: FreeSansBold.ttf Char set: #357ABCDEFGadgimu
# Cmd: ./font_to_py.py ttf/FreeSansBold.ttf 40 -x -c ABCDEFGm753#dimaug font_big.py
version = '0.33'
def height():
return 42
def baseline():
return 32
def max_width():
return 38
def hmap():
return True
def rever... | # Code generated by font_to_py.py.
# Font: FreeSansBold.ttf Char set: #357ABCDEFGadgimu
# Cmd: ./font_to_py.py ttf/FreeSansBold.ttf 40 -x -c ABCDEFGm753#dimaug font_big.py
version = '0.33'
def height():
return 42
def baseline():
return 32
def max_width():
return 38
def hmap():
return True
def rever... | en | 0.307526 | # Code generated by font_to_py.py. # Font: FreeSansBold.ttf Char set: #357ABCDEFGadgimu # Cmd: ./font_to_py.py ttf/FreeSansBold.ttf 40 -x -c ABCDEFGm753#dimaug font_big.py | 2.086221 | 2 |
grundzeug/config/providers/common.py | nickguletskii/grundzeug | 1 | 6626547 | <reponame>nickguletskii/grundzeug<gh_stars>1-10
# Copyright 2019 <NAME>
#
# 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... | # Copyright 2019 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | en | 0.785472 | # Copyright 2019 <NAME> # # 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,... | 2.233624 | 2 |
fhirclient/models/element.py | carolinarsm/client-py | 418 | 6626548 | <gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Element) on 2019-05-07.
# 2019, SMART Health IT.
from . import fhirabstractbase
class Element(fhirabstractbase.FHIRAbstractBase):
""" Base for all elements.
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Element) on 2019-05-07.
# 2019, SMART Health IT.
from . import fhirabstractbase
class Element(fhirabstractbase.FHIRAbstractBase):
""" Base for all elements.
Base definition f... | en | 0.675397 | #!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Element) on 2019-05-07. # 2019, SMART Health IT. Base for all elements. Base definition for all elements in a resource. Initialize all valid properties. :raises: FH... | 2.33533 | 2 |
addons/source-python/plugins/warcraft/races/__init__.py | ThomasVieth/WCS-Remastered | 0 | 6626549 | <reponame>ThomasVieth/WCS-Remastered<gh_stars>0
"""
"""
## python imports
from configobj import ConfigObj
from glob import glob
from os.path import dirname, basename, isfile
## source.python imports
from engines.server import insert_command_string
from paths import CUSTOM_DATA_PATH
from messages import SayText2
#... | """
"""
## python imports
from configobj import ConfigObj
from glob import glob
from os.path import dirname, basename, isfile
## source.python imports
from engines.server import insert_command_string
from paths import CUSTOM_DATA_PATH
from messages import SayText2
## warcraft.package imports
from warcraft.race i... | en | 0.373041 | ## python imports ## source.python imports ## warcraft.package imports ## __all__ declaration ## generate functions ## load ini races ## Gather information. ## Construct the skill class. ## Classname. ## Skill class to inherit from. ## Gather information. ## Construct the race class. ## Classname. ## Race class to inhe... | 2.385298 | 2 |
tests/python/unittest/test_lang_target.py | kpot/tvm | 0 | 6626550 | import tvm
@tvm.target.generic_func
def mygeneric(data):
# default generic function
return data + 1
@mygeneric.register(["cuda", "gpu"])
def cuda_func(data):
return data + 2
@mygeneric.register("rocm")
def rocm_func(data):
return data + 3
@mygeneric.register("cpu")
def rocm_func(data):
return da... | import tvm
@tvm.target.generic_func
def mygeneric(data):
# default generic function
return data + 1
@mygeneric.register(["cuda", "gpu"])
def cuda_func(data):
return data + 2
@mygeneric.register("rocm")
def rocm_func(data):
return data + 3
@mygeneric.register("cpu")
def rocm_func(data):
return da... | en | 0.037051 | # default generic function | 2.27106 | 2 |