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 |
|---|---|---|---|---|---|---|---|---|---|---|
stockprophet/__init__.py | chihyi-liao/stockprophet | 1 | 8200 | <gh_stars>1-10
from stockprophet.cli import entry_point
from stockprophet.crawler import (
init_stock_type, init_stock_category
)
from stockprophet.db import init_db
from .utils import read_db_settings
def preprocessing() -> bool:
result = False
# noinspection PyBroadException
try:
db_config ... | from stockprophet.cli import entry_point
from stockprophet.crawler import (
init_stock_type, init_stock_category
)
from stockprophet.db import init_db
from .utils import read_db_settings
def preprocessing() -> bool:
result = False
# noinspection PyBroadException
try:
db_config = read_db_setti... | fr | 0.141312 | # noinspection PyBroadException # noinspection PyBroadException | 2.223773 | 2 |
2021/day_25.py | mpcjanssen/Advent-of-Code | 1 | 8201 | <gh_stars>1-10
import aoc_helper
RAW = aoc_helper.day(25)
print(RAW)
def parse_raw():
...
DATA = parse_raw()
def part_one():
...
def part_two():
...
aoc_helper.submit(25, part_one)
aoc_helper.submit(25, part_two)
| import aoc_helper
RAW = aoc_helper.day(25)
print(RAW)
def parse_raw():
...
DATA = parse_raw()
def part_one():
...
def part_two():
...
aoc_helper.submit(25, part_one)
aoc_helper.submit(25, part_two) | none | 1 | 2.036998 | 2 | |
6/6.2.py | Hunter1753/adventofcode | 1 | 8202 | <gh_stars>1-10
def setIntersectionCount(group):
return len(set.intersection(*group))
groupList = []
tempGroup = []
with open("./6/input.txt") as inputFile:
for line in inputFile:
line = line.replace("\n","")
if len(line) > 0:
tempGroup.append(set(line))
else:
groupList.append(tempGroup)
tempGroup = []... | def setIntersectionCount(group):
return len(set.intersection(*group))
groupList = []
tempGroup = []
with open("./6/input.txt") as inputFile:
for line in inputFile:
line = line.replace("\n","")
if len(line) > 0:
tempGroup.append(set(line))
else:
groupList.append(tempGroup)
tempGroup = []
if len(tempGr... | none | 1 | 3.446082 | 3 | |
demo/gpnas/CVPR2021_NAS_competition_gpnas_demo.py | ZichaoGuo/PaddleSlim | 926 | 8203 | <filename>demo/gpnas/CVPR2021_NAS_competition_gpnas_demo.py
# 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.a... | <filename>demo/gpnas/CVPR2021_NAS_competition_gpnas_demo.py
# 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.a... | en | 0.666365 | # 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 applic... | 1.910093 | 2 |
pages/migrations/0004_auto_20181102_0944.py | yogeshprasad/spa-development | 0 | 8204 | <reponame>yogeshprasad/spa-development<gh_stars>0
# Generated by Django 2.0.6 on 2018-11-02 09:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pages', '0003_coachingcourse'),
]
operations = [
migrations.AlterField(
model_... | # Generated by Django 2.0.6 on 2018-11-02 09:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pages', '0003_coachingcourse'),
]
operations = [
migrations.AlterField(
model_name='coachingcourse',
name='username'... | en | 0.844349 | # Generated by Django 2.0.6 on 2018-11-02 09:44 | 1.599932 | 2 |
imageclassification/src/sample/splitters/_StratifiedSplitter.py | waikato-datamining/keras-imaging | 0 | 8205 | from collections import OrderedDict
from random import Random
from typing import Set
from .._types import Dataset, Split, LabelIndices
from .._util import per_label
from ._RandomSplitter import RandomSplitter
from ._Splitter import Splitter
class StratifiedSplitter(Splitter):
"""
TODO
"""
def __init_... | from collections import OrderedDict
from random import Random
from typing import Set
from .._types import Dataset, Split, LabelIndices
from .._util import per_label
from ._RandomSplitter import RandomSplitter
from ._Splitter import Splitter
class StratifiedSplitter(Splitter):
"""
TODO
"""
def __init_... | none | 1 | 2.742425 | 3 | |
revenuecat_python/enums.py | YuraHavrylko/revenuecat_python | 1 | 8206 | <reponame>YuraHavrylko/revenuecat_python
from enum import Enum
class SubscriptionPlatform(Enum):
ios = 'ios'
android = 'android'
macos = 'macos'
uikitformac = 'uikitformac'
stripe = 'stripe'
class AttributionNetworkCode(Enum):
apple_search_ads = 0
adjust = 1
apps_flyer = 2
branch... | from enum import Enum
class SubscriptionPlatform(Enum):
ios = 'ios'
android = 'android'
macos = 'macos'
uikitformac = 'uikitformac'
stripe = 'stripe'
class AttributionNetworkCode(Enum):
apple_search_ads = 0
adjust = 1
apps_flyer = 2
branch = 3
tenjin = 4
facebook = 5 | none | 1 | 2.431421 | 2 | |
windows_packages_gpu/torch/nn/intrinsic/qat/modules/linear_relu.py | codeproject/DeepStack | 353 | 8207 | from __future__ import absolute_import, division, print_function, unicode_literals
import torch.nn.qat as nnqat
import torch.nn.intrinsic
import torch.nn.functional as F
class LinearReLU(nnqat.Linear):
r"""
A LinearReLU module fused from Linear and ReLU modules, attached with
FakeQuantize modules f... | from __future__ import absolute_import, division, print_function, unicode_literals
import torch.nn.qat as nnqat
import torch.nn.intrinsic
import torch.nn.functional as F
class LinearReLU(nnqat.Linear):
r"""
A LinearReLU module fused from Linear and ReLU modules, attached with
FakeQuantize modules f... | en | 0.662167 | A LinearReLU module fused from Linear and ReLU modules, attached with
FakeQuantize modules for output activation and weight, used in
quantization aware training.
We adopt the same interface as :class:`torch.nn.Linear`.
Similar to `torch.nn.intrinsic.LinearReLU`, with FakeQuantize modules initial... | 2.746999 | 3 |
venv/Lib/site-packages/PyOpenGL-3.0.1/OpenGL/GL/EXT/draw_buffers2.py | temelkirci/Motion_Editor | 1 | 8208 | <reponame>temelkirci/Motion_Editor
'''OpenGL extension EXT.draw_buffers2
This module customises the behaviour of the
OpenGL.raw.GL.EXT.draw_buffers2 to provide a more
Python-friendly API
Overview (from the spec)
This extension builds upon the ARB_draw_buffers extension and provides
separate blend enables and co... | '''OpenGL extension EXT.draw_buffers2
This module customises the behaviour of the
OpenGL.raw.GL.EXT.draw_buffers2 to provide a more
Python-friendly API
Overview (from the spec)
This extension builds upon the ARB_draw_buffers extension and provides
separate blend enables and color write masks for each color outp... | en | 0.691713 | OpenGL extension EXT.draw_buffers2 This module customises the behaviour of the OpenGL.raw.GL.EXT.draw_buffers2 to provide a more Python-friendly API Overview (from the spec) This extension builds upon the ARB_draw_buffers extension and provides separate blend enables and color write masks for each color output.... | 1.83881 | 2 |
pymemcache/client/retrying.py | liquidpele/pymemcache | 0 | 8209 | """ Module containing the RetryingClient wrapper class. """
from time import sleep
def _ensure_tuple_argument(argument_name, argument_value):
"""
Helper function to ensure the given arguments are tuples of Exceptions (or
subclasses), or can at least be converted to such.
Args:
argument_name: s... | """ Module containing the RetryingClient wrapper class. """
from time import sleep
def _ensure_tuple_argument(argument_name, argument_value):
"""
Helper function to ensure the given arguments are tuples of Exceptions (or
subclasses), or can at least be converted to such.
Args:
argument_name: s... | en | 0.78035 | Module containing the RetryingClient wrapper class. Helper function to ensure the given arguments are tuples of Exceptions (or subclasses), or can at least be converted to such. Args: argument_name: str, name of the argument we're checking, only used for raising meaningful exceptions. argum... | 3.207531 | 3 |
8.1.py | HuaichenOvO/EIE3280HW | 0 | 8210 | <reponame>HuaichenOvO/EIE3280HW
import numpy as np
import numpy.linalg as lg
A_mat = np.matrix([
[0, 1, 1, 1, 0],
[1, 0, 0, 0, 1],
[1, 0, 0, 1, 1],
[1, 0, 1, 0, 1],
[0, 1, 1, 1, 0]
])
eigen = lg.eig(A_mat) # return Arr[5] with 5 different linear independent eigen values
vec = eigen[1... | import numpy as np
import numpy.linalg as lg
A_mat = np.matrix([
[0, 1, 1, 1, 0],
[1, 0, 0, 0, 1],
[1, 0, 0, 1, 1],
[1, 0, 1, 0, 1],
[0, 1, 1, 1, 0]
])
eigen = lg.eig(A_mat) # return Arr[5] with 5 different linear independent eigen values
vec = eigen[1][:, 0] # the column (eigen vect... | en | 0.466959 | # return Arr[5] with 5 different linear independent eigen values # the column (eigen vector) with the largest eigen value # the largest eigen value | 3.094293 | 3 |
classroom/migrations/0025_myfile_file.py | Abulhusain/E-learing | 5 | 8211 | # Generated by Django 2.2.2 on 2019-08-25 09:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('classroom', '0024_auto_20190825_1723'),
]
operations = [
migrations.AddField(
model_name='myfile',
name='file',
... | # Generated by Django 2.2.2 on 2019-08-25 09:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('classroom', '0024_auto_20190825_1723'),
]
operations = [
migrations.AddField(
model_name='myfile',
name='file',
... | en | 0.699913 | # Generated by Django 2.2.2 on 2019-08-25 09:29 | 1.553272 | 2 |
jumbo_api/objects/profile.py | rolfberkenbosch/python-jumbo-api | 3 | 8212 | <filename>jumbo_api/objects/profile.py
from jumbo_api.objects.store import Store
class Profile(object):
def __init__(self, data):
self.id = data.get("identifier")
self.store = Store(data.get("store"))
def __str__(self):
return f"{self.id} {self.store}"
| <filename>jumbo_api/objects/profile.py
from jumbo_api.objects.store import Store
class Profile(object):
def __init__(self, data):
self.id = data.get("identifier")
self.store = Store(data.get("store"))
def __str__(self):
return f"{self.id} {self.store}"
| none | 1 | 2.558684 | 3 | |
tmp/real_time_log_analy/logWatcher.py | hankai17/test | 7 | 8213 | <gh_stars>1-10
#!/usr/bin/env python
import os
import sys
import time
import errno
import stat
import datetime
import socket
import struct
import atexit
import logging
#from lru import LRUCacheDict
from logging import handlers
from task_manager import Job, taskManage
from ctypes import *
from urlparse import *
from m... | #!/usr/bin/env python
import os
import sys
import time
import errno
import stat
import datetime
import socket
import struct
import atexit
import logging
#from lru import LRUCacheDict
from logging import handlers
from task_manager import Job, taskManage
from ctypes import *
from urlparse import *
from multiprocessing ... | en | 0.439934 | #!/usr/bin/env python #from lru import LRUCacheDict #return "pure domain" # EOF #id #type #length #domain_len #domain #sfx_len #sfx #id #type #length #domain_len #print "will add to task", k, k1, "ok:", d1[k][k1]['20x'], "not_ok:", d1[k][k1]['not_ok'], "err rate:", err_rate #1.0.1: Add conf obj; Add log obj #1.0.2: Mor... | 2.103302 | 2 |
lazyblacksmith/views/ajax/__init__.py | jonathonfletcher/LazyBlacksmith | 49 | 8214 | # -*- encoding: utf-8 -*-
from flask import request
from lazyblacksmith.utils.request import is_xhr
import logging
logger = logging.getLogger('lb.ajax')
def is_not_ajax():
"""
Return True if request is not ajax
This function is used in @cache annotation
to not cache direct call (http 40... | # -*- encoding: utf-8 -*-
from flask import request
from lazyblacksmith.utils.request import is_xhr
import logging
logger = logging.getLogger('lb.ajax')
def is_not_ajax():
"""
Return True if request is not ajax
This function is used in @cache annotation
to not cache direct call (http 40... | en | 0.679123 | # -*- encoding: utf-8 -*- Return True if request is not ajax
This function is used in @cache annotation
to not cache direct call (http 403) | 2.349487 | 2 |
src/automata_learning_with_policybank/Traces.py | logic-and-learning/AdvisoRL | 4 | 8215 | import os
class Traces:
def __init__(self, positive = set(), negative = set()):
self.positive = positive
self.negative = negative
"""
IG: at the moment we are adding a trace only if it ends up in an event.
should we be more restrictive, e.g. consider xxx, the same as xxxxxxxxxx (wher... | import os
class Traces:
def __init__(self, positive = set(), negative = set()):
self.positive = positive
self.negative = negative
"""
IG: at the moment we are adding a trace only if it ends up in an event.
should we be more restrictive, e.g. consider xxx, the same as xxxxxxxxxx (wher... | en | 0.865185 | IG: at the moment we are adding a trace only if it ends up in an event. should we be more restrictive, e.g. consider xxx, the same as xxxxxxxxxx (where x is an empty event '') recent suggestion (from the meeting): ignore empty events altogether and don't consider them as events at all (neither for execut... | 3.563266 | 4 |
example/comp/urls.py | edwilding/django-comments-xtd | 0 | 8216 | import django
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
if django.VERSION[:2] > (1, 9):
from django.views.i18n import JavaScriptCatalog
else:
from django.views.i18n import javas... | import django
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
if django.VERSION[:2] > (1, 9):
from django.views.i18n import JavaScriptCatalog
else:
from django.views.i18n import javas... | none | 1 | 1.879492 | 2 | |
09_multiprocessing/prime_validation/primes_factor_test.py | jumploop/high_performance_python | 0 | 8217 | <filename>09_multiprocessing/prime_validation/primes_factor_test.py<gh_stars>0
import math
import time
def check_prime(n):
if n % 2 == 0:
return False, 2
for i in range(3, int(math.sqrt(n)) + 1):
if n % i == 0:
return False, i
return True, None
if __name__ == "__main__":
... | <filename>09_multiprocessing/prime_validation/primes_factor_test.py<gh_stars>0
import math
import time
def check_prime(n):
if n % 2 == 0:
return False, 2
for i in range(3, int(math.sqrt(n)) + 1):
if n % i == 0:
return False, i
return True, None
if __name__ == "__main__":
... | en | 0.535439 | # 100109100129100151 big prime # http://primes.utm.edu/curios/page.php/100109100129100151.html # number_range = xrange(100109100129100153, 100109100129101238, 2) # new expensive near-primes # [(95362951, (100109100129100369, 7.254560947418213)) # (171656941, (100109100129101027, 13.052711009979248)) # (121344023, (100... | 2.728615 | 3 |
python/test/test_dynamic_bitset.py | hagabb/katana | 0 | 8218 | import pytest
from katana.dynamic_bitset import DynamicBitset
__all__ = []
SIZE = 50
@pytest.fixture
def dbs():
return DynamicBitset(SIZE)
def test_set(dbs):
dbs[10] = 1
assert dbs[10]
def test_set_invalid_type(dbs):
try:
dbs[2.3] = 0
assert False
except TypeError:
p... | import pytest
from katana.dynamic_bitset import DynamicBitset
__all__ = []
SIZE = 50
@pytest.fixture
def dbs():
return DynamicBitset(SIZE)
def test_set(dbs):
dbs[10] = 1
assert dbs[10]
def test_set_invalid_type(dbs):
try:
dbs[2.3] = 0
assert False
except TypeError:
p... | none | 1 | 2.164011 | 2 | |
tests/basic/test_basic.py | kopp/python-astar | 133 | 8219 | import unittest
import astar
class BasicTests(unittest.TestCase):
def test_bestpath(self):
"""ensure that we take the shortest path, and not the path with less elements.
the path with less elements is A -> B with a distance of 100
the shortest path is A -> C -> D -> B with a distanc... | import unittest
import astar
class BasicTests(unittest.TestCase):
def test_bestpath(self):
"""ensure that we take the shortest path, and not the path with less elements.
the path with less elements is A -> B with a distance of 100
the shortest path is A -> C -> D -> B with a distanc... | en | 0.940567 | ensure that we take the shortest path, and not the path with less elements. the path with less elements is A -> B with a distance of 100 the shortest path is A -> C -> D -> B with a distance of 60 | 3.804317 | 4 |
potions.py | abdza/skyrim_formulas | 0 | 8220 | #!/bin/env python3
import csv
def intersect(list1,list2):
list3 = [ value for value in list1 if value in list2]
return list3
def category(list1,effects):
cat = 'Good'
good = 0
bad = 0
for ing in list1:
if effects[ing]=='Good':
good += 1
else:
bad += 1
... | #!/bin/env python3
import csv
def intersect(list1,list2):
list3 = [ value for value in list1 if value in list2]
return list3
def category(list1,effects):
cat = 'Good'
good = 0
bad = 0
for ing in list1:
if effects[ing]=='Good':
good += 1
else:
bad += 1
... | ru | 0.167759 | #!/bin/env python3 | 3.36262 | 3 |
src/clients/ctm_api_client/models/user_additional_properties.py | IceT-M/ctm-python-client | 5 | 8221 | # coding: utf-8
"""
Control-M Services
Provides access to BMC Control-M Services # noqa: E501
OpenAPI spec version: 9.20.215
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from clients.ctm_api_client.conf... | # coding: utf-8
"""
Control-M Services
Provides access to BMC Control-M Services # noqa: E501
OpenAPI spec version: 9.20.215
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from clients.ctm_api_client.conf... | en | 0.687058 | # coding: utf-8 Control-M Services Provides access to BMC Control-M Services # noqa: E501 OpenAPI spec version: 9.20.215 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen.git # noqa: F401 NOTE: This class is auto generated by the swagger code generator program. Do not... | 1.695197 | 2 |
Tests/Methods/Mesh/Interpolation/test_interpolation.py | harshasunder-1/pyleecan | 2 | 8222 | <filename>Tests/Methods/Mesh/Interpolation/test_interpolation.py<gh_stars>1-10
# -*- coding: utf-8 -*-
import pytest
import numpy as np
from unittest import TestCase
from pyleecan.Classes.CellMat import CellMat
from pyleecan.Classes.MeshSolution import MeshSolution
from pyleecan.Classes.PointMat import PointMat
from ... | <filename>Tests/Methods/Mesh/Interpolation/test_interpolation.py<gh_stars>1-10
# -*- coding: utf-8 -*-
import pytest
import numpy as np
from unittest import TestCase
from pyleecan.Classes.CellMat import CellMat
from pyleecan.Classes.MeshSolution import MeshSolution
from pyleecan.Classes.PointMat import PointMat
from ... | en | 0.708302 | # -*- coding: utf-8 -*- Tests for interpolation method # Simulate a 3D vector field for 120 time step # Simulate a 3D vector field for 120 time step # Simulate a 3D vector field for 120 time step | 2.362566 | 2 |
lib/models.py | ecarg/grace | 7 | 8223 | # -*- coding: utf-8 -*-
"""
Pytorch models
__author__ = 'Jamie (<EMAIL>)'
__copyright__ = 'No copyright. Just copyleft!'
"""
# pylint: disable=no-member
# pylint: disable=invalid-name
###########
# imports #
###########
import torch
import torch.nn as nn
from embedder import Embedder
from pos_models import PosTag... | # -*- coding: utf-8 -*-
"""
Pytorch models
__author__ = 'Jamie (<EMAIL>)'
__copyright__ = 'No copyright. Just copyleft!'
"""
# pylint: disable=no-member
# pylint: disable=invalid-name
###########
# imports #
###########
import torch
import torch.nn as nn
from embedder import Embedder
from pos_models import PosTag... | en | 0.513864 | # -*- coding: utf-8 -*- Pytorch models __author__ = 'Jamie (<EMAIL>)' __copyright__ = 'No copyright. Just copyleft!' # pylint: disable=no-member # pylint: disable=invalid-name ########### # imports # ########### # pylint: disable=unused-import ############# # Ner Class # ############# named entity recognizer pytorch mo... | 2.722874 | 3 |
pyseqlogo/__init__.py | BioGeek/pyseqlogo | 24 | 8224 | <filename>pyseqlogo/__init__.py
# -*- coding: utf-8 -*-
"""Top-level package for pyseqlogo."""
__author__ = """<NAME>"""
__email__ = '<EMAIL>'
__version__ = '0.1.0'
from .pyseqlogo import draw_logo
from .pyseqlogo import setup_axis
| <filename>pyseqlogo/__init__.py
# -*- coding: utf-8 -*-
"""Top-level package for pyseqlogo."""
__author__ = """<NAME>"""
__email__ = '<EMAIL>'
__version__ = '0.1.0'
from .pyseqlogo import draw_logo
from .pyseqlogo import setup_axis
| en | 0.70263 | # -*- coding: utf-8 -*- Top-level package for pyseqlogo. <NAME> | 1.153367 | 1 |
setup.py | edulix/apscheduler | 0 | 8225 | # coding: utf-8
import os.path
try:
from setuptools import setup
extras = dict(zip_safe=False, test_suite='nose.collector', tests_require=['nose'])
except ImportError:
from distutils.core import setup
extras = {}
import apscheduler
here = os.path.dirname(__file__)
readme_path = os.path.join(here, 'R... | # coding: utf-8
import os.path
try:
from setuptools import setup
extras = dict(zip_safe=False, test_suite='nose.collector', tests_require=['nose'])
except ImportError:
from distutils.core import setup
extras = {}
import apscheduler
here = os.path.dirname(__file__)
readme_path = os.path.join(here, 'R... | en | 0.833554 | # coding: utf-8 | 1.352301 | 1 |
object_detection/exporter_test.py | travisyates81/object-detection | 1 | 8226 | <reponame>travisyates81/object-detection
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# <NAME>
"""Tests for object_detection.export_inference_graph."""
import os
import mock
import numpy as np
import tensorflow as tf
from object_detection import exporter
from object_detection.builders import model_b... | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# <NAME>
"""Tests for object_detection.export_inference_graph."""
import os
import mock
import numpy as np
import tensorflow as tf
from object_detection import exporter
from object_detection.builders import model_builder
from object_detection.core import ... | en | 0.747133 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # <NAME> Tests for object_detection.export_inference_graph. | 2.177202 | 2 |
run.py | matthewyoung28/macmentum | 0 | 8227 | import os
import sys
import random
def get_next_wallpaper(curr_path):
lst_dir = os.listdir()
rand_index = random.randint(0, len(lst_dir) - 1)
return lst_dir[rand_index]
def get_wall_dir():
return "/Users/MYOUNG/Pictures/mmt"
def main():
script = "osascript -e 'tell application \"Finder\" to s... | import os
import sys
import random
def get_next_wallpaper(curr_path):
lst_dir = os.listdir()
rand_index = random.randint(0, len(lst_dir) - 1)
return lst_dir[rand_index]
def get_wall_dir():
return "/Users/MYOUNG/Pictures/mmt"
def main():
script = "osascript -e 'tell application \"Finder\" to s... | en | 0.169379 | # print("FILE = ", file) # print("SCRIPT = ", script) | 2.771834 | 3 |
noxfile.py | dolfno/mlops_demo | 0 | 8228 | """Automated CI tools to run with Nox"""
import nox
from nox import Session
locations = "src", "noxfile.py", "docs/conf.py"
nox.options.sessions = "lint", "tests"
@nox.session(python="3.9")
def tests(session: Session) -> None:
"""Run tests with nox"""
session.run("poetry", "install", external=True)
sessi... | """Automated CI tools to run with Nox"""
import nox
from nox import Session
locations = "src", "noxfile.py", "docs/conf.py"
nox.options.sessions = "lint", "tests"
@nox.session(python="3.9")
def tests(session: Session) -> None:
"""Run tests with nox"""
session.run("poetry", "install", external=True)
sessi... | en | 0.79862 | Automated CI tools to run with Nox Run tests with nox Run linting with nox Run black with nox Run the static type checker. Run typeguard for type checking with nox Build the documentation. Upload coverage data. | 2.380755 | 2 |
cocotb_test/run.py | canerbulduk/cocotb-test | 0 | 8229 |
import cocotb_test.simulator
# For partial back compatibility
def run(simulator=None, **kwargs):
if simulator:
sim = simulator(**kwargs)
sim.run()
else:
cocotb_test.simulator.run(**kwargs)
|
import cocotb_test.simulator
# For partial back compatibility
def run(simulator=None, **kwargs):
if simulator:
sim = simulator(**kwargs)
sim.run()
else:
cocotb_test.simulator.run(**kwargs)
| en | 0.606338 | # For partial back compatibility | 1.679216 | 2 |
kanban_backend/project_management/apps.py | hamzabouissi/kanban_backend | 0 | 8230 | <filename>kanban_backend/project_management/apps.py
from django.apps import AppConfig
class ProjectManagementConfig(AppConfig):
name = 'kanban_backend.project_management'
def ready(self):
try:
import kanban_backend.users.signals # noqa F401
except ImportError:
pass
| <filename>kanban_backend/project_management/apps.py
from django.apps import AppConfig
class ProjectManagementConfig(AppConfig):
name = 'kanban_backend.project_management'
def ready(self):
try:
import kanban_backend.users.signals # noqa F401
except ImportError:
pass
| uz | 0.378174 | # noqa F401 | 1.217828 | 1 |
src/framework/tracing.py | davidhozic/Discord-Shiller | 12 | 8231 | <reponame>davidhozic/Discord-Shiller
"""
~ Tracing ~
This modules containes functions and classes
related to the console debug long or trace.
"""
from enum import Enum, auto
import time
__all__ = (
"TraceLEVELS",
"trace"
)
m_use_debug = None
class TraceLEVELS(Enum):
"""
Info: Level ... | """
~ Tracing ~
This modules containes functions and classes
related to the console debug long or trace.
"""
from enum import Enum, auto
import time
__all__ = (
"TraceLEVELS",
"trace"
)
m_use_debug = None
class TraceLEVELS(Enum):
"""
Info: Level of trace for debug
"""
NORMAL... | en | 0.516125 | ~ Tracing ~ This modules containes functions and classes related to the console debug long or trace. Info: Level of trace for debug " Name : trace Param: - message : str = Trace message - level : TraceLEVELS = Level of the trace | 2.901532 | 3 |
sunkit_image/__init__.py | jeffreypaul15/sunkit-image | 0 | 8232 | <gh_stars>0
"""
sunkit-image
============
A image processing toolbox for Solar Physics.
* Homepage: https://sunpy.org
* Documentation: https://sunkit-image.readthedocs.io/en/latest/
"""
import sys
from .version import version as __version__ # NOQA
# Enforce Python version check during package import.
__minimum_pyt... | """
sunkit-image
============
A image processing toolbox for Solar Physics.
* Homepage: https://sunpy.org
* Documentation: https://sunkit-image.readthedocs.io/en/latest/
"""
import sys
from .version import version as __version__ # NOQA
# Enforce Python version check during package import.
__minimum_python_version_... | en | 0.748881 | sunkit-image ============ A image processing toolbox for Solar Physics. * Homepage: https://sunpy.org * Documentation: https://sunkit-image.readthedocs.io/en/latest/ # NOQA # Enforce Python version check during package import. Running on an unsupported version of Python. # This has to be .format to keep backwards com... | 2.548037 | 3 |
app/view.py | lucasblazzi/stocker | 0 | 8233 | <gh_stars>0
import plotly.graph_objects as go
import plotly.express as px
import pandas as pd
class View:
def __init__(self, st):
self.st = st
self.st.set_page_config(layout='wide')
self.side_bar = st.sidebar
def show_message(self, location, _type, message):
if location == "sb"... | import plotly.graph_objects as go
import plotly.express as px
import pandas as pd
class View:
def __init__(self, st):
self.st = st
self.st.set_page_config(layout='wide')
self.side_bar = st.sidebar
def show_message(self, location, _type, message):
if location == "sb":
... | ru | 0.094472 | # **{company.get('name', ' ')} ({company.get('symbol', ' ')})**") | 2.632679 | 3 |
ch_4/stopping_length.py | ProhardONE/python_primer | 51 | 8234 | # Exercise 4.11
# Author: <NAME>
import sys
g = 9.81 # acceleration due to gravity
try:
# initial velocity (convert to m/s)
v0 = (1000. / 3600) * float(sys.argv[1])
mu = float(sys.argv[2]) # coefficient of friction
except IndexError:
print 'Both v0 (in km/s) and mu must be supplied on the command li... | # Exercise 4.11
# Author: <NAME>
import sys
g = 9.81 # acceleration due to gravity
try:
# initial velocity (convert to m/s)
v0 = (1000. / 3600) * float(sys.argv[1])
mu = float(sys.argv[2]) # coefficient of friction
except IndexError:
print 'Both v0 (in km/s) and mu must be supplied on the command li... | en | 0.641024 | # Exercise 4.11 # Author: <NAME> # acceleration due to gravity # initial velocity (convert to m/s) # coefficient of friction Sample run: python stopping_length.py 120 0.3 188.771850342 python stopping_length.py 50 0.3 32.7728906843 | 3.613799 | 4 |
TestFiles/volumioTest.py | GeorgeIoak/Oden | 0 | 8235 | <filename>TestFiles/volumioTest.py
# Testing code to check update status on demand
from socketIO_client import SocketIO, LoggingNamespace
from threading import Thread
socketIO = SocketIO('localhost', 3000)
status = 'pause'
def on_push_state(*args):
print('state', args)
global status, position, duratio... | <filename>TestFiles/volumioTest.py
# Testing code to check update status on demand
from socketIO_client import SocketIO, LoggingNamespace
from threading import Thread
socketIO = SocketIO('localhost', 3000)
status = 'pause'
def on_push_state(*args):
print('state', args)
global status, position, duratio... | en | 0.758049 | # Testing code to check update status on demand # issue this and the socketIO.wait in the background will push the reply | 2.511271 | 3 |
examples/DeepWisdom/Auto_NLP/deepWisdom/transformers_/__init__.py | zichuan-scott-xu/automl-workflow | 3 | 8236 | __version__ = "2.1.1"
# Work around to update TensorFlow's absl.logging threshold which alters the
# default Python logging output behavior when present.
# see: https://github.com/abseil/abseil-py/issues/99
# and: https://github.com/tensorflow/tensorflow/issues/26691#issuecomment-500369493
try:
import absl.logging... | __version__ = "2.1.1"
# Work around to update TensorFlow's absl.logging threshold which alters the
# default Python logging output behavior when present.
# see: https://github.com/abseil/abseil-py/issues/99
# and: https://github.com/tensorflow/tensorflow/issues/26691#issuecomment-500369493
try:
import absl.logging... | en | 0.698146 | # Work around to update TensorFlow's absl.logging threshold which alters the # default Python logging output behavior when present. # see: https://github.com/abseil/abseil-py/issues/99 # and: https://github.com/tensorflow/tensorflow/issues/26691#issuecomment-500369493 # pylint: disable=invalid-name # Files and general ... | 1.9828 | 2 |
src/use-model.py | sofieditmer/self-assigned | 0 | 8237 | #!/usr/bin/env python
"""
Info: This script loads the model trained in the cnn-asl.py script and enables the user to use it for classifying unseen ASL letters. It also visualizes the feature map of the last convolutional layer of the network to enable the user to get an insight into exactly which parts of the original ... | #!/usr/bin/env python
"""
Info: This script loads the model trained in the cnn-asl.py script and enables the user to use it for classifying unseen ASL letters. It also visualizes the feature map of the last convolutional layer of the network to enable the user to get an insight into exactly which parts of the original ... | en | 0.777998 | #!/usr/bin/env python Info: This script loads the model trained in the cnn-asl.py script and enables the user to use it for classifying unseen ASL letters. It also visualizes the feature map of the last convolutional layer of the network to enable the user to get an insight into exactly which parts of the original imag... | 3.415819 | 3 |
examples/hello_world/src/Algorithm.py | algorithmiaio/algorithmia-adk-python | 4 | 8238 | from Algorithmia import ADK
# API calls will begin at the apply() method, with the request body passed as 'input'
# For more details, see algorithmia.com/developers/algorithm-development/languages
def apply(input):
# If your apply function uses state that's loaded into memory via load, you can pass that loaded s... | from Algorithmia import ADK
# API calls will begin at the apply() method, with the request body passed as 'input'
# For more details, see algorithmia.com/developers/algorithm-development/languages
def apply(input):
# If your apply function uses state that's loaded into memory via load, you can pass that loaded s... | en | 0.878675 | # API calls will begin at the apply() method, with the request body passed as 'input' # For more details, see algorithmia.com/developers/algorithm-development/languages # If your apply function uses state that's loaded into memory via load, you can pass that loaded state to your apply # function by defining an addition... | 3.362922 | 3 |
src/gluonts/nursery/autogluon_tabular/estimator.py | Xiaoxiong-Liu/gluon-ts | 2,648 | 8239 | # Copyright 2018 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | # Copyright 2018 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | en | 0.859786 | # Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license... | 2.571231 | 3 |
src/dcar/errors.py | andreas19/dcar | 1 | 8240 | <filename>src/dcar/errors.py
"""Errors module."""
__all__ = [
'Error',
'AddressError',
'AuthenticationError',
'TransportError',
'ValidationError',
'RegisterError',
'MessageError',
'DBusError',
'SignatureError',
'TooLongError',
]
class Error(Exception):
"""Base class."""
... | <filename>src/dcar/errors.py
"""Errors module."""
__all__ = [
'Error',
'AddressError',
'AuthenticationError',
'TransportError',
'ValidationError',
'RegisterError',
'MessageError',
'DBusError',
'SignatureError',
'TooLongError',
]
class Error(Exception):
"""Base class."""
... | en | 0.832178 | Errors module. Base class. Raised for errors in server addresses. Raised when authentication failed. Raised for transport related errors. Raised when validation failed. Raised when a signal or method could not be registered. Raised for errors in messages. Raised for errors from ERROR messages. Raised for errors in sign... | 2.538429 | 3 |
Packs/CortexXDR/Integrations/XDR_iocs/XDR_iocs_test.py | SergeBakharev/content | 1 | 8241 | from XDR_iocs import *
import pytest
from freezegun import freeze_time
Client.severity = 'INFO'
client = Client({'url': 'test'})
def d_sort(in_dict):
return sorted(in_dict.items())
class TestGetHeaders:
@freeze_time('2020-06-01T00:00:00Z')
def test_sanity(self, mocker):
"""
Given:
... | from XDR_iocs import *
import pytest
from freezegun import freeze_time
Client.severity = 'INFO'
client = Client({'url': 'test'})
def d_sort(in_dict):
return sorted(in_dict.items())
class TestGetHeaders:
@freeze_time('2020-06-01T00:00:00Z')
def test_sanity(self, mocker):
"""
Given:
... | en | 0.418577 | Given: - API key - API key ID Then: - Verify headers created correct. # noqa: E501 Given: Empty params Then: get_headers will not raise error # noqa: E501 # noqa: E501 Given: - Status code When:... | 2.234555 | 2 |
project/users/models.py | rchdlps/django-docker | 0 | 8242 | <gh_stars>0
from django.contrib.auth.models import AbstractUser
from django.db.models import CharField
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from django.db import models
from PIL import Image
class User(AbstractUser):
# First Name and Last Name do not cover name ... | from django.contrib.auth.models import AbstractUser
from django.db.models import CharField
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from django.db import models
from PIL import Image
class User(AbstractUser):
# First Name and Last Name do not cover name patterns
... | en | 0.277904 | # First Name and Last Name do not cover name patterns # around the globe. # Profile Models def save(self): super().save() img = Image.open(self.image.path) if img.height > 300 or img.width > 300: output_size = (300, 300) img.thumbnail(output_size) img.save(s... | 2.298902 | 2 |
cloudify_terminal_sdk/netconf_connection.py | cloudify-incubator/cloudify-plugins-sdk | 1 | 8243 | <reponame>cloudify-incubator/cloudify-plugins-sdk
# Copyright (c) 2015-2020 Cloudify Platform Ltd. 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.apa... | # Copyright (c) 2015-2020 Cloudify Platform Ltd. 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 b... | en | 0.882232 | # Copyright (c) 2015-2020 Cloudify Platform Ltd. 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 b... | 1.922966 | 2 |
Seismic_Conv1D_dec.py | dyt1990/Seis_DCEC | 1 | 8244 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 19 17:48:13 2018
@author: Sediment
"""
# -*- coding: utf-8 -*-
'''
Keras implementation of deep embedder to improve clustering, inspired by:
"Unsupervised Deep Embedding for Clustering Analysis" (Xie et al, ICML 2016)
Definition can accept som... | # -*- coding: utf-8 -*-
"""
Created on Sun Aug 19 17:48:13 2018
@author: Sediment
"""
# -*- coding: utf-8 -*-
'''
Keras implementation of deep embedder to improve clustering, inspired by:
"Unsupervised Deep Embedding for Clustering Analysis" (Xie et al, ICML 2016)
Definition can accept somewhat custom ne... | en | 0.707035 | # -*- coding: utf-8 -*- Created on Sun Aug 19 17:48:13 2018
@author: Sediment # -*- coding: utf-8 -*- Keras implementation of deep embedder to improve clustering, inspired by:
"Unsupervised Deep Embedding for Clustering Analysis" (Xie et al, ICML 2016)
Definition can accept somewhat custom neural networks. Defau... | 2.440138 | 2 |
ppq/utils/round.py | xiguadong/ppq | 0 | 8245 | from decimal import ROUND_HALF_DOWN, ROUND_HALF_EVEN, ROUND_HALF_UP, Decimal
from math import ceil, floor, log2
from typing import Union
import torch
from ppq.core import RoundingPolicy
def ppq_numerical_round(value: float,
policy: RoundingPolicy=RoundingPolicy.ROUND_HALF_EVEN) -> int:
"""
reference... | from decimal import ROUND_HALF_DOWN, ROUND_HALF_EVEN, ROUND_HALF_UP, Decimal
from math import ceil, floor, log2
from typing import Union
import torch
from ppq.core import RoundingPolicy
def ppq_numerical_round(value: float,
policy: RoundingPolicy=RoundingPolicy.ROUND_HALF_EVEN) -> int:
"""
reference... | en | 0.730482 | reference: https://en.wikipedia.org/wiki/Rounding decimal defination: - decimal.ROUND_CEILING (towards Infinity) - decimal.ROUND_DOWN (towards zero) - decimal.ROUND_FLOOR (towards -Infinity) - decimal.ROUND_HALF_DOWN (to nearest with ties going towards ze... | 2.972526 | 3 |
python/repair/train.py | maropu/scavenger | 0 | 8246 | <filename>python/repair/train.py
#!/usr/bin/env python3
#
# 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 Apac... | <filename>python/repair/train.py
#!/usr/bin/env python3
#
# 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 Apac... | en | 0.740132 | #!/usr/bin/env python3 # # 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 "Li... | 1.861578 | 2 |
howl/roomsensor/urls.py | volzotan/django-howl | 0 | 8247 | from django.conf.urls import patterns, url
from roomsensor import views
urlpatterns = patterns('',
url(r'^$', views.index, name='roomsensor'),
# ex: /roomsensor/name/
url(r'^(?P<roomsensor_name>\w+)/$', views.display, name='roomsensor_display'),
url(r'^(?P<roomsensor_name>\w+)/read/$', views.read, na... | from django.conf.urls import patterns, url
from roomsensor import views
urlpatterns = patterns('',
url(r'^$', views.index, name='roomsensor'),
# ex: /roomsensor/name/
url(r'^(?P<roomsensor_name>\w+)/$', views.display, name='roomsensor_display'),
url(r'^(?P<roomsensor_name>\w+)/read/$', views.read, na... | en | 0.634116 | # ex: /roomsensor/name/ # JSON data for graph creation | 2.097435 | 2 |
main.py | vu-telab/DAKOTA-moga-post-processing-tool | 0 | 8248 | # main.py
#
# currently just an example script I use to test my optimization_results module
#
# WARNING: design point numbers 0-indexed in pandas database, but
# eval_id column is the original 1-indexed value given by DAKOTA
import optimization_results as optr
def main():
a4 = optr.MogaOptimizationResults()
... | # main.py
#
# currently just an example script I use to test my optimization_results module
#
# WARNING: design point numbers 0-indexed in pandas database, but
# eval_id column is the original 1-indexed value given by DAKOTA
import optimization_results as optr
def main():
a4 = optr.MogaOptimizationResults()
... | en | 0.673668 | # main.py # # currently just an example script I use to test my optimization_results module # # WARNING: design point numbers 0-indexed in pandas database, but # eval_id column is the original 1-indexed value given by DAKOTA ### OLD MATLAB CODE I NEED TO REWORK ### # # read force and atan accuracy objectives from # # a... | 2.162557 | 2 |
Topaz/Core.py | Rhodolite/Gem.py.UnitTest | 0 | 8249 | #
# Copyright (c) 2017 <NAME>. All rights reserved.
#
@gem('Topaz.Core')
def gem():
require_gem('Gem.Global')
from Gem import gem_global
gem_global.testing = true
require_gem('Gem.Cache2')
require_gem('Gem.DumpCache')
require_gem('Gem.GeneratedConjureQuadruple')
require_gem('Gem.Map... | #
# Copyright (c) 2017 <NAME>. All rights reserved.
#
@gem('Topaz.Core')
def gem():
require_gem('Gem.Global')
from Gem import gem_global
gem_global.testing = true
require_gem('Gem.Cache2')
require_gem('Gem.DumpCache')
require_gem('Gem.GeneratedConjureQuadruple')
require_gem('Gem.Map... | en | 0.722818 | # # Copyright (c) 2017 <NAME>. All rights reserved. # # # Imported functions # # # Imported Values # | 1.785374 | 2 |
app.py | kosovojs/wikibooster | 0 | 8250 | <gh_stars>0
import flask
from flask import Flask
from flask import jsonify
from flask import request
from flask_cors import CORS, cross_origin
from flask import render_template
import mwoauth
import requests_oauthlib
import os
import yaml
import mwapi
from tasks.main import Tasks
from save import Save
from db import ... | import flask
from flask import Flask
from flask import jsonify
from flask import request
from flask_cors import CORS, cross_origin
from flask import render_template
import mwoauth
import requests_oauthlib
import os
import yaml
import mwapi
from tasks.main import Tasks
from save import Save
from db import DB
from typ... | en | 0.848101 | #app = Flask(__name__) # user is viewing a batch for a wiki where they do not have a local user account # treat as anonymous on the local wiki, but query Meta to find out if they’re a steward #http://1172.16.17.32:5000/task/lvwiki/1/Helēna Mārnija # # Log the user out by clearing their session. | 2.394401 | 2 |
pre_embed.py | shelleyyyyu/few_shot | 253 | 8251 | import numpy as np
from collections import defaultdict, Counter
import random
import json
from tqdm import tqdm
def transX(dataset):
rel2id = json.load(open(dataset + '/relation2ids'))
ent2id = json.load(open(dataset + '/ent2ids'))
with open('../Fast-TransX/' + dataset + '_base/entity2id.txt', 'w') as... | import numpy as np
from collections import defaultdict, Counter
import random
import json
from tqdm import tqdm
def transX(dataset):
rel2id = json.load(open(dataset + '/relation2ids'))
ent2id = json.load(open(dataset + '/ent2ids'))
with open('../Fast-TransX/' + dataset + '_base/entity2id.txt', 'w') as... | none | 1 | 2.215231 | 2 | |
botc/gamemodes/troublebrewing/FortuneTeller.py | Xinverse/BOTC-Bot | 1 | 8252 | <filename>botc/gamemodes/troublebrewing/FortuneTeller.py<gh_stars>1-10
"""Contains the Fortune Teller Character class"""
import json
import random
import discord
import datetime
from botc import Action, ActionTypes, Townsfolk, Character, Storyteller, RedHerring, \
RecurringAction, Category, StatusList
from botc.B... | <filename>botc/gamemodes/troublebrewing/FortuneTeller.py<gh_stars>1-10
"""Contains the Fortune Teller Character class"""
import json
import random
import discord
import datetime
from botc import Action, ActionTypes, Townsfolk, Character, Storyteller, RedHerring, \
RecurringAction, Category, StatusList
from botc.B... | en | 0.843591 | Contains the Fortune Teller Character class Fortune Teller: Each night, choose 2 players: you learn if either is a Demon. There is 1 good player that registers falsely to you. ===== FORTUNE TELLER ===== true_self = fortune teller ego_self = fortune teller social_self = fortune teller comman... | 2.697974 | 3 |
src/schmetterling/build/tests/test_maven.py | bjuvensjo/schmetterling | 0 | 8253 | <filename>src/schmetterling/build/tests/test_maven.py
from unittest.mock import call, MagicMock, patch
from schmetterling.build.maven import build_multi_modules
from schmetterling.build.maven import create_build_result
from schmetterling.build.maven import create_command
from schmetterling.build.maven import create_mu... | <filename>src/schmetterling/build/tests/test_maven.py
from unittest.mock import call, MagicMock, patch
from schmetterling.build.maven import build_multi_modules
from schmetterling.build.maven import create_build_result
from schmetterling.build.maven import create_command
from schmetterling.build.maven import create_mu... | none | 1 | 2.134487 | 2 | |
Copados y Clases/Mastermind_DEBUG.py | FdelMazo/7540rw-Algo1 | 1 | 8254 | <filename>Copados y Clases/Mastermind_DEBUG.py
#Sacar las lineas con DEBUG para que el juego funcione
import random
DIGITOS = 4
def mastermind():
"""Funcion principal del juego Mastermind"""
print("Bienvenido al Mastermind!")
print("Instrucciones: Tenes que adivinar un codigo de {} digitos distintos. Tu cant... | <filename>Copados y Clases/Mastermind_DEBUG.py
#Sacar las lineas con DEBUG para que el juego funcione
import random
DIGITOS = 4
def mastermind():
"""Funcion principal del juego Mastermind"""
print("Bienvenido al Mastermind!")
print("Instrucciones: Tenes que adivinar un codigo de {} digitos distintos. Tu cant... | es | 0.930579 | #Sacar las lineas con DEBUG para que el juego funcione Funcion principal del juego Mastermind Elige un codigo de DIGITOS digitos al azar Determina aciertos y coincidencias | 3.876134 | 4 |
setup.py | ovnicraft/runa | 5 | 8255 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open("README.rst") as readme_file:
readme = readme_file.read()
with open("HISTORY.rst") as history_file:
history = history_file.read()
requirements = ["Click>=6.0", "suds2==0.7.1"]
setup_... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open("README.rst") as readme_file:
readme = readme_file.read()
with open("HISTORY.rst") as history_file:
history = history_file.read()
requirements = ["Click>=6.0", "suds2==0.7.1"]
setup_... | en | 0.540701 | #!/usr/bin/env python # -*- coding: utf-8 -*- The setup script. # TODO(ovnicraft): put setup requirements (distutils extensions, etc.) here # TODO: put package test requirements here | 1.501855 | 2 |
PyPortal_User_Interface/code.py | RichardA1/Adafruit_Learning_System_Guides | 1 | 8256 | import time
import board
import displayio
import busio
from analogio import AnalogIn
import neopixel
import adafruit_adt7410
from adafruit_bitmap_font import bitmap_font
from adafruit_display_text.label import Label
from adafruit_button import Button
import adafruit_touchscreen
from adafruit_pyportal import PyPortal
#... | import time
import board
import displayio
import busio
from analogio import AnalogIn
import neopixel
import adafruit_adt7410
from adafruit_bitmap_font import bitmap_font
from adafruit_display_text.label import Label
from adafruit_button import Button
import adafruit_touchscreen
from adafruit_pyportal import PyPortal
#... | en | 0.649481 | # ------------- Inputs and Outputs Setup ------------- # # init. the temperature sensor # init. the light sensor # ---------- Sound Effects ------------- # # ------------- Other Helper Functions------------- # # Helper for cycling through a number set of 1 to x. # ------------- Screen Setup ------------- # # Backlight ... | 2.637596 | 3 |
btse_futures/order.py | yottatix/btse-python | 0 | 8257 | import json
from btse_futures.constants import OrderType, Side, TimeInForce
class Order:
"""
Class to represent a BTSE Order
...
Attributes
----------
size : int
order quantity or size. e.g. 1
price : float
price. e.g. 7000.0
side: str
order side. B... | import json
from btse_futures.constants import OrderType, Side, TimeInForce
class Order:
"""
Class to represent a BTSE Order
...
Attributes
----------
size : int
order quantity or size. e.g. 1
price : float
price. e.g. 7000.0
side: str
order side. B... | en | 0.533308 | Class to represent a BTSE Order ... Attributes ---------- size : int order quantity or size. e.g. 1 price : float price. e.g. 7000.0 side: str order side. BUY or SELL time_in_force: str time the order is in force. Possible options defined in Tim... | 2.866748 | 3 |
tests/mock_responses.py | md-reddevil/blinkpy | 0 | 8258 | <filename>tests/mock_responses.py
"""Simple mock responses definitions."""
from blinkpy.helpers.util import BlinkURLHandler
import blinkpy.helpers.constants as const
LOGIN_RESPONSE = {
'region': {'mock': 'Test'},
'networks': {
'1234': {'name': 'test', 'onboarded': True}
},
'authtoken': {'autht... | <filename>tests/mock_responses.py
"""Simple mock responses definitions."""
from blinkpy.helpers.util import BlinkURLHandler
import blinkpy.helpers.constants as const
LOGIN_RESPONSE = {
'region': {'mock': 'Test'},
'networks': {
'1234': {'name': 'test', 'onboarded': True}
},
'authtoken': {'autht... | en | 0.581751 | Simple mock responses definitions. Class for mock request response. Initialize mock get response. Return json data from get_request. Return raw data from get request. Mock session. Mocks URL Handler in blinkpy module. | 2.54078 | 3 |
fits_tools.py | steveschulze/Photometry | 6 | 8259 | from astropy import coordinates as coord
from astropy import wcs
from astropy.io import fits
from astropy import units as u
from misc import bcolors
import numpy as np
import os
def convert_hms_dd(RA, DEC):
'''
Convert HMS to DD system
'''
if (':' in RA) and (':' in DEC):
Coord_dd = coord.SkyCoord(RA, DEC... | from astropy import coordinates as coord
from astropy import wcs
from astropy.io import fits
from astropy import units as u
from misc import bcolors
import numpy as np
import os
def convert_hms_dd(RA, DEC):
'''
Convert HMS to DD system
'''
if (':' in RA) and (':' in DEC):
Coord_dd = coord.SkyCoord(RA, DEC... | en | 0.672526 | Convert HMS to DD system Get keyword from fits file Get pixel scale Coordinate transformation: sky -> xy Coordinate transformation: xy -> sky | 2.555313 | 3 |
test_stbp_snn_eval.py | neurom-iot/n3ml | 11 | 8260 | <reponame>neurom-iot/n3ml
import argparse
import torch
import torch.nn as nn
import torchvision
import torchvision.transforms as transforms
from n3ml.model import DynamicModel_STBP_SNN
def validate(val_loader, model, encoder, criterion, opt):
model.eval()
total_images = 0
num_corrects = 0
total_los... | import argparse
import torch
import torch.nn as nn
import torchvision
import torchvision.transforms as transforms
from n3ml.model import DynamicModel_STBP_SNN
def validate(val_loader, model, encoder, criterion, opt):
model.eval()
total_images = 0
num_corrects = 0
total_loss = 0
with torch.no_g... | none | 1 | 2.217118 | 2 | |
section_07_(files)/read_csv.py | govex/python-lessons | 5 | 8261 | # If you're new to file handling, be sure to check out with_open.py first!
# You'll also want to check out read_text.py before this example. This one is a bit more advanced.
with open('read_csv.csv', 'r') as states_file:
# Instead of leaving the file contents as a string, we're splitting the file into a list... | # If you're new to file handling, be sure to check out with_open.py first!
# You'll also want to check out read_text.py before this example. This one is a bit more advanced.
with open('read_csv.csv', 'r') as states_file:
# Instead of leaving the file contents as a string, we're splitting the file into a list... | en | 0.929894 | # If you're new to file handling, be sure to check out with_open.py first! # You'll also want to check out read_text.py before this example. This one is a bit more advanced. # Instead of leaving the file contents as a string, we're splitting the file into a list at every new line, and we save that list into the variab... | 4.250616 | 4 |
kaggle_melanoma/schedulers.py | tinve/kaggle_melanoma | 8 | 8262 | import math
from torch.optim.lr_scheduler import _LRScheduler
from torch.optim.optimizer import Optimizer
class PolyLR(_LRScheduler):
"""
Sets the learning rate of each parameter group according to poly learning rate policy
"""
def __init__(self, optimizer, max_iter=90000, power=0.9, last_epoch=-1):... | import math
from torch.optim.lr_scheduler import _LRScheduler
from torch.optim.optimizer import Optimizer
class PolyLR(_LRScheduler):
"""
Sets the learning rate of each parameter group according to poly learning rate policy
"""
def __init__(self, optimizer, max_iter=90000, power=0.9, last_epoch=-1):... | en | 0.496475 | Sets the learning rate of each parameter group according to poly learning rate policy # self.base_lrs = list(map(lambda group: group["lr"], optimizer.param_groups))[0] | 2.42872 | 2 |
data/data/__init__.py | PumpkinYing/GAT | 0 | 8263 | from .dataset import load_data | from .dataset import load_data | none | 1 | 1.077111 | 1 | |
utils.py | federicosapienza/InboxNotionTelegramBot | 0 | 8264 | import json
import logging
logger = logging.getLogger(__name__)
with open('configuration.json') as f:
config = json.load(f)
TELEGRAM_TOKEN = config["telegram-bot-token"]
NOTION_TOKEN = config["notion-token"]
NOTION_TABLE_URL = config["inbox_table"]["table_url"]
def check_allowed_user(user_id):
"""
chec... | import json
import logging
logger = logging.getLogger(__name__)
with open('configuration.json') as f:
config = json.load(f)
TELEGRAM_TOKEN = config["telegram-bot-token"]
NOTION_TOKEN = config["notion-token"]
NOTION_TABLE_URL = config["inbox_table"]["table_url"]
def check_allowed_user(user_id):
"""
chec... | en | 0.610377 | check if allowed user :param user_id: telegram user id :return True if user is valid , False otherwise Wrapper for creating a private bot :param handled_action: the action to perform | 2.517031 | 3 |
enaml/core/byteplay/__init__.py | timgates42/enaml | 0 | 8265 | <reponame>timgates42/enaml
#------------------------------------------------------------------------------
# Copyright (c) 2013-2018, Nucleic 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-2018, Nucleic 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.449666 | #------------------------------------------------------------------------------ # Copyright (c) 2013-2018, Nucleic Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #--------------------------------------------... | 1.353228 | 1 |
cassiopeia/datastores/riotapi/match.py | artemigkh/cassiopeia | 1 | 8266 | from time import time
from typing import Type, TypeVar, MutableMapping, Any, Iterable, Generator, Union
import arrow
import datetime
import math
from datapipelines import DataSource, PipelineContext, Query, NotFoundError, validate_query
from .common import RiotAPIService, APINotFoundError
from ...data import Platform... | from time import time
from typing import Type, TypeVar, MutableMapping, Any, Iterable, Generator, Union
import arrow
import datetime
import math
from datapipelines import DataSource, PipelineContext, Query, NotFoundError, validate_query
from .common import RiotAPIService, APINotFoundError
from ...data import Platform... | en | 0.74761 | # type: arrow.Arrow # type: arrow.Arrow Returns either "by_date" or "by_index". # This is an assumption # in units of days | 2.135264 | 2 |
Lib/site-packages/hackedit/vendor/jedi/cache.py | fochoao/cpython | 1 | 8267 | """
This caching is very important for speed and memory optimizations. There's
nothing really spectacular, just some decorators. The following cache types are
available:
- module caching (`load_parser` and `save_parser`), which uses pickle and is
really important to assure low load times of modules like ``numpy``.
-... | """
This caching is very important for speed and memory optimizations. There's
nothing really spectacular, just some decorators. The following cache types are
available:
- module caching (`load_parser` and `save_parser`), which uses pickle and is
really important to assure low load times of modules like ``numpy``.
-... | en | 0.868387 | This caching is very important for speed and memory optimizations. There's nothing really spectacular, just some decorators. The following cache types are available: - module caching (`load_parser` and `save_parser`), which uses pickle and is really important to assure low load times of modules like ``numpy``. - ``t... | 3.196703 | 3 |
sandia_hand/ros/sandia_hand_teleop/simple_grasp/simple_grasp.py | adarshrs/Drone-Simulator-for-ROS-Kinetic | 0 | 8268 | <reponame>adarshrs/Drone-Simulator-for-ROS-Kinetic
#!/usr/bin/env python
#
# Software License Agreement (Apache License)
#
# Copyright 2013 Open Source Robotics Foundation
# Author: <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licen... | #!/usr/bin/env python
#
# Software License Agreement (Apache License)
#
# Copyright 2013 Open Source Robotics Foundation
# Author: <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
#
# ... | en | 0.771973 | #!/usr/bin/env python # # Software License Agreement (Apache License) # # Copyright 2013 Open Source Robotics Foundation # Author: <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 # # ... | 2.097647 | 2 |
ui/ui_prestamo_libros.py | edzzn/Manejo_Liberia | 0 | 8269 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'PrestamoDeLibros.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromU... | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'PrestamoDeLibros.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromU... | en | 0.73915 | # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'PrestamoDeLibros.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! | 1.857017 | 2 |
src/zope/app/content/__init__.py | zopefoundation/zope.app.content | 0 | 8270 | <reponame>zopefoundation/zope.app.content<filename>src/zope/app/content/__init__.py
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# ... | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | en | 0.573087 | ############################################################################## # # Copyright (c) 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF... | 1.89661 | 2 |
python-modules/robcoewmrobotconfigurator/robcoewmrobotconfigurator/run.py | yschiebelhut/ewm-cloud-robotics | 0 | 8271 | <filename>python-modules/robcoewmrobotconfigurator/robcoewmrobotconfigurator/run.py
#!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
#
# This file is part of ewm-cloud-robotics
# (see https://github.com/SAP/ewm-cloud-robotics).
#
# This file is lic... | <filename>python-modules/robcoewmrobotconfigurator/robcoewmrobotconfigurator/run.py
#!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
#
# This file is part of ewm-cloud-robotics
# (see https://github.com/SAP/ewm-cloud-robotics).
#
# This file is lic... | en | 0.721967 | #!/usr/bin/env python3 # encoding: utf-8 # # Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. # # This file is part of ewm-cloud-robotics # (see https://github.com/SAP/ewm-cloud-robotics). # # This file is licensed under the Apache Software License, v. 2 except as noted # otherwise in the LIC... | 2.351717 | 2 |
website/addons/forward/views/__init__.py | DanielSBrown/osf.io | 1 | 8272 | from . import config, widget # noqa
| from . import config, widget # noqa
| none | 1 | 1.071691 | 1 | |
hwtest/automated/usb3_test.py | crvallance/wlanpi-hwtest | 0 | 8273 | from hwtest.shell_utils import run_command
def test_linux_usb3hub():
"""
Test for Linux Foundation 3.0 root hub in `lsusb` output
"""
resp = run_command(["lsusb"])
assert "1d6b:0003" in resp
| from hwtest.shell_utils import run_command
def test_linux_usb3hub():
"""
Test for Linux Foundation 3.0 root hub in `lsusb` output
"""
resp = run_command(["lsusb"])
assert "1d6b:0003" in resp
| en | 0.66985 | Test for Linux Foundation 3.0 root hub in `lsusb` output | 1.951249 | 2 |
ninjabackend.py | tp-m/meson | 0 | 8274 | # Copyright 2012-2014 The Meson development team
# 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 agree... | # Copyright 2012-2014 The Meson development team
# 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 agree... | en | 0.889518 | # Copyright 2012-2014 The Meson development team # 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 t... | 1.907139 | 2 |
tests/strategies/common/test_cputime.py | y-tetsu/othello | 10 | 8275 | """Tests of cputime.py
"""
import unittest
from reversi.strategies.common import CPU_TIME
class TestCputime(unittest.TestCase):
"""cputime
"""
def test_cputime(self):
self.assertEqual(CPU_TIME, 0.5)
| """Tests of cputime.py
"""
import unittest
from reversi.strategies.common import CPU_TIME
class TestCputime(unittest.TestCase):
"""cputime
"""
def test_cputime(self):
self.assertEqual(CPU_TIME, 0.5)
| en | 0.526849 | Tests of cputime.py cputime | 2.305937 | 2 |
experiments/cifar10_recon.py | coopersigrist/RecurrentNeuralSystem- | 3 | 8276 | <reponame>coopersigrist/RecurrentNeuralSystem-
# -*- coding: utf-8 -*-
"""ReNS experiments - CIFAR10
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1byZ4xTfCK2x1Rhkxpl-Vv4sqA-bo4bis
# SETUP
"""
#@title Insatlling Pyorch
# !pip install torch
# !pip i... | # -*- coding: utf-8 -*-
"""ReNS experiments - CIFAR10
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1byZ4xTfCK2x1Rhkxpl-Vv4sqA-bo4bis
# SETUP
"""
#@title Insatlling Pyorch
# !pip install torch
# !pip install torchvision
#@title Import Dependencies... | en | 0.592041 | # -*- coding: utf-8 -*- ReNS experiments - CIFAR10 Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1byZ4xTfCK2x1Rhkxpl-Vv4sqA-bo4bis # SETUP #@title Insatlling Pyorch # !pip install torch # !pip install torchvision #@title Import Dependencies # TRAININ... | 2.436215 | 2 |
horizon/forms/__init__.py | ameoba/horizon | 2 | 8277 | <gh_stars>1-10
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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/L... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ... | en | 0.771797 | # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Nebula, 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 # # ... | 1.196175 | 1 |
heat/tests/test_rpc_listener_client.py | noironetworks/heat | 1 | 8278 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | en | 0.859194 | # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the... | 2.174883 | 2 |
amadeus/travel/trip_parser_jobs/_status.py | akshitsingla/amadeus-python | 125 | 8279 | <reponame>akshitsingla/amadeus-python<gh_stars>100-1000
from amadeus.client.decorator import Decorator
class TripParserStatus(Decorator, object):
def __init__(self, client, job_id):
Decorator.__init__(self, client)
self.job_id = job_id
def get(self, **params):
'''
Returns the ... | from amadeus.client.decorator import Decorator
class TripParserStatus(Decorator, object):
def __init__(self, client, job_id):
Decorator.__init__(self, client)
self.job_id = job_id
def get(self, **params):
'''
Returns the parsing status and the link to the result
in cas... | en | 0.57136 | Returns the parsing status and the link to the result in case of successful parsing. .. code-block:: python amadeus.travel.trip_parser_jobs.status('XXX').get :rtype: amadeus.Response :raises amadeus.ResponseError: if the request could not be completed | 2.625707 | 3 |
tools/third_party/iniconfig/testing/test_iniconfig.py | meyerweb/wpt | 2,479 | 8280 | <gh_stars>1000+
import py
import pytest
from iniconfig import IniConfig, ParseError, __all__ as ALL
from iniconfig import iscommentline
from textwrap import dedent
check_tokens = {
'section': (
'[section]',
[(0, 'section', None, None)]
),
'value': (
'value = 1',
[(0, None, ... | import py
import pytest
from iniconfig import IniConfig, ParseError, __all__ as ALL
from iniconfig import iscommentline
from textwrap import dedent
check_tokens = {
'section': (
'[section]',
[(0, 'section', None, None)]
),
'value': (
'value = 1',
[(0, None, 'value', '1')]
... | en | 0.630085 | #comment', # only for testing purposes - _parse() does not use state except path [section1] value=1 [section2] value=2 [section1] value=1 [section2] value=2 [section2] #cpython dict ordered before section value = 1 value2 = 2 # dict ordered before value [secti... | 2.486889 | 2 |
jskparser/jskparser/util.py | natebragg/java-sketch | 15 | 8281 | import os
from subprocess import call
from . import glob2
pwd = os.path.dirname(__file__)
def get_files_from_path(path, ext):
# use set to remove duplicate files. weird...but it happens
if os.path.isfile(path): return set([os.path.abspath(path)])
else: # i.e., folder
files = glob2.glob(os.path.a... | import os
from subprocess import call
from . import glob2
pwd = os.path.dirname(__file__)
def get_files_from_path(path, ext):
# use set to remove duplicate files. weird...but it happens
if os.path.isfile(path): return set([os.path.abspath(path)])
else: # i.e., folder
files = glob2.glob(os.path.a... | en | 0.814609 | # use set to remove duplicate files. weird...but it happens # i.e., folder # to guarantee the order of files read handling javajskparser AST # this classpath stuff seems awful. Jsonify is hardcoded, passing a # single string to subprocess.call is platform dependant, and shell=True # can be a security vulnerability (if ... | 2.613084 | 3 |
fiftyone/core/patches.py | SNeugber/fiftyone | 0 | 8282 | """
Patches views.
| Copyright 2017-2021, Voxel51, Inc.
| `voxel51.com <https://voxel51.com/>`_
|
"""
from copy import deepcopy
import eta.core.utils as etau
import fiftyone.core.aggregations as foa
import fiftyone.core.dataset as fod
import fiftyone.core.fields as fof
import fiftyone.core.labels as fol
import fifty... | """
Patches views.
| Copyright 2017-2021, Voxel51, Inc.
| `voxel51.com <https://voxel51.com/>`_
|
"""
from copy import deepcopy
import eta.core.utils as etau
import fiftyone.core.aggregations as foa
import fiftyone.core.dataset as fod
import fiftyone.core.fields as fof
import fiftyone.core.labels as fol
import fifty... | en | 0.877297 | Patches views. | Copyright 2017-2021, Voxel51, Inc. | `voxel51.com <https://voxel51.com/>`_ | A patch in a :class:`PatchesView`. :class:`PatchView` instances should not be created manually; they are generated by iterating over :class:`PatchesView` instances. Args: doc: a :class:`fiftyone.core.odm... | 1.944527 | 2 |
{{cookiecutter.repo_name}}/setup.py | ocesaulo/cookiecutter-ocn_sci | 0 | 8283 | <filename>{{cookiecutter.repo_name}}/setup.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
{%- set license_classifiers = {
'MIT license': 'License :: OSI Approved :: MIT ... | <filename>{{cookiecutter.repo_name}}/setup.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
{%- set license_classifiers = {
'MIT license': 'License :: OSI Approved :: MIT ... | en | 0.636109 | #!/usr/bin/env python # -*- coding: utf-8 -*- The setup script. # get the dependencies and installs # package requirements go here | 1.545547 | 2 |
src/zope/app/debug/debug.py | zopefoundation/zope.app.debug | 0 | 8284 | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | en | 0.526207 | ############################################################################## # # Copyright (c) 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF... | 1.980211 | 2 |
transfer_learning.py | terryli710/SIIM-ACR-Pneumothorax-Classification | 0 | 8285 | <reponame>terryli710/SIIM-ACR-Pneumothorax-Classification
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 18 22:42:54 2020
@author: mike
"""
import numpy as np
import tensorflow as tf
from tensorflow import keras
from sklearn.model_selection import train_test_split
from tensorflow.keras.applica... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 18 22:42:54 2020
@author: mike
"""
import numpy as np
import tensorflow as tf
from tensorflow import keras
from sklearn.model_selection import train_test_split
from tensorflow.keras.applications import VGG16
from tensorflow.keras import layers
fro... | en | 0.554216 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Mon May 18 22:42:54 2020 @author: mike | 2.388856 | 2 |
core/tests/test_polyflow/test_workflows/test_hyperband.py | erexer/polyaxon | 0 | 8286 | <reponame>erexer/polyaxon
#!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, 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
#
# Unle... | #!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, 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 ... | en | 0.799155 | #!/usr/bin/python # # Copyright 2018-2020 Polyaxon, 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 ... | 1.842221 | 2 |
Class Work oop.py | fatimatswanya/fatimaCSC102 | 0 | 8287 |
class Student:
studentLevel = 'first year computer science 2020/2021 session'
studentCounter = 0
registeredCourse='csc102'
def __init__(self, thename, thematricno, thesex,thehostelname,theage,thecsc102examscore):
self.name = thename
self.matricno = thematricno
self.sex = thesex
... |
class Student:
studentLevel = 'first year computer science 2020/2021 session'
studentCounter = 0
registeredCourse='csc102'
def __init__(self, thename, thematricno, thesex,thehostelname,theage,thecsc102examscore):
self.name = thename
self.matricno = thematricno
self.sex = thesex
... | none | 1 | 3.660264 | 4 | |
clickhouse_sqlalchemy/drivers/reflection.py | Fozar/clickhouse-sqlalchemy | 0 | 8288 | <reponame>Fozar/clickhouse-sqlalchemy
from sqlalchemy.engine import reflection
from clickhouse_sqlalchemy import Table, engines
class ClickHouseInspector(reflection.Inspector):
def reflect_table(self, table, *args, **kwargs):
# This check is necessary to support direct instantiation of
# `clickho... | from sqlalchemy.engine import reflection
from clickhouse_sqlalchemy import Table, engines
class ClickHouseInspector(reflection.Inspector):
def reflect_table(self, table, *args, **kwargs):
# This check is necessary to support direct instantiation of
# `clickhouse_sqlalchemy.Table` and then reflect... | en | 0.87837 | # This check is necessary to support direct instantiation of # `clickhouse_sqlalchemy.Table` and then reflection of it. | 2.291766 | 2 |
tests/test_disque.py | abdul-khalid/pydisque | 1 | 8289 | """
Unit Tests for the pydisque module.
Currently, most of these tests require a fresh instance of
Disque to be valid and pass.
"""
import unittest
import json
import time
import random
import six
from pydisque.client import Client
from redis.exceptions import ResponseError
class TestDisque(unittest.TestCase):
... | """
Unit Tests for the pydisque module.
Currently, most of these tests require a fresh instance of
Disque to be valid and pass.
"""
import unittest
import json
import time
import random
import six
from pydisque.client import Client
from redis.exceptions import ResponseError
class TestDisque(unittest.TestCase):
... | en | 0.807898 | Unit Tests for the pydisque module. Currently, most of these tests require a fresh instance of Disque to be valid and pass. TestCase class for pydisque. Setup the tests. Test the most important functions of pydisque. Fetch the queue, return a job, check that it's back. # NACK the first read # this time ACK it Test qpe... | 2.811587 | 3 |
src/runner.py | samirsahoo007/Naive-Bayes-and-Decision-Tree-Classifiers | 1 | 8290 | # -*- coding: utf-8 -*- #
"""*********************************************************************************************"""
# FileName [ runner.py ]
# Synopsis [ main program that runs the 'Naive Bayes' and 'Decision Tree' training / testing ]
# Author [ <NAME> (Andi611) ]
# Copyright [ Copyl... | # -*- coding: utf-8 -*- #
"""*********************************************************************************************"""
# FileName [ runner.py ]
# Synopsis [ main program that runs the 'Naive Bayes' and 'Decision Tree' training / testing ]
# Author [ <NAME> (Andi611) ]
# Copyright [ Copyl... | de | 0.234536 | # -*- coding: utf-8 -*- # ********************************************************************************************* # FileName [ runner.py ] # Synopsis [ main program that runs the 'Naive Bayes' and 'Decision Tree' training / testing ] # Author [ <NAME> (Andi611) ] # Copyright [ Copyleft(c)... | 2.371207 | 2 |
igibson/metrics/agent.py | Nick-AhSen/iGibson | 0 | 8291 | import copy
import numpy as np
import pybullet as p
from igibson.metrics.metric_base import MetricBase
class BehaviorRobotMetric(MetricBase):
def __init__(self):
self.initialized = False
self.state_cache = {}
self.next_state_cache = {}
self.agent_pos = {part: [] for part in ["l... | import copy
import numpy as np
import pybullet as p
from igibson.metrics.metric_base import MetricBase
class BehaviorRobotMetric(MetricBase):
def __init__(self):
self.initialized = False
self.state_cache = {}
self.next_state_cache = {}
self.agent_pos = {part: [] for part in ["l... | en | 0.372812 | # Exclude agent teleports | 2.174202 | 2 |
fontslice/__init__.py | Arahabica/font-subset-css | 0 | 8292 | <filename>fontslice/__init__.py<gh_stars>0
import sys
from .main import (
_chunk_list,
_get_unicode_range_hash,
convert_unicode_range,
get_120_unicode_ranges,
get_unicode_ranges_from_text,
generate_css,
main,
)
__all__ = [
"_chunk_list",
"_get_unicode_range_hash",
"convert_unico... | <filename>fontslice/__init__.py<gh_stars>0
import sys
from .main import (
_chunk_list,
_get_unicode_range_hash,
convert_unicode_range,
get_120_unicode_ranges,
get_unicode_ranges_from_text,
generate_css,
main,
)
__all__ = [
"_chunk_list",
"_get_unicode_range_hash",
"convert_unico... | none | 1 | 1.797869 | 2 | |
src/ttkbootstrap/dialogs/dialogs.py | MrJaatt/ttkbootstrap | 1 | 8293 | <filename>src/ttkbootstrap/dialogs/dialogs.py<gh_stars>1-10
"""
This module contains various base dialog base classes that can be
used to create custom dialogs for the end user.
These classes serve as the basis for the pre-defined static helper
methods in the `Messagebox`, and `Querybox` container cl... | <filename>src/ttkbootstrap/dialogs/dialogs.py<gh_stars>1-10
"""
This module contains various base dialog base classes that can be
used to create custom dialogs for the end user.
These classes serve as the basis for the pre-defined static helper
methods in the `Messagebox`, and `Querybox` container cl... | en | 0.655318 | This module contains various base dialog base classes that can be used to create custom dialogs for the end user. These classes serve as the basis for the pre-defined static helper methods in the `Messagebox`, and `Querybox` container classes. A simple dialog base class. Parameters: parent (... | 2.806757 | 3 |
Google-Play-Store-App-Rating/code.py | venky4121994/ga-learner-dsmp-repo | 0 | 8294 | <gh_stars>0
# --------------
#Importing header files
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
#Code starts here
data = pd.read_csv(path)
data.hist(['Rating'])
data = data[data['Rating']<=5]
data.hist(['Rating'])
#Code ends here
# --------------
# code starts here
total_null = dat... | # --------------
#Importing header files
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
#Code starts here
data = pd.read_csv(path)
data.hist(['Rating'])
data = data[data['Rating']<=5]
data.hist(['Rating'])
#Code ends here
# --------------
# code starts here
total_null = data.isnull().s... | en | 0.546025 | # -------------- #Importing header files #Code starts here #Code ends here # -------------- # code starts here # code ends here # -------------- #Code starts here #Code ends here # -------------- #Importing header files #Code starts here #Code ends here # -------------- #Code starts here #Code ends here # -------------... | 2.944648 | 3 |
converters/brat2iob.py | Banguiskode/nerds | 15 | 8295 | import argparse
import operator
import os
import re
import shutil
import spacy
import tempfile
from nerds.utils import spans_to_tokens, get_logger
def segment_text_to_sentences(text_file, sentence_splitter):
""" Segment text into sentences. Text is provided by BRAT in .txt
file.
Args:
... | import argparse
import operator
import os
import re
import shutil
import spacy
import tempfile
from nerds.utils import spans_to_tokens, get_logger
def segment_text_to_sentences(text_file, sentence_splitter):
""" Segment text into sentences. Text is provided by BRAT in .txt
file.
Args:
... | en | 0.576124 | Segment text into sentences. Text is provided by BRAT in .txt file. Args: text_file (str): the full path to the BRAT .txt file. sentence_splitter (spacy LM): SpaCy EN language model. Returns: sentences (list((int, int, str))): list of sentence spans. ... | 3.04345 | 3 |
kraken/lib/util.py | zjsteyn/kraken | 1 | 8296 | """
Ocropus's magic PIL-numpy array conversion routines. They express slightly
different behavior from PIL.Image.toarray().
"""
import unicodedata
import numpy as np
from PIL import Image
__all__ = ['pil2array', 'array2pil']
def pil2array(im: Image.Image, alpha: int = 0) -> np.array:
if im.mode == '1':
... | """
Ocropus's magic PIL-numpy array conversion routines. They express slightly
different behavior from PIL.Image.toarray().
"""
import unicodedata
import numpy as np
from PIL import Image
__all__ = ['pil2array', 'array2pil']
def pil2array(im: Image.Image, alpha: int = 0) -> np.array:
if im.mode == '1':
... | en | 0.578868 | Ocropus's magic PIL-numpy array conversion routines. They express slightly different behavior from PIL.Image.toarray(). Tests a PIL.Image for bitonality. Args: im (PIL.Image.Image): Image to test Returns: True if the image contains only two different color values. False otherwise. Dete... | 3.165573 | 3 |
analysis/calculate_holding_amount.py | hao44le/ico_top_holder_analysis | 538 | 8297 | import sys
sys.path.insert(0,'..')
from data.whale_data import exchnage_accounts
from data.html_helper import check_if_address_name_exists
from data.whale_eth_tx_data import *
from data.whale_token_tx_data import identify_investor_type_token
holding_account = "holding_account"
deposit_account = 'deposit_account'
withd... | import sys
sys.path.insert(0,'..')
from data.whale_data import exchnage_accounts
from data.html_helper import check_if_address_name_exists
from data.whale_eth_tx_data import *
from data.whale_token_tx_data import identify_investor_type_token
holding_account = "holding_account"
deposit_account = 'deposit_account'
withd... | en | 0.391642 | #如果当前账户从来没有向外打过token,ignore # build all traxe Y: holding_amount, deposit_amount, withdraw_amount | 2.221177 | 2 |
textbox/trainer/trainer.py | JBoRu/TextBox-1 | 1 | 8298 | # @Time : 2020/11/14
# @Author : <NAME>, <NAME>
# @Email : <EMAIL>
# UPDATE:
# @Time : 2020/12/2, 2020/11/27, 2020/12/3, 2020/12/26
# @Author : <NAME>, <NAME>, <NAME>, <NAME>
# @Email : <EMAIL>, <EMAIL>, <EMAIL>, <EMAIL>
r"""
textbox.trainer.trainer
################################
"""
import os
import torch
i... | # @Time : 2020/11/14
# @Author : <NAME>, <NAME>
# @Email : <EMAIL>
# UPDATE:
# @Time : 2020/12/2, 2020/11/27, 2020/12/3, 2020/12/26
# @Author : <NAME>, <NAME>, <NAME>, <NAME>
# @Email : <EMAIL>, <EMAIL>, <EMAIL>, <EMAIL>
r"""
textbox.trainer.trainer
################################
"""
import os
import torch
i... | en | 0.762766 | # @Time : 2020/11/14 # @Author : <NAME>, <NAME> # @Email : <EMAIL> # UPDATE: # @Time : 2020/12/2, 2020/11/27, 2020/12/3, 2020/12/26 # @Author : <NAME>, <NAME>, <NAME>, <NAME> # @Email : <EMAIL>, <EMAIL>, <EMAIL>, <EMAIL> textbox.trainer.trainer ################################ Trainer Class is used to manage the ... | 2.922995 | 3 |
rsserpent/plugins/builtin/__init__.py | EurusEurus/RSSerpent | 0 | 8299 | from ...models import Persona, Plugin
from . import example, example_cache, example_ratelimit, example_with_args
plugin = Plugin(
name="rsserpent-plugin-builtin",
author=Persona(
name="queensferryme",
link="https://github.com/queensferryme",
email="<EMAIL>",
),
repository="http... | from ...models import Persona, Plugin
from . import example, example_cache, example_ratelimit, example_with_args
plugin = Plugin(
name="rsserpent-plugin-builtin",
author=Persona(
name="queensferryme",
link="https://github.com/queensferryme",
email="<EMAIL>",
),
repository="http... | none | 1 | 1.771361 | 2 |